# rnapp-release **Repository Path**: gditv/rnapp-release ## Basic Information - **Project Name**: rnapp-release - **Description**: 开源一体化电视RN应用发布系统(含前后端) - **Primary Language**: NodeJS - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-01 - **Last Updated**: 2026-07-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # rnapp-release Local "应用管理" demo for uploading, viewing, publishing, and downloading app packages. ## Run From npm ```bash npx rnapp-release ``` Or install globally: ```bash npm install -g rnapp-release rnapp-release ``` ## Run From Source ```bash npm install npm run build npm run start ``` The service starts on port `3000` by default. Override it with: ```bash rnapp-release --port 3100 PORT=3100 rnapp-release ``` Runtime data is stored in `./app-manager-demo-data` under the directory where the command is run. On startup the service prints a default super admin account and password. The first startup generates the password and stores it in `app-manager-demo-data/super-admin.secret.json`; later startups reuse and print the same credentials. Use this account to sign in and create managed accounts from the user management page. Roles are: - Super admin: manage users, add/edit/delete apps, publish versions, and delete versions. - Admin: add/edit apps, publish versions, and delete versions. - Normal user: publish versions only. ## Demo Workflow 1. Start the service. 2. Open the printed local URL. 3. Click "新增应用". 4. Enter application metadata and optional normal/focus icons. 5. Publish a built RN `.zip` package. 6. Download the published release package. Runtime files are created in `app-manager-demo-data/`. Created apps keep the original management parameters in API responses: `appType` defaults to `rn-tv`, `appId` defaults to `0`, and app icons are returned as `normalIcon` and `focusIcon`. The server writes runtime logs to stdout/stderr. Every request is logged with method, path, status, duration, and client IP. Release publishing and RN-CORE parsing also log success and failure details to help diagnose upload issues. Startup logs print localhost plus detected network interface URLs with the configured port. ## RN Release Package The uploaded `.zip` should contain the React Native build output, not the RN project source code. A typical package contains `index.android.bundle` and the asset files copied by `react-native bundle`. The service finds `index.android.bundle` anywhere inside the zip and tries to read the RN-CORE dependency version from `ipanel-rntv-core`, `rntv-core`, or a `coreVersion` marker. The publish form fills this value automatically after you choose the package. If parsing fails, the form shows the failure reason and then lets you enter `coreVersion` manually. ## Java-compatible RN Update API RN clients can call the Java-compatible update endpoint: ```bash curl "http://localhost:3000/s/jshomeapp/tv/getRnAppInfo?appEnglishName=tv_sports&coreVersion=v1.0.138" ``` Clients that list already released RN apps for an operator can use the Java-compatible REST endpoint. The operator UUID is accepted as a path segment; local demo releases that use the default `all` operator are returned for any operator UUID: ```bash curl "http://localhost:3000/s/jshomeapp/tv-operator/operator-uuid/released-rn-apps?platform=android" curl "http://localhost:3000/jshomeapp/tv-operator/operator-uuid/released-rn-apps?platform=android" ``` Successful responses use `code: 0`, `msg: "操作成功"`, and return either one matching release object or `data: null`. Business validation errors use `code: 500002`. Published releases generate `versionCode` values as `v1.0.0`, `v1.0.1`, and so on. The update API returns Java-compatible fields such as `versionCode`, `coreVersion`, `upgradeMode`, `fileMd5`, `packZipUrl`, `normalIcon`, and `focusIcon`. `packZipUrl` is an absolute URL under `/jshomeapp/appFiles/packFiles/...zip`. The management UI treats upgrades as automatic; `upgradeMode` is kept as a Java-compatible protocol field and defaults to `0`.