Public monorepo for the RWKV app download website and its supporting backend API.
# local development
pnpm dev
# production deployment
pnpm deploy:prod- Eval run zip format:
docs/eval-run-zip-format.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 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
For the current nginx + PM2 setup, frontend/out is the canonical frontend build output.
- 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:
- frontend: build
frontend/outand letnginxserve it directly - backend: build the NestJS app and run it with
PM2
The canonical one-command production publish command is:
pnpm deploy:prodThis command is intended to run on the production server. It:
- builds the frontend into
frontend/out - keeps
frontend/outas the live static directory fornginx - prepares Prisma
- builds the backend
- restarts or starts
rwkv-backendunderPM2
Each 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.