1.4 KiB
1.4 KiB
Local development
Needs Node.js 24, pnpm (corepack enable) and Docker.
docker compose up -d # PostgreSQL on localhost:5432, with kooltap and kooltap_test
cp .env.example apps/api/.env
echo 'NEXT_PUBLIC_API_URL=http://localhost:3001/api/v1' > apps/dashboard/.env.local
pnpm install # also generates the Prisma client
pnpm db:migrate # applies migrations; makes a new one when the schema changed
pnpm db:seed # demo venues, a user per role, a terminal, products and tabs
pnpm dev # API on :3001, dashboard on :3000
The seed prints the accounts to sign in with, and the demo terminal's token: pnpm simulate uses it to play a
terminal.
Changing things
- The database: edit
apps/api/prisma/schema.prisma, thenpnpm db:migratenames and writes a migration.pnpm db:resetstarts over with the seed. - The API or the terminal protocol: change the schemas and types in
packages/shared/srcfirst; the API and the dashboard follow from the type errors. Protocol changes go in terminal-protocol.md too, and raiseMIN_APP_VERSIONwhen older apps can't keep up. - Text on the dashboard:
apps/dashboard/src/locales/en.jsonandnl.json(a test checks both have every key). - Emails:
apps/api/templates/emails, see its README. EOF