Stop wiring up auth, databases, and configs from scratch. Start building your product.
Production-ready NestJS starter kit. Clone it, configure your .env, and ship — auth, database, docs, and Docker are already done.
- JWT Authentication (RSA256) with Role-Based Access Control
- PostgreSQL + TypeORM with migrations and connection pooling
- Swagger API Docs auto-generated at
/api - Docker Compose — one command to run everything
- Testing with Jest (unit + e2e)
- Code Quality with ESLint, Prettier, Husky, commitlint
- Security hardened with Helmet and CORS
- Health Checks built-in for production monitoring
- Node.js >= 20.0.0
- PostgreSQL (or use Docker)
git clone https://github.com/josephgoksu/prime-nestjs.git
cd prime-nestjs
npm install
cp .env.example .env
# Start with Docker (recommended)
npm run docker:up
# OR start locally
npm run start:devAPI available at http://localhost:3000 | Swagger docs at http://localhost:3000/api
npm run start:dev # Development with hot-reload
npm run build # Build for production
npm run start:prod # Run production build
npm run test # Run unit tests
npm run test:e2e # Run e2e tests
npm run test:cov # Generate coverage report
npm run lint # Lint and fix code
npm run format # Format code with Prettiernpm run schema:sync # Sync database schema (dev only)
npm run migration:generate # Generate migration from changes
npm run migration:run # Apply pending migrations
npm run migration:revert # Revert last migrationnpm run docker:build # Build containers
npm run docker:up # Start all services
npm run docker:down # Stop all servicessrc/
├── auth/ # JWT authentication & guards
├── config/ # App configuration
├── tasks/ # Task management feature
├── users/ # User management
└── main.ts # Application entry
# Database
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=mysecretpassword
POSTGRES_DB=postgres
# App
PORT=3000
NODE_ENV=development
# Auth (generate your own keys - see Security section)
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----..."
PUBLIC_KEY="-----BEGIN PUBLIC KEY-----..."# Generate private key
openssl genrsa -out private_key.pem 2048
# Extract public key
openssl rsa -in private_key.pem -pubout -out public_key.pem
# Format for .env (single line)
awk 'NF {sub(/\r/, ""); printf"%s\\n",$0;}' private_key.pem
awk 'NF {sub(/\r/, ""); printf"%s\\n",$0;}' public_key.pem- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'feat: add amazing feature') - Push to branch (
git push origin feature/amazing) - Open a Pull Request
If this saved you time, consider giving it a star. It helps others find it.
