Skip to content

hhsadiq/NestForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

515 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 NestForge

NestForge Logo

A Complete AI-Powered NestJS Boilerplate with Hexagonal Architecture

TypeScript NestJS PostgreSQL Docker License

Built with enterprise-grade architecture patterns and automated code generation


🎬 Platform Overview

🚀 NestForge - Complete Platform Walkthrough

Experience the full power of NestForge from setup to code generation to AI-assisted development

NestForge-Walkthrough.mp4

🎥 How to Use NestForge

🧭 Practical Demo – From Setup to Final Result

Watch a demonstration on how to use NestForge to quickly generate outcomes.

NestForgeDemo.1.mp4

🎯 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),
  • Biometric Feature 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 DesignStep 2: Code GenerationStep 3: AI-Assisted Development

  1. 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)
  2. 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
  3. Run Hygen Commands - Generate complete modules with tests, DTOs, services, controllers, and repositories
  4. AI-Enhanced Development - Use Cursor AI with our comprehensive .cursorrules training 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

  1. Migration: Create product and category tables
  2. JSON Schema: Generate entity definitions with relationships
  3. Single Script: Run npm run setup.
  4. 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

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 entities, relationships, and enums.

📚 Documentation & Guides

📖 Complete Hygen Documentation - All generators, JSON schemas, and usage examples 📖 SQL to JSON Conversion - Convert SQL schemas to NestJS modules

🧪 Testing

Comprehensive testing suite with unit tests (Jest), E2E tests (Dockerized), and load testing (Artillery). All tests include automated seeding and detailed reporting for complete application validation.

📖 Complete Testing Guide - Unit, E2E, and Docker testing 📖 Load Testing Guide - Performance benchmarking with Artillery

📚 Documentation

Complete documentation covering architecture, development workflows, and production deployment. Each feature has dedicated guides with examples and best practices.

📖 Full Documentation Index - Comprehensive guide with table of contents

🌟 What Makes NestForge Special?

🎯 Developer Experience

  • Zero Decision Fatigue: Pre-configured architecture and patterns
  • AI-Assisted Development: Smart code generation and Cursor AI integration
  • Comprehensive Documentation: Every feature thoroughly documented
  • Hot Reload: Instant feedback during development

🏢 Enterprise Ready

  • Scalable Architecture: Hexagonal patterns for large applications
  • Security First: Industry-standard authentication and authorization
  • Production Monitoring: Sentry integration and error tracking
  • CI/CD Pipeline: Automated testing and deployment

🔄 Maintainable Codebase

  • Consistent Structure: Enforced patterns across all modules
  • Type Safety: Full TypeScript support with strict typing
  • Clean Code: ESLint, Prettier, and architectural guidelines
  • Version Management: Automated dependency updates

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments

  • NestJS Team for the amazing framework
  • TypeORM for excellent database integration
  • Hygen for powerful code generation
  • Cursor AI for AI-powered development assistance
  • Cursor Commands for cursor commands
  • Community Contributors for feedback and improvements

⭐ Star this repository if you find it helpful!

GitHub stars GitHub forks

Built with ❤️ by the NestForge Team

About

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.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors