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 .env
Update 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.test
Update the .env.test
file with the correct values. For database credentials, use the values from the docker-compose.yml
file.
Install dependencies:
npm install
Create PostgreSQL databases using Docker Compose:
docker compose up -d
Run migrations for main database:
npm run db-migrate
Run migrations for test database:
npm run db-test-migrate
For development:
npm run dev
For production:
Build the app:
npm run build
Start the server:
npm start
Run only unit tests:
npm run test:unit
Run only integration tests:
npm run test:integration
Run all tests (unit and integration):
npm test