https://github.com/josephgoksu/prime-nestjs
Production-ready NestJS boilerplate featuring JWT authentication, TypeORM, RBAC, Swagger, and Docker support. Built for enterprise-grade Node.js applications
https://github.com/josephgoksu/prime-nestjs
nest nestjs nestjs-backend nestjs-best-practices nestjs-boilerplate nestjs-library nestjs-module nestjs-postgres nestjs-starter-template typeorm typescript
Last synced: 9 days ago
JSON representation
Production-ready NestJS boilerplate featuring JWT authentication, TypeORM, RBAC, Swagger, and Docker support. Built for enterprise-grade Node.js applications
- Host: GitHub
- URL: https://github.com/josephgoksu/prime-nestjs
- Owner: josephgoksu
- License: mit
- Created: 2021-09-25T08:59:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-26T21:59:08.000Z (5 months ago)
- Last Synced: 2025-04-08T12:05:15.487Z (about 2 months ago)
- Topics: nest, nestjs, nestjs-backend, nestjs-best-practices, nestjs-boilerplate, nestjs-library, nestjs-module, nestjs-postgres, nestjs-starter-template, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 2.45 MB
- Stars: 392
- Watchers: 12
- Forks: 66
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Prime NestJS Boilerplate
![]()
## Status
[](https://opensource.org/licenses/MIT)
[](https://snyk.io/test/github/josephgoksu/prime-nestjs)

## Project Stats







## Repository Activity



## 📖 Description
Enterprise-grade NestJS starter kit with battle-tested architecture and security-first design. Built for teams who need a robust foundation for scalable Node.js applications with:
### Key Features
- 📱 **NestJS** — Latest version with TypeScript support
- 🔐 **Security**
- JWT Authentication with RSA256
- Role-Based Access Control (RBAC)
- Claims-Based Access Control (CBAC)
- Helmet for secure HTTP headers
- 🏪 **Database**
- PostgreSQL with TypeORM
- Migration support
- Database schema synchronization
- 🛠 **Development Tools**
- Docker Compose setup
- Environment configuration with Dotenv
- Swagger API documentation
- ESLint & Prettier configuration
- Conventional commit linting
- CodeQL security scanning
- Jest testing framework
- 📚 **Documentation**
- Swagger UI
- Insomnia API collection## 🏗 Project Structure
```
src/
├── auth/ # Authentication & authorization
├── config/ # Configuration modules
├── logger/ # Custom logging functionality
├── tasks/ # Task management module
├── users/ # User management module
├── app.module.ts # Main application module
└── main.ts # Application entry point
```## 🚀 Getting Started
### Prerequisites
- Node.js >= 20.0.0
- npm >= 10.0.0
- PostgreSQL
- Docker (optional)### Quick Setup (Production)
```bash
bash ./setup.sh
```### Development Setup
1. Install dependencies:
```bash
npm install
```2. Copy environment file:
```bash
cp .env.example .env
```3. Configure your environment variables in `.env`
### Running the Application
```bash
# Development mode
npm run start# Watch mode with hot-reload
npm run start:dev# Production mode
npm run start:prod
```### Database Management
```bash
# Sync database schema
npm run schema:sync# Generate migration
npm run add:migration [MigrationName]# Apply migrations
npm run apply:migration# Revert last migration
npm run revert:migration
```### Docker Support
```bash
# Build containers
npm run docker:build# Start services
npm run docker:up# Stop services
npm run docker:down
```### Testing
```bash
# Unit tests
npm run test# E2E tests
npm run test:e2e# Test coverage
npm run test:cov
```## 🔒 Security Setup
### SSL Certificate Generation
#### 1. Generate RSA Private Key
```bash
openssl genrsa -out private_key.pem 2048# Format key for environment variable
awk 'NF {sub(/\r/, ""); printf"%s\\n",$0;}' private_key.pem
```#### 2. Extract Public Key
```bash
openssl rsa -in private_key.pem -outform PEM -pubout -out public_key.pem# Format key for environment variable
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' public_key.pem
```## 📝 API Documentation
### Swagger UI
Access the Swagger documentation at `/api` when running the application.
### Insomnia Collection
1. Install Insomnia
2. Import the `endpoints.json` file
3. Start exploring the APIs## 🤝 Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request## 📝 License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
## Contributors
## Star History
[](https://star-history.com/#josephgoksu/prime-nestjs&Timeline)