惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
IT之家
IT之家
博客园_首页
博客园 - 【当耐特】
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
GbyAI
GbyAI
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
H
Help Net Security
T
Tailwind CSS Blog
B
Blog RSS Feed
Martin Fowler
Martin Fowler
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
博客园 - 叶小钗
雷峰网
雷峰网
量子位

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Building Production-Ready NestJS Apps: Introducing Nestie...
Brahim · 2026-04-25 · via DEV Community

Brahim

Building Production-Ready NestJS Apps: Introducing Nestier

Starting a new NestJS project? Tired of setting up the same architecture patterns, authentication, and infrastructure code over and over? I've been there too.

That's why I built Nestier — a production-ready NestJS boilerplate that demonstrates best practices in enterprise application development.

What is Nestier?

Nestier is a comprehensive NestJS boilerplate that implements Hexagonal Architecture (ports & adapters) and the Generic Repository Pattern. It's designed to help you build scalable, maintainable applications from day one.

Key Features

Hexagonal Architecture - Clean separation of concerns with domain, application, infrastructure, and presentation layers

🔐 JWT Authentication - Complete auth flow with password reset

📊 Generic Repository Pattern - Reusable CRUD operations via TypeORM

🔍 Advanced Search - Dynamic filtering with multiple comparators

📝 80%+ Test Coverage - 212 tests (127 unit + 85 E2E)

🐳 Docker Ready - Full stack with MongoDB and SonarQube

📚 Swagger/OpenAPI - Auto-generated API documentation

🛡️ Security First - Helmet, rate limiting, input validation

Architecture Overview

The project follows a strict hexagonal architecture with four distinct layers:

Domain Layer      → Business logic, entities, repository interfaces
Application Layer → Use cases, services, orchestration
Infrastructure    → TypeORM repositories, adapters, external services
Presentation      → Controllers, DTOs, validation

Enter fullscreen mode Exit fullscreen mode

This architecture ensures that your business logic remains independent of frameworks and external concerns, making your code more testable and maintainable.

Three Implementation Examples

Nestier includes three example modules that demonstrate different implementation approaches:

  1. Category Module - Simple CRUD using base components
  2. Product Module - Extended with custom use cases and repository methods
  3. User Module - Full custom implementation with JWT authentication

This gives you flexibility to choose the right pattern for each feature in your application.

Quick Start

Getting started is straightforward:

# Clone the repository
git clone https://github.com/BrahimAbdelli/nestier.git
cd nestier

# Install dependencies
npm install

# Set up environment
cp .env.example .env

# Start the app
npm run start:dev

Enter fullscreen mode Exit fullscreen mode

The API will be available at http://localhost:3000/api with Swagger docs at http://localhost:3000/docs.

Why Hexagonal Architecture?

Traditional layered architectures often lead to tight coupling between layers. Hexagonal architecture solves this by:

  • Isolating business logic from infrastructure concerns
  • Making testing easier through dependency inversion
  • Enabling flexibility to swap implementations (e.g., switch databases)
  • Improving maintainability with clear boundaries

Here's a simple example of how the repository pattern works:

// Domain layer - Repository interface (port)
interface BaseRepository<T> {
  findById(id: string): Promise<T | null>;
  findAll(): Promise<T[]>;
  create(entity: T): Promise<T>;
}

// Infrastructure layer - TypeORM implementation (adapter)
class TypeOrmBaseRepository<T> implements BaseRepository<T> {
  // TypeORM-specific implementation
}

Enter fullscreen mode Exit fullscreen mode

What's Included

  • ✅ JWT authentication with password reset flow
  • ✅ Advanced search with filtering and pagination
  • ✅ Soft delete functionality
  • ✅ AutoMapper for entity ↔ domain ↔ DTO mapping
  • ✅ Winston logger with structured logging
  • ✅ Mailjet integration for emails
  • ✅ Comprehensive error handling
  • ✅ Docker and Docker Compose setup
  • ✅ CI/CD with GitHub Actions
  • ✅ SonarQube integration for code quality

Perfect For

  • 🚀 Starting new NestJS projects
  • 📚 Learning hexagonal architecture patterns
  • 🏢 Building enterprise applications
  • 🎓 Teaching clean architecture principles
  • ⚡ Rapid prototyping with production-ready foundation

Get Started Today

Ready to build your next application with a solid foundation?

👉 Star the repository: github.com/BrahimAbdelli/nestier
👉 Article: brahimabdelli.dev/articles/2026/nestier/

Have questions or suggestions? Feel free to open an issue or start a discussion!


What patterns do you use in your NestJS projects? Share your thoughts in the comments below! 👇