Local development
How to run the portal on your own machine, fill it with demo data and run the checks a pull request must pass. For a server, read Install instead. For the rules of contributing, read CONTRIBUTING.md.
What you need
Section titled “What you need”- Node.js 26 (the servers run 26.13.1,
deploy/node-release.env) and pnpm 10. Node 26 ships no corepack:npm install -g corepack@0.36.0 && corepack enablegives you the pnpm version inpackage.json - ffmpeg, for video processing
- Docker, or a local PostgreSQL 17 with pgvector and Redis 7
Start it
Section titled “Start it”pnpm installdocker compose up -d # PostgreSQL on :5432, Redis on :6379pnpm dev # API on :4000 (applies the migrations), web app on :3000Open http://localhost:3000, create an organisation, and build a first course under Author.
The defaults in apps/api/.env.example and apps/web/.env.example work with docker compose.
Configuration lists every setting with its default and meaning.
Without outside services
Section titled “Without outside services”The portal runs locally without any vendor account. Each feature that needs one falls back to something you can see:
| Feature | Locally, without a vendor | To use the real thing |
|---|---|---|
| AI | A deterministic stand-in answers by quoting course passages | An organisation connects its model under Admin → Integrations → Language model. For development only, ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY or MISTRAL_API_KEY in apps/api/.env (optionally AI_PROVIDER, AI_MODEL). Production ignores them |
| Invitations, sign-in links and password resets are printed to the API log | Set in the admin console under Mail (one SMTP server or Microsoft 365), with MAIL_SETTINGS_KEY |
|
| Live sessions | Peer to peer through your own TURN server (TURN_URLS, TURN_SECRET), without either no audio or video |
A LiveKit server (LIVEKIT_*) |
| Transcripts | Uploaded WebVTT or SRT captions | A speech recognition model of the platform’s AI (admin console) or the organisation’s |
| Code lab | The tests run Python and JavaScript in a child process (test/process-sandbox.ts) |
A lab node’s agent against the local API (the lab node repository’s README, ADR 0497) |
To try live features, open the portal in a second browser as another user. The stage, polls, questions, breakouts, the activity feed and course presence then update on both sides.
From another machine
Section titled “From another machine”To open a development instance at, say, http://203.0.113.10:
- Web app: run the production build (
pnpm --filter @academy/web build && pnpm --filter @academy/web start). The dev server serves its scripts only tolocalhostunless you setALLOWED_DEV_ORIGINS=203.0.113.10. - API address: the browser uses port 4000 on the page’s host. On a domain it uses the
api.subdomain (academy.example.com→api.academy.example.com). For anything else, setNEXT_PUBLIC_API_URL. - API settings:
CORS_ORIGINS=http://203.0.113.10:3000,PUBLIC_WEB_URL=http://203.0.113.10:3000,PUBLIC_API_URL=http://203.0.113.10:4000.
Demo data and screenshots
Section titled “Demo data and screenshots”With API and web app running in development (AUTH_MODE=dev):
node apps/api/scripts/demo-seed.mjs # organisation "demo": owner@, admin@, trainer@, learner@demo.testnode apps/web/scripts/help-screenshots.mjs # retakes the handbook pictures in English (Chrome or CHROME_PATH; ONLY=name,… for some)node apps/web/scripts/help-screenshots-live.mjs # the pictures from inside a live session (FAKE_CAMERA=file.y4m for a calm picture)The cast for the role test scenarios has a seed of its own. Run it on a database of its own, as that page explains.
The pictures of a learner with a platform account (My learning, Pro, purchases) need such an
account. Sign up at /signup, confirm with the link in the API log, and pass
DEMO_ACCOUNT_EMAIL and DEMO_ACCOUNT_PASSWORD. The evidence part of the HR systems page needs a
connected HR system that takes evidence (HR_EVIDENCE=1).
The handbooks
Section titled “The handbooks”The handbooks are Markdown in apps/docs/src/content/docs/en/<handbook>/. The portal’s Help and
the docs site read the same files (ADR 0274). The
guides for servers and developers are the files in this folder, and the docs site copies them in
when it is built (apps/docs/src/repo-docs.mjs). Retake a page’s screenshots after changing the
screen it shows.
pnpm --filter @academy/docs dev # the docs site on http://localhost:4321Checks
Section titled “Checks”pnpm typecheckpnpm test # API tests need PostgreSQL and Redis; they reset the academy_test database and Redis DB 15pnpm buildpnpm licences:check # after adding or updating a dependencyThe repository’s CI runs the same checks on every pull request, against PostgreSQL 17 and Redis.
To run one test file: pnpm --filter @academy/api exec vitest run test/<name>.test.ts. Some files
are generated, and their tests fail until you regenerate them. CONTRIBUTING.md
lists which.
Drills and load tests
Section titled “Drills and load tests”# Regional failover with a throwaway primary and standby (needs root and the PostgreSQL 17 server binaries)pnpm --filter @academy/api buildpnpm --filter @academy/api exec tsx scripts/failover-drill.ts # asynchronous replicationpnpm --filter @academy/api exec tsx scripts/failover-drill.ts --sync # synchronous: no acknowledged write may be lost
# Collaboration load against running API nodespnpm --filter @academy/api exec tsx scripts/collab-load.ts http://localhost:4000 http://localhost:4001The API describes itself
Section titled “The API describes itself”Signed in, GET /v1/openapi.json gives the OpenAPI 3.1 description of every route, and
GET /v1/api-docs a readable reference. GET /v1/integration-api/openapi.json gives the stable
automation API with its versioning promise (automation API). Every route
also has an MCP tool (list).
How a server gets a version
Section titled “How a server gets a version”Every installation builds from its own checkout of the repository and runs only the built runtime (ADR 0444).
- An administrator updates the checkout and runs the update:
sudo git -C <checkout> pull --ff-only && sudo <checkout>/deploy/update.sh(it never pulls itself, ADR 0481). It builds there and delivers the runtime intoAPP_DIR/releases/<commit>. Every migration says whether the running code survives it (-- deploy: expandor-- deploy: contract), and CI checks that it does (scripts/release/migration-classes.mjs). - Before pending migrations it dumps the schema over the network, then migrates, switches the
link
currentand checks the services. A failure restores the dump and switches back, andsudo deploy/update.sh rollbackgoes back to the release before.
The details are in Deploy and update.
This repository is exported from the maintainers’ own Git server once per release
(The open-source projects). From the first public
release on, self-hosters install the public tree the same way, from a checkout of a tagged commit. Each running installation links the
source of its exact version (the footer’s Source code link and GET /v1/source).