Development environment
Prerequisites
Section titled “Prerequisites”- Node.js 22 or later.
- pnpm. The repo is pnpm-only.
npmandyarnrefuse to install. - Docker is optional, for checking migrations against a throwaway Postgres (see Migrations).
Set up
Section titled “Set up”pnpm installcp .env.example .env.env lives at the repo root; the app reads it from there. Fill in:
VITE_SUPABASE_URL,VITE_SUPABASE_PUBLISHABLE_KEYandSUPABASE_SECRET_KEYfor the shared dev projectSUPABASE_ACCESS_TOKEN(your personal token),SUPABASE_PROJECT_REFandSUPABASE_DB_PASSWORD, used byscripts/supa.
The rest are optional. See Environment variables.
pnpm dev # app on http://localhost:3000 and docs on http://localhost:4321pnpm dev:app # app onlypnpm dev:docs # docs onlypnpm dev first runs scripts/supa-first-run.sh, which migrates a brand-new database
(see First-run setup). pnpm dev:app skips it.
The shared dev database
Section titled “The shared dev database”scripts/supa wraps the Supabase CLI. It loads .env, links to
SUPABASE_PROJECT_REF, and runs the command you give it. The scripts for real
per-branch databases (scripts/supa-create-branch.sh, supa-get-branch-ref.sh) are
kept, unused, for when the project moves to a paid plan.
Commands
Section titled “Commands”| Command | Does |
|---|---|
pnpm check |
Biome lint and format check (CI runs this) |
pnpm format |
Biome auto-format |
pnpm lint |
Biome lint only |
pnpm typecheck |
TypeScript across the workspaces |
pnpm test |
All workspaces’ tests, unit and integration (see Testing) |
pnpm build, build:app, build:docs |
Build everything, the app, or the docs |
./scripts/supa db push (or pnpm db:migrate) |
Apply migrations to the shared dev project |
pnpm db:new <name> |
Create a new migration file |
./scripts/supa pnpm api-key:create --org <uuid> --user <email> |
Mint a public API key, printed once |
pnpm release |
Draft the next GitHub release (see Deployment) |
Repo layout
Section titled “Repo layout”apps/app TanStack Start app (React 19) src/routes/ file-based routes; _authed/* need a session; api/* are server routes src/server/functions/ server functions, grouped by area src/server/middleware/ authMiddleware and orgMiddleware src/server/lib/ shared server logic (authz, import/export, maintenance, …) src/server/api/v1/ public HTTP API handlers src/graph/ pure graph logic (weighting, communities, betweenness) src/components/ UI: map-editor, map-visualiser, map-table, map-workspace, home, app-shell src/types/graph.ts the GraphData type shared by Edit and Visualiseapps/docs this site (Astro Starlight)packages/ bluesky_to_graph, csv-to-graphmlsupabase/ migrations and email templatesscripts/ supa (Supabase wrapper), supa-*.sh, releaserender.yaml Render blueprintapps/app/README.md has more on the app’s own structure.