Production-ready NestJS starter kit with enterprise-grade features for building scalable applications.
- π JWT Authentication (RSA256) with Role-Based Access Control
- ποΈ PostgreSQL + TypeORM with migration support
- π Swagger API Documentation auto-generated at
/api
- π³ Docker ready with compose configuration
- π§ͺ Testing setup with Jest (unit & e2e)
- π§ Developer Experience with ESLint, Prettier, Husky
- π‘οΈ Security with Helmet, CORS, rate limiting
- π Monitoring ready with built-in health checks
- Node.js >= 20.0.0
- PostgreSQL (or use Docker)
# Clone repository
git clone https://github.com/josephgoksu/prime-nestjs.git
cd prime-nestjs
# Install dependencies
npm install
# Setup environment
cp .env.example .env
# Start with Docker (recommended)
npm run docker:up
# OR start locally
npm run start:dev
The API will be available at http://localhost:3000
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 Prettier
npm 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 migration
npm run docker:build # Build containers
npm run docker:up # Start all services
npm run docker:down # Stop all services
src/
βββ 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
- Swagger UI:
http://localhost:3000/api
- Import to Insomnia: Use
endpoints.json
- 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
MIT Β© Joseph Goksu