Next.js App Router app for the Delineo UI, auth, database-backed API routes, and file-backed simulation data storage.
Production is deployed from main, so do normal feature and fix work on a short-lived branch or worktree.
- Node.js and pnpm. The project pins
pnpm@10.29.1inpackage.json. - PostgreSQL for Prisma and Better Auth data.
- The sibling Delineo Algorithms service on
http://localhost:1880. - The sibling Delineo Simulation service on
http://localhost:1870.
From this directory:
pnpm install
cp .env.example .env
pnpm db:generate
pnpm db:migrate
pnpm devpnpm install runs prisma generate through postinstall. Run pnpm db:generate again after Prisma schema changes.
The dev app runs at http://localhost:3000.
Create .env from .env.example. Prisma CLI commands load .env directly.
PRISMA_DB_URL=postgresql://<user>:<password>@localhost:5432/<database>
BETTER_AUTH_URL=http://localhost:3000
BETTER_AUTH_SECRET=<generated-secret>
DB_FOLDER=./db/
NEXT_PUBLIC_ALG_URL=http://localhost:1880/
NEXT_PUBLIC_SIM_URL=http://localhost:1870/
ALG_URL=http://localhost:1880/
PRISMA_DB_URLis used by Prisma and the Postgres client.BETTER_AUTH_URLandBETTER_AUTH_SECRETconfigure Better Auth. Generate a local secret withopenssl rand -base64 32.DB_FOLDERmust point to a writable directory for generated PAP, movement pattern, simulation, and map-cache files.NEXT_PUBLIC_ALG_URLis used by client-side Algorithms calls.NEXT_PUBLIC_SIM_URLis used by client-side Simulation calls.ALG_URLis an optional server-only override used by the lookup-location API route; it falls back toNEXT_PUBLIC_ALG_URL.
The Fullstack app expects both sibling services to be running for the full create-zone and simulation workflows.
Algorithms:
cd ../Algorithms
python -m pip install -r requirements.txt
cd server
python server.pyDefaults to http://localhost:1880. The Algorithms service uses FULLSTACK_URL=http://localhost:3000 by default when it needs to call back into Fullstack.
Simulation:
cd ../Simulation
python -m pip install -r requirements.txt
python app.pyDefaults to http://localhost:1870. The Simulation service uses DELINEO_DB_URL=http://localhost:3000/api/ by default for Fullstack API access.
pnpm dev # Next.js dev server
pnpm build # Production build
pnpm start # Serve a production build
pnpm lint # Biome lint over src
pnpm typecheck # TypeScript no-emit check
pnpm test # Node test runner for src/**/*.test.mjs
pnpm db:generate # Generate Prisma client into src/generated/prisma
pnpm db:migrate # Run local Prisma migrationsUse pnpm db:reset or pnpm db:push only for disposable local databases; both can replace local database state.
Postgres stores users, auth records, convenience-zone metadata, and simulation run metadata. Larger generated payloads live under DB_FOLDER, with IDs referenced from Postgres records. These include PAP data, movement patterns, simulation output, pattern output, and map caches.
Before handing off a refactor change, run:
pnpm lint
pnpm typecheck
pnpm test
pnpm buildIf the change touches Prisma schema or database behavior, also run the relevant Prisma command, usually pnpm db:generate and pnpm db:migrate against a local database.