Naalya Handbook

Environments

Local, staging and production as written in committed config, how the branches relate, and what has not been checked live.

Use this page when a command or URL depends on where you are. Everything here comes from committed config and GitHub compares. No host was probed: nothing here signed in to a deployed site or read Railway's live variables.

Branches

RepositoryDay-to-day work lands onProduction builds from
Naalya-APIstaging (default)main
Education-Hubstaging (default)main
Naalya-Websitemain (default, protected)main
dev-handbookmainmain (this site)

A push to main on the API or Hub is the production release. Read staging for what's being built now; read main for what production is configured to run. A commit id is not proof of what a host is running.

Where they stand (GitHub compare, 14 November 2026):

RepositoryProduction mainstaging aheadstaging behind
APIb256209c1419 commits, 114 files27 commits
Hub24747bba8610 commits, 39 files20 commits
Websitemain contains all of staging, plus 132 commits

The "behind" commits are release merges (release: prod release) plus one API Teams Rover hotfix whose result is already in staging. Nothing exists only on production main. Handbook pages describe the staging side for the API and Hub, and main for the website.

Hosts and settings

Locally: API http://localhost:8000, Hub http://localhost:3000, realtime http://localhost:8006, clinic API http://localhost:8100. You set NODE_ENV to development in .env.local; on the API that turns off basic auth on the docs and /queues. School data is whatever your DATABASE_URL points at.

StagingProduction
APIstaging.api.naalyaschools.ac.ugapi.naalyaschools.ac.ug
Hubstaging.hub.naalyaschools.ac.ughub.naalyaschools.ac.ug
Realtimestaging.realtime.naalyaschools.ac.ugrealtime.naalyaschools.ac.ug
Clinic APIstaging.clinic-api.naalyaschools.ac.ugclinic-api.naalyaschools.ac.ug
Websitehttps://naalyaschools.ac.ug (hardcoded SITE_URL)
Hub NODE_ENVstagingproduction
API copies (apiReplicas)12
Worker copies (workerReplicas)12
Rover replies per worker (roverRepliesPerWorker, sets AGENT_QUEUE_PREFETCH)2030
Background Rover jobs per worker copy (roverJobsPerWorker)10050
API waits for checksNoYes
Docs and /queues basic authOnOn
School dataNot inspectedNot inspected

Worker copies are 1 on staging and 2 on production at API main d0fbb4030a82d967dabf2924f2dd2bdf69de3af0 (merge of PR #684, 27 November 2026, 05:54 GMT). It shares tree b5541dbd743bd310a98aa75ad70e34f6be00a3c2 with staging cbad7b4a604721243241066f96ac6f3368af5e45, so PR #682 is on main. Compare 6bfb9f6b...d0fbb403 changes that production count from 3 to 2 and nothing else in .railway/environments.ts. apiReplicas stays 2. The staging block stays at 1. A merge to main is not a running deploy. No host was checked.

Settings can differ from schema defaults: Railway sets JWT_ACCESS_TOKEN_EXPIRATION_MS to 86400000 (a day), while the schema default is 900000 (15 minutes). See Authentication.

The jobs row is the same file. At the API default branch staging ed0e56f8, and on main d0fbb403 (the file is not in compare d0fbb403...ed0e56f8), roverJobsPerWorker is 100 on staging and 50 on production. RoverJobProcessor reads process.env.ROVER_JOB_CONCURRENCY when the file loads and uses 5 when that value is missing or not a number. .railway/railway.ts was not re-opened. GitHub Actions run 45252018549 finished apply-production for the earlier commit a888ae35. The logs were not opened, so this row is not a reading of a running worker.

The website's api.config.toml points codegen at https://tunnel.chowbea.com/docs/swagger/json, not the production API. Runtime calls use VITE_API_URL; don't assume the two serve the same revision.

Running locally

Env file. Copy .env.example to .env.local (the API's task env does it) and fill the placeholders. Never commit it.

Bring a database and broker. task infra starts Redis, Centrifugo and Gotenberg only. Use any Postgres with pgvector and pg_trgm, and any AMQP 0-9-1 broker.

Set up. task setup refuses an empty DATABASE_URL, then starts infra and runs migrations, so point it at a database you may migrate.

The clinic's Postgres and PowerSync are optional: pnpm infra:ehr. Never copy a production dump to your machine; see Security and example data. More on Getting started.

How each repo deploys

RepoIn gitNot verified
APIdeploy-migrations.yml runs migrations (schools and clinic) on push to staging or main (prod environment). .railway/ holds the service configA deploy succeeding. A 14 November control-plane read matched the replica counts, without a commit id
HubRailway RAILPACK build, health check /robots.txt, one replica. CI lints, tests and buildsThe unused Dockerfile
WebsiteA Dockerfile (react-router-serve) and sanity-deploy.yml for the CMSWhere the site container is hosted: no workflow builds it

API versioning

There is one prefix, api/v1, set as a string in main.ts. There is no enableVersioning, so a breaking change changes the only version. The clinic's public spec is separate: Naalya Clinic API at /api/v1/external/openapi.json.

On this page