An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# πŸš€ NestForge

![NestForge Logo](https://img.shields.io/badge/NestForge-v1.2.0-blue?style=for-the-badge&logo=nestjs)

**A Complete AI-Powered NestJS Boilerplate with Hexagonal Architecture**

[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![NestJS](https://img.shields.io/badge/NestJS-E0234E?style=flat-square&logo=nestjs&logoColor=white)](https://nestjs.com/)
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?style=flat-square&logo=postgresql&logoColor=white)](https://www.postgresql.org/)
[![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat-square&logo=docker&logoColor=white)](https://www.docker.com/)
[![License](https://img.shields.io/badge/License-MIT-green?style=flat-square)](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!**

[![GitHub stars](https://img.shields.io/github/stars/hhsadiq/NestForge?style=social)](https://github.com/hhsadiq/NestForge)
[![GitHub forks](https://img.shields.io/github/forks/hhsadiq/NestForge?style=social)](https://github.com/hhsadiq/NestForge)

**Built with ❀️ by the NestForge Team**