septm-backend is a NestJS HTTP API that powers a Seven Wonders score tracking backend (users, games, scoring, and extensions) backed by PostgreSQL and Prisma.
The goal of this documentation is to make it fast to:
- Run the project locally
- Contribute without breaking things
- Understand the main architectural decisions
For detailed documentation, see docs/README.md.
- Node.js: 20+
- Package manager:
pnpm(seepackageManagerfield inpackage.json) - Database: PostgreSQL (a local instance can be started via Docker)
pnpm installCreate a .env file at the root of the project (or reuse your own mechanism) with at least:
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/septm
PORT=3000
JWT_SECRET=change-meAdapt DATABASE_URL and JWT_SECRET to your environment.
pnpm run start:local:databaseThis uses docker-compose.local.yml to start a PostgreSQL instance suitable for local development.
pnpm run prisma:migrate:dev -- <migration-name>
pnpm run prisma:db:seedThe Prisma schema and seed live under prisma/. See docs/architecture/prisma.md for conventions.
# development (no watch)
pnpm run start
# development with watch
pnpm run start:dev
# production build
pnpm run build
pnpm run start:prodOnce running, the API is exposed (by default) on:
- Base URL:
http://localhost:${PORT}/api/v1 - Health check:
http://localhost:${PORT}/health
- Project
start,start:dev,start:prod: run the NestJS applicationbuild: compile TypeScript to JavaScript
- Database / Prisma
start:local:database: start local Postgres via Dockerstop:local:database: stop the local Postgres containerprisma:generate: generate Prisma clientprisma:migrate:dev: run dev migrationsprisma:db:seed: seed the databaseprisma:db:push: push the schema without migrations (dev only)
- Code quality / tests
lint: run ESLint with--fixformat: run Prettier onsrc/andtest/test,test:watch,test:cov,test:e2e: Jest test commands
All project documentation lives under docs/:
docs/README.md: documentation index and philosophydocs/architecture.md: high-level NestJS and system architecturedocs/architecture/prisma.md: Prisma and database conventionsdocs/api.md: API conventions, base URLs, error formatdocs/adr/: Architecture Decision Records (ADRs)docs/runbook.md: operational notes for running/debugging the service
If you add or change any significant behaviour or architecture, please:
- Update the relevant section under
docs/ - Add or update an ADR under
docs/adr/if the decision is important or hard to reverse