Skip to content
Preview. LawFive's code and server image aren't public yet, so some steps here won't work until they are.

The server and web app

You’ll need Node 24 or later and pnpm. Install from the repository’s root:

Terminal window
pnpm install

This is the quickest way to work on anything. It runs in memory, with sample data and no database or Docker.

Terminal window
cd server && pnpm demo
cd web && pnpm dev # in a second terminal

Open 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.

Terminal window
cp .env.example .env # then set AUTH_SECRET
docker compose -f compose.yaml -f compose.dev.yaml up -d db
cd server && pnpm dev # reads ../.env, and restarts on changes
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.
  • 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.