28 lines
1.4 KiB
Markdown
28 lines
1.4 KiB
Markdown
# Local development
|
|
|
|
Needs Node.js 24, pnpm (`corepack enable`) and Docker.
|
|
|
|
```bash
|
|
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`, then `pnpm db:migrate` names and writes a migration.
|
|
`pnpm db:reset` starts over with the seed.
|
|
- **The API or the terminal protocol:** change the schemas and types in `packages/shared/src` first; the API and the
|
|
dashboard follow from the type errors. Protocol changes go in [terminal-protocol.md](terminal-protocol.md) too, and
|
|
raise `MIN_APP_VERSION` when older apps can't keep up.
|
|
- **Text on the dashboard:** `apps/dashboard/src/locales/en.json` and `nl.json` (a test checks both have every key).
|
|
- **Emails:** `apps/api/templates/emails`, see its README.
|
|
EOF
|