Updated 2026-10-24 - link the operations runbook and the release tags; Documentation owns.
A ward and bed-coordination prototype for mental health services: referrals, patient movements, transport, delays and capacity.
All patient data is synthetic. This is a development prototype, not an approved system for real patient care. Never enter real patient information.
You need Node.js >=24.22.1 <25 (the exact release is pinned in .nvmrc) and npm 11. Any OS works.
npm ci # installs dependencies and the Git hooks
npm run ensure # starts or reuses the dev server and prints its URLOpen the printed URL plus /ward-flow. No credentials are needed: by default the app runs on synthetic, browser-local state. See local first run for the details.
The shared backend has its own packages. Install them once before npm run test:backend (which builds the backend engine, then runs its tests):
npm ci --prefix backend/ward-flow| Task | Command |
|---|---|
| One unit test file (fast) | node scripts/run-vitest.mjs run tests/ward-model.test.ts |
| Unit tests for your changes | npm run test:related |
| All unit tests | npm run test |
| Lint (zero warnings allowed) | npm run lint |
| Typecheck | npm run typecheck |
| Format the files you changed | npm run format -- --files <paths> |
| Ward browser journeys | npm run test:e2e:ward-journeys |
| Release gate journeys (desktop Chrome, phone WebKit) | npm run test:e2e:release-gate |
| Shared backend tests | npm run test:backend |
| Pre-push checks for your change | npm run verify:pr-local |
- Framework: Next.js 16 with React 19 and TypeScript. Styling is CSS Modules.
- Screens: routes live under
src/app/ward-flow/. Screen components and the workflow engine live undersrc/components/ward-management/. - State: one reducer holds the ward flow (referrals, movements, beds, transport, delays). Screens dispatch actions to it, and the synthetic seed data lives beside it.
- Shared workspace (optional):
backend/ward-flow/saves the shared state to Ward Flow's own synthetic-only database. The current provider is in DATABASE.md. Ward Flow must never connect to PsychSift's Supabase or Railway resources. - Tests: Vitest unit and DOM tests in
tests/, Playwright journeys intests/*.spec.ts.
- Every pull request runs Ward Flow CI. Its scope plan selects executable static checks, four unit shards, browser journeys, the release gate and a production build; documentation checks and a secret scan still run for narrower changes. See scope by change.
Ward Flow requiredchecks the selected results and permitted skips. - Dependabot opens grouped dependency updates each Monday.
- Railway deploys the
livebranch, notmain. A daily release workflow at 6 am Perth movesliveto the newest CI-passedmaincommit (HOW-WE-WORK §4), so merging intomaindoes not change the live site. Build, start and health check settings are recorded in hosting; day-to-day checks and rollback are in the operations runbook. A green CI run does not prove a deploy; check the hosted app directly. - Each
maincommit that passes CI is taggedrelease-YYYY-MM-DD-<short sha>(release tag workflow), giving a named point to compare or roll back to.
- Documentation by task: user guides, engineering, operations and historical records.
- Ward Flow documentation: the product, accepted design and working behaviour.
- AGENTS.md and how we work: rules for contributors and coding agents.
- Decisions and current facts.
- Original source README, kept for history.
The existing licence is retained. Public visibility does not grant an additional open-source licence.