Prerequisites
Before you start, make sure you have the following installed:Docker
Docker and Docker Compose are required to run PostgreSQL 17 and the API in containers.
Node.js 22 LTS
The API targets Node.js 22. Install it from nodejs.org or via a version manager like
nvm.Get up and running
Run the setup script
The setup script installs dependencies, copies the environment file, and starts the Docker containers for you.Alternatively, if you want to start the containers directly without the interactive setup:This runs
docker compose up --build, which starts both the PostgreSQL 17 database and the NestJS API.The first build may take a couple of minutes while Docker pulls the base images and installs npm packages inside the container.
Run database migrations and seed data
Once the containers are running, apply the Drizzle ORM migrations and load the initial seed data:Or reset, migrate, and seed everything in one command:
Explore the API with Swagger UI
The interactive Swagger UI is available at:access_token and all subsequent requests will include the Bearer header automatically. The token is persisted in localStorage between page refreshes.
Useful commands
| Command | What it does |
|---|---|
npm run dev | Start all containers (PostgreSQL + API) |
npm run down | Stop containers |
npm run db:migrate | Run pending Drizzle migrations |
npm run db:seed | Load initial data |
npm run db:fresh | Reset + migrate + seed in one step |
npm run docker:logs | Stream API logs from Docker |
npm run docker:shell | Open a bash shell inside the API container |