NestForge
NestForge is a modern NestJS boilerplate that jump-starts your backend development. It comes with AI-powered CRUD generators, auth (JWT & sessions), file uploads, and other common modules built-in, so you can focus on your business logic instead of reinventing the wheel.
Install / Use
/learn @hhsadiq/NestForgeREADME
🚀 NestForge
<div align="center">A Complete AI-Powered NestJS Boilerplate with Hexagonal Architecture
Built with enterprise-grade architecture patterns and automated code generation
</div>🎬 Platform Overview
<div align="center">🚀 NestForge - Complete Platform Walkthrough
Experience the full power of NestForge from setup to code generation to AI-assisted development
https://github.com/user-attachments/assets/8db02e0b-f3a0-475d-a535-01ed7068cbe0
</div>🎥 How to Use NestForge
<div align="center">🧭 Practical Demo – From Setup to Final Result
Watch a demonstration on how to use NestForge to quickly generate outcomes.
https://github.com/user-attachments/assets/5cc4b4a7-a962-4e8b-b364-9a95b185ea3f
</div>🎯 What is NestForge?
NestForge is more than a boilerplate — it's a complete AI-powered development platform that takes you from database schema to production-ready API in minutes.
🚀 Why It Stands Out
Unlike traditional boilerplates, NestForge doesn’t just give you a starting point — it uses AI-assistance generators to create production-ready CRUD modules for your custom projects and then guides you in extending them with business logic while keeping your code fully aligned with architectural standards.
⚡ Core Capabilities
- ⚡ Zero-Config Setup – Spin up a full API instantly
- 🏗️ Hexagonal Architecture – Clean, maintainable, testable
- 📦 Enterprise Features – JWT, Biometric login, Social Auth, File Management, Mailing System, i18n, GitHub Actions
- 🎯 Hygen Code Generation – Create modules from JSON/SQL in seconds
- 🤖 AI that codes with you – automates setup, validates code, and helps you add business logic that stays perfectly aligned with your architecture.
- 🧪 Full Testing Suite – Unit, E2E, and Load tests ready-to-run
AI + automation handle the busywork, letting you focus on real business logic.
✨ Key Features
🏛️ Hexagonal Architecture
Clean separation of business logic from infrastructure concerns with consistent module structure and absolute path imports for cleaner project organization.
🗄️ Database & ORM
TypeORM with PostgreSQL integration, comprehensive seeding system, read replica support for improved performance, and example database views for better query abstraction and reporting.
⚡ Caching & Performance
Redis-powered caching system with cluster support, automatic TLS configuration, and comprehensive cache management for improved application performance and scalability.
🤖 Automated Code Generation (Hygen)
Generate entire modules from JSON schemas or SQL with batch and interactive generators. Includes template automation, resource generation, versioning, property management, and raw query handling.
🤖 AI-Powered Development with Cursor
Comprehensive .cursorrules configuration that trains Cursor AI to understand hexagonal architecture patterns, Hygen generator commands, JSON schema validation, and architecture enforcement for domain-aware development assistance.
🚀 One-Command Setup
Complete project initialization from clone to running server with automated configuration and environment setup.
🔐 Authentication & Security
- JWT authentication, social login (Apple, Google, Facebook, Twitter),
BiometricFeature with challenge-based authentication and server-side validation using cryptographic signing.
📁 File Management
Multi-driver support (Local, S3, S3-Presigned URLs) with automatic optimization and secure upload validation.
🌐 Internationalization
Multi-language support with dynamic translations and localized error messages using nestjs-i18n.
📧 Mailing System
Comprehensive email system with nodemailer integration for transactional emails and notifications.
📚 API Documentation
Swagger API documentation with automatic generation and comprehensive endpoint coverage.
🧪 Comprehensive Testing
Unit tests (Jest), E2E tests (Dockerized), and load testing (Artillery) with automated seeding and performance benchmarking.
🐳 DevOps & Docker
Docker support, containerization, and development environment management with comprehensive Docker Compose configurations.
⏰ Scheduled Tasks
Robust scheduler module with flag-based control for managing cron jobs across different environments. Perfect for background tasks, cleanup operations, and periodic maintenance.
🔄 Idempotency
Request deduplication system with flag-based control to prevent duplicate processing. Ensures safe handling of retries and duplicate requests using UUID-based idempotency keys.
🚀 Production & CI/CD
CI/CD workflows with GitHub Actions, database management, and Sentry monitoring integration for production deployments.
🛠️ Build Custom Projects
NestForge isn't just a boilerplate—it's a complete development platform that empowers you to build custom features with minimal effort. Here's how our features work together to accelerate your development:
🎯 The Custom Development Workflow
Step 1: Database Design → Step 2: Code Generation → Step 3: AI-Assisted Development
- Create Migration File - Define your database schema using TypeORM migrations
- 🤖 NestForge Schema Architect - This custom GPTs will help you generate complete database schemas from your requirements in 3 simple steps (Requirements → Overview → SQL)
- Generate JSON Schema - Convert your SQL schema to Hygen-compatible JSON using our AI-powered prompts
- 🤖 NestForge SQL to JSON - This custom GPTs will help you generate NestForge-compatible JSON files from your PostgreSQL SQL schemas for seamless code generation
- Run Hygen Commands - Generate complete modules with tests, DTOs, services, controllers, and repositories
- AI-Enhanced Development - Use Cursor AI with our comprehensive
.cursorrulestraining material
🤖 AI-Powered Development with Cursor
NestForge includes extensive .cursorrules configuration that trains Cursor AI to understand:
- Hexagonal Architecture Patterns - AI knows the exact module structure and boundaries
- Hygen Generator Commands - AI can run the correct generators automatically
- JSON Schema Validation - AI validates and generates proper entity schemas
- Architecture Enforcement - AI ensures services don't import persistence entities
- Type Safety - AI enforces strict TypeScript patterns throughout
Result: Cursor becomes your domain-aware development assistant, not just a generic code generator.
🚀 What You Get
- Complete Modules - Full CRUD operations with validation, error handling, and tests
- Consistent Architecture - Every generated module follows hexagonal patterns
- Type Safety - Full TypeScript support with explicit types (no
any) - Testing Suite - Unit tests, E2E tests, and load tests automatically generated
- Documentation - Swagger endpoints and comprehensive API documentation
- Production Ready - Docker support, CI/CD workflows, and monitoring integration
💡 Example: Building a Product Catalog
- Migration: Create
productandcategorytables - JSON Schema: Generate entity definitions with relationships
- Single Script: Run
npm run setup. - Result: Complete product management system with:
- Product & Category entities with relationships
- Full CRUD APIs with validation
- Unit tests
- Swagger documentation
- Type-safe DTOs and services.
- Swagger Documentation:
<http://localhost:3000/docs> - Credentials for user:
- Email:
admin@example.com - Password:
secret
- Email:
Time to Production: From database design to working API in minutes, not hours.
🚀 Quick Start
Get NestForge running in minutes with our automated setup script. Clone the repository and run npm run setup for complete initialization from database setup to running server.
📖 Installation Guide - Manual setup and troubleshooting
⚙️ Automated Setup
NestForge includes a powerful automated setup script that handles everything from environment configuration to database initialization and server startup. Perfect for quick project initialization and consistent development environments.
📖 Setup Script Guide - Complete automated setup documentation
🏗️ Architecture Overview
NestForge implements Hexagonal Architecture (Ports & Adapters) with clean separation between business logic and infrastructure concerns. Each module follows a consistent structure ensuring maintainability and testability.
📖 Complete Architecture Guide - Deep dive into hexagonal patterns, module structure, and architectural principles
🤖 Code Generation
NestForge provides powerful code generation capabilities through Hygen generators. Create entire modules from JSON schemas, SQL statements, or interactive prompts with support for
