Production-grade Node.js boilerplate. Ready for your next project.
Tech Stack:
- Node.js
- TypeScript
- Express.js
- Zod
- Prisma
- Winston
- PostgreSQL
- Jest
- Supertest
- Docker Compose
- Node.js (v20)
- Docker
Environment variables for development:
cp .env.example .envUpdate the .env file with the correct values. For database credentials, use the values from the docker-compose.yml file.
Environment variables for testing:
cp .env.test.example .env.testUpdate the .env.test file with the correct values. For database credentials, use the values from the docker-compose.yml file.
Install dependencies:
npm installCreate PostgreSQL databases using Docker Compose:
docker compose up -dRun migrations for main database:
npm run db-migrateRun migrations for test database:
npm run db-test-migrateFor development:
npm run devFor production:
Build the app:
npm run buildStart the server:
npm startRun only unit tests:
npm run test:unitRun only integration tests:
npm run test:integrationRun all tests (unit and integration):
npm test