The server and web app
You’ll need Node 24 or later and pnpm. Install from the repository’s root:
pnpm installThe demo server
Section titled “The demo server”This is the quickest way to work on anything. It runs in memory, with sample data and no database or Docker.
cd server && pnpm democd web && pnpm dev # in a second terminalOpen http://localhost:5173, and sign in as [email protected] with the password lawfive-demo.
The demo’s weather is made up, so every risk badge shows. DEMO_WEATHER=live pnpm demo fetches real forecasts instead. It forgets everything when it restarts.
With a real database
Section titled “With a real database”cp .env.example .env # then set AUTH_SECRETdocker compose -f compose.yaml -f compose.dev.yaml up -d dbcd server && pnpm dev # reads ../.env, and restarts on changesCommands
Section titled “Commands”| Folder | Command | What it does |
|---|---|---|
server/ |
pnpm test |
Type check, then the API tests. They use an in-process Postgres, so they need no database or Docker. |
server/ |
pnpm dev |
Runs the server, restarting on changes. |
server/ |
pnpm db:generate |
After changing src/db/tables.ts, writes a new migration. |
web/ |
pnpm test |
Type check. |
web/ |
pnpm build |
Builds the web app to dist/. |
web/ |
pnpm screenshots |
Takes pictures against the demo: light and dark, desktop and phone. |
schema/ |
pnpm generate |
Remakes everything generated from the schema. |
schema/ |
pnpm test |
Checks the schema and its examples. |
Rules that keep it working
Section titled “Rules that keep it working”- Never edit a committed migration. Add a new one. Migrations run when the server starts.
- Describe new endpoints in
schema/src/endpoints.ts. The tests check that the server’s routes are exactly the ones listed, and that every answer is one it describes. - Check visible changes on screen, with
pnpm screenshots.