Public monorepo for the RWKV app download website and its supporting backend API.
# local development
pnpm devFor production publishing, mention docs/deploy.md to the agent.
- Eval run zip format:
docs/eval-run-zip-format.md - Production publish agent runbook:
docs/deploy.md
app_website/
├── backend/ # NestJS backend API and admin endpoints
├── frontend/ # Next.js frontend
├── tools/ # maintenance scripts
└── package.json # workspace scripts
- NestJS
- Prisma
- TypeScript
- SQLite
- Next.js
- React
- Jotai
- TypeScript
The current production architecture is:
- the frontend is built locally as a static export into
frontend/out nginxserves the static frontend- the backend runs separately under
PM2 nginxproxies API traffic to the backend, which listens on port3462by default
Production publishes use local-built release artifacts. The server runs
/root/app_website-artifacts/current and keeps .env, SQLite data, and logs in
/root/app_website-runtime/backend.
- Node.js >= 18
- pnpm >= 8
pnpm install
cp backend/.env.example backend/.env.local
cp frontend/.env.local.example frontend/.env.localThen edit the copied files and replace placeholder values with your local configuration.
For local development, prefer backend/.env.local and frontend/.env.local. If backend/.env also exists, .env.local should contain your local overrides such as the local backend port.
Recommended local development defaults:
- frontend:
http://localhost:3010 - backend:
http://localhost:3001
pnpm devNotes:
pnpm devstarts both frontend and backend together- the browser talks only to
http://localhost:3010 - the Next.js dev server rewrites API requests to the backend origin configured in
frontend/.env.local - this avoids browser-side cross-origin requests during local development
- if you need to run the services separately, use
pnpm --filter backend devorpnpm --filter frontend dev
pnpm buildThis builds the frontend static export into frontend/out and also builds the backend application.
Typical production responsibilities are split as follows:
- local machine: run checks, build frontend/backend, and upload a release artifact
- server: install Linux runtime dependencies, prepare Prisma, switch
current, and restart PM2
The preferred production publish entry is the agent runbook:
Mention that file to the agent when you want to publish. The runbook asks the agent to:
- syncs the latest
zh-Hansrelease note intozh-Hant,en,ja,ko, andru - commits local changes when needed
- pushes the commit to the configured Git remote
- runs
pnpm check - builds
frontend/outandbackend/dist - writes
.release/app-website-<git-sha>-<timestamp>.tar.gz - uploads the artifact to
rwkv.halowang.cloud - points
/root/app_website-artifacts/currentat the new release - prepares Prisma on Linux and restarts
rwkv-backendunderPM2
The artifact build uses the committed local HEAD for release.json and
build-info.json. The server no longer needs to pull source code with Git for
normal production publishes.
The lower-level artifact upload command used by the runbook is:
pnpm deploy:prodIf you need the old server-side source build path for emergency maintenance, run:
pnpm deploy:prod:server-buildEach frontend build also writes deployment metadata into frontend/public/build-info.json, which is exported as /build-info.json in the final site. This is used as a build marker so you can verify which frontend build is currently online.
You can check it with:
curl https://rwkv.halowang.cloud/build-info.jsonYou can also inspect the page source or DevTools and look for these meta tags:
rwkv-build-summaryrwkv-build-timerwkv-build-sourcerwkv-build-commit-short
For production, prefer real environment variables or a server-local backend/.env or backend/.env.local file on the host. Do not commit production secrets.
The repository is public, so no real secrets are committed here.
Best practice in this repository:
- commit example files such as
backend/.env.exampleandfrontend/.env.local.example - do not commit real
.env,.env.local,.env.development.local, or production secret files - do not introduce a custom
.developfile name; use the standard.env.local/.env.developmentconventions instead
Use backend/.env.example and frontend/.env.local.example as templates and provide real values only in your local or deployment environment.
Common variables:
HOSTPORTADMIN_USERNAMEADMIN_PASSWORDADMIN_TOKEN_SECRETADMIN_TOKEN_TTL_HOURSHF_DATASETS_IDHF_TOKENHF_ENDPOINTGITHUB_REPOGITHUB_TOKENGITHUB_WEBHOOK_SECRETPGYER_API_KEYPGYER_APP_KEYBACKEND_ORIGIN
Please do not commit real credentials, tokens, private server-specific secrets, or private environment files to this repository.