https://github.com/hhsadiq/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.
https://github.com/hhsadiq/NestForge
Last synced: about 1 month ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/hhsadiq/NestForge
- Owner: hhsadiq
- License: mit
- Created: 2025-09-02T06:52:05.000Z (3 months ago)
- Default Branch: develop
- Last Pushed: 2025-10-15T10:02:32.000Z (about 1 month ago)
- Last Synced: 2025-10-15T20:57:01.753Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 16.5 MB
- Stars: 7
- Watchers: 0
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-nestjs - NestForge - AI-powered NestJS boilerplate and starter with hexagonal architecture, automated CRUD generation, JWT & biometric auth, file management, i18n, mailing system, and comprehensive testing suite. (π Boilerplates & Starters)
README
# π NestForge

**A Complete AI-Powered NestJS Boilerplate with Hexagonal Architecture**
[](https://www.typescriptlang.org/)
[](https://nestjs.com/)
[](https://www.postgresql.org/)
[](https://www.docker.com/)
[](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
https://github.com/user-attachments/assets/8db02e0b-f3a0-475d-a535-01ed7068cbe0
---
## π₯ How to Use NestForge
**π§ 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
---
## π― 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.
### π **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**
1. **Create Migration File** - Define your database schema using TypeORM migrations
- π€ **[NestForge Schema Architect](https://chatgpt.com/g/g-68c7c2d593348191beb9ffa8db839f2f-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](https://chatgpt.com/g/g-68c93a7fdb0c819184b9eb4cb038b866-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**: ``
- 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](docs/installing-and-running.md)** - 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](docs/setup-script.md)** - 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](docs/architecture.md)** - 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](docs/hygen/index.md)** - All generators, JSON schemas, and usage examples
π **[SQL to JSON Conversion](docs/hygen/sql-to-json-entities-prompt.md)** - 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](docs/tests.md)** - Unit, E2E, and Docker testing
π **[Load Testing Guide](docs/artillery.md)** - 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](docs/readme.md)** - 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](CODE_OF_CONDUCT.md) 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](LICENSE) file for details.
---
## π Acknowledgments
- **[NestJS Team](https://nestjs.com/)** for the amazing framework
- **[TypeORM](https://typeorm.io/)** for excellent database integration
- **[Hygen](https://github.com/jondot/hygen)** for powerful code generation
- **[Cursor AI](https://cursor.com)** for AI-powered development assistance
- **[Cursor Commands](https://github.com/hamzafer/cursor-commands)** for cursor commands
- **Community Contributors** for feedback and improvements
---
**β Star this repository if you find it helpful!**
[](https://github.com/hhsadiq/NestForge)
[](https://github.com/hhsadiq/NestForge)
**Built with β€οΈ by the NestForge Team**