npmrunbuild# first time or after src changes if not using dev watch
npmrundev# nest start --watch
# or run compiled:
npmrunstart
```
- Health: http://127.0.0.1:3000/health
- API prefix: `/api/...`
## Frontend (sibling repo)
Vue app: `gold_land_user` on Gitea — dev http://localhost:5174, proxies `/api` to this backend.
## CI (Gitea Actions)
Workflow: [`.gitea/workflows/ci.yml`](.gitea/workflows/ci.yml) (runs on **push** / **pull_request** when **act_runner** is available — **not verified** on `get.feep.ir` from this repo alone).
### Job **checks**
```powershell
npmci
npmruntype-check
npmrunbuild
npmruntest
```
- **Node:** `22.18.0`
- **Env in job:** `NODE_ENV=test`, `JWT_SECRET=ci-test-jwt-not-for-production` (not production secrets)
- **Timeout:** 25 minutes
- **Cache:** npm optional via `actions/setup-node`
### Local equivalent
Same commands as the CI job above. Use a **clean** tree:
Browser E2E lives in **frontend** (`.gitea/workflows/ci.yml` job **e2e**). It clones this repo at a **pinned ref** (`frontend/e2e/backend.contract.json` + optional variable `E2E_BACKEND_REF`). Backend CI does not run Playwright.
### Runner prerequisites
- Node **22.18.0**
- Toolchain for **better-sqlite3** native module on Linux
### Secrets
This workflow needs **no** repository secrets. Frontend E2E may use `E2E_BACKEND_CHECKOUT_TOKEN` to clone this repo if it is private.
### Not yet verified on a real runner
- Workflow execution on `get.feep.ir` with registered **act_runner**
-`npm ci` + full test suite on a clean Linux runner (validated locally in a temp checkout — see stage 7 report)
Removed historical `test:cutover:*` scripts — see [docs/cutover-scripts-removed.md](docs/cutover-scripts-removed.md).
## Docker
`docker-compose.yml` in this repo runs backend only. Full stack compose lives in the **frontend** repo.
Trial deploy guide (6 lessons, placeholders, backup, rollback): [../frontend/docs/DEPLOY-TRIAL.md](../frontend/docs/DEPLOY-TRIAL.md) when repos are siblings, or `frontend/docs/DEPLOY-TRIAL.md` in the user repo.
**Live database path:** the script cannot restore directly onto configured `DB_PATH`. Stop the service, restore to a sibling file, swap files, remove stale `-wal`/`-shm`. See [docs/restore-production-db.md](docs/restore-production-db.md). `RESTORE_ACK_STOPPED=YES` is operator acknowledgment only — not a service stop detector.