<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Brahim</title>
    <description>The latest articles on DEV Community by Brahim (@abd3lli).</description>
    <link>https://dev.to/abd3lli</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1147403%2Fd99b7037-e23a-4d00-b366-856255ce24dc.jpg</url>
      <title>DEV Community: Brahim</title>
      <link>https://dev.to/abd3lli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abd3lli"/>
    <language>en</language>
    <item>
      <title>Building Production-Ready NestJS Apps: Introducing Nestier - A Hexagonal Architecture Boilerplate</title>
      <dc:creator>Brahim</dc:creator>
      <pubDate>Sat, 25 Apr 2026 09:40:52 +0000</pubDate>
      <link>https://dev.to/abd3lli/building-production-ready-nestjs-apps-introducing-nestier-a-hexagonal-architecture-boilerplate-e53</link>
      <guid>https://dev.to/abd3lli/building-production-ready-nestjs-apps-introducing-nestier-a-hexagonal-architecture-boilerplate-e53</guid>
      <description>&lt;h2&gt;
  
  
  Building Production-Ready NestJS Apps: Introducing Nestier
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;That's why I built &lt;strong&gt;Nestier&lt;/strong&gt; — a production-ready NestJS boilerplate that demonstrates best practices in enterprise application development.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Nestier?
&lt;/h2&gt;

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

&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;p&gt;✨ &lt;strong&gt;Hexagonal Architecture&lt;/strong&gt; - Clean separation of concerns with domain, application, infrastructure, and presentation layers&lt;br&gt;&lt;br&gt;
🔐 &lt;strong&gt;JWT Authentication&lt;/strong&gt; - Complete auth flow with password reset&lt;br&gt;&lt;br&gt;
📊 &lt;strong&gt;Generic Repository Pattern&lt;/strong&gt; - Reusable CRUD operations via TypeORM&lt;br&gt;&lt;br&gt;
🔍 &lt;strong&gt;Advanced Search&lt;/strong&gt; - Dynamic filtering with multiple comparators&lt;br&gt;&lt;br&gt;
📝 &lt;strong&gt;80%+ Test Coverage&lt;/strong&gt; - 212 tests (127 unit + 85 E2E)&lt;br&gt;&lt;br&gt;
🐳 &lt;strong&gt;Docker Ready&lt;/strong&gt; - Full stack with MongoDB and SonarQube&lt;br&gt;&lt;br&gt;
📚 &lt;strong&gt;Swagger/OpenAPI&lt;/strong&gt; - Auto-generated API documentation&lt;br&gt;&lt;br&gt;
🛡️ &lt;strong&gt;Security First&lt;/strong&gt; - Helmet, rate limiting, input validation  &lt;/p&gt;
&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&gt;

&lt;p&gt;The project follows a strict &lt;strong&gt;hexagonal architecture&lt;/strong&gt; with four distinct layers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Domain Layer      → Business logic, entities, repository interfaces
Application Layer → Use cases, services, orchestration
Infrastructure    → TypeORM repositories, adapters, external services
Presentation      → Controllers, DTOs, validation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This architecture ensures that your business logic remains independent of frameworks and external concerns, making your code more testable and maintainable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three Implementation Examples
&lt;/h2&gt;

&lt;p&gt;Nestier includes three example modules that demonstrate different implementation approaches:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Category Module&lt;/strong&gt; - Simple CRUD using base components&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Product Module&lt;/strong&gt; - Extended with custom use cases and repository methods&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Module&lt;/strong&gt; - Full custom implementation with JWT authentication&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This gives you flexibility to choose the right pattern for each feature in your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;

&lt;p&gt;Getting started is straightforward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone the repository&lt;/span&gt;
git clone https://github.com/BrahimAbdelli/nestier.git
&lt;span class="nb"&gt;cd &lt;/span&gt;nestier

&lt;span class="c"&gt;# Install dependencies&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt;

&lt;span class="c"&gt;# Set up environment&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env

&lt;span class="c"&gt;# Start the app&lt;/span&gt;
npm run start:dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The API will be available at &lt;code&gt;http://localhost:3000/api&lt;/code&gt; with Swagger docs at &lt;code&gt;http://localhost:3000/docs&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Hexagonal Architecture?
&lt;/h2&gt;

&lt;p&gt;Traditional layered architectures often lead to tight coupling between layers. Hexagonal architecture solves this by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Isolating business logic&lt;/strong&gt; from infrastructure concerns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Making testing easier&lt;/strong&gt; through dependency inversion&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enabling flexibility&lt;/strong&gt; to swap implementations (e.g., switch databases)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improving maintainability&lt;/strong&gt; with clear boundaries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a simple example of how the repository pattern works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Domain layer - Repository interface (port)&lt;/span&gt;
&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;BaseRepository&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;findById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;findAll&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;entity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Infrastructure layer - TypeORM implementation (adapter)&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TypeOrmBaseRepository&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;BaseRepository&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// TypeORM-specific implementation&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What's Included
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  Perfect For
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 Starting new NestJS projects&lt;/li&gt;
&lt;li&gt;📚 Learning hexagonal architecture patterns&lt;/li&gt;
&lt;li&gt;🏢 Building enterprise applications&lt;/li&gt;
&lt;li&gt;🎓 Teaching clean architecture principles&lt;/li&gt;
&lt;li&gt;⚡ Rapid prototyping with production-ready foundation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Get Started Today
&lt;/h2&gt;

&lt;p&gt;Ready to build your next application with a solid foundation?&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Star the repository&lt;/strong&gt;: &lt;a href="https://github.com/BrahimAbdelli/nestier" rel="noopener noreferrer"&gt;github.com/BrahimAbdelli/nestier&lt;/a&gt;&lt;br&gt;
👉 &lt;strong&gt;Article&lt;/strong&gt;: &lt;a href="https://www.brahimabdelli.dev/articles/2026/nestier/" rel="noopener noreferrer"&gt;brahimabdelli.dev/articles/2026/nestier/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have questions or suggestions? Feel free to open an issue or start a discussion!&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What patterns do you use in your NestJS projects? Share your thoughts in the comments below!&lt;/strong&gt; 👇&lt;/p&gt;

</description>
      <category>nestjs</category>
      <category>typescript</category>
      <category>node</category>
      <category>cleancode</category>
    </item>
    <item>
      <title>NestJS Boilerplate using Typescript Generics.</title>
      <dc:creator>Brahim</dc:creator>
      <pubDate>Sun, 27 Aug 2023 11:48:03 +0000</pubDate>
      <link>https://dev.to/abd3lli/nestjs-boilerplate-using-typescript-generics-47bn</link>
      <guid>https://dev.to/abd3lli/nestjs-boilerplate-using-typescript-generics-47bn</guid>
      <description>&lt;p&gt;Just finished coding a &lt;a href="https://github.com/BrahimAbdelli/nestjs-boilerplate" rel="noopener noreferrer"&gt;NestJS&lt;/a&gt; boilerplate project (and an explicative &lt;a href="https://www.brahimabdelli.com/nestjs-boilerplate" rel="noopener noreferrer"&gt;Article &lt;/a&gt;about it) using :&lt;/p&gt;

&lt;p&gt;✔ MongoDB.&lt;/p&gt;

&lt;p&gt;✔ TypeORM.&lt;/p&gt;

&lt;p&gt;That provides :&lt;/p&gt;

&lt;p&gt;✔ Abstract Base Module (Controller, Service, Entity and DTOS) that you can use for your modules.&lt;/p&gt;

&lt;p&gt;✔ Two modules (category, product) mock and e2e tested.&lt;/p&gt;

&lt;p&gt;✔ Ready to use APIs (CRUD, pagination, a powerful search API etc ..).&lt;/p&gt;

&lt;p&gt;✔ A users module including a middleware.&lt;/p&gt;

&lt;p&gt;✔ A mailer service using (MailJet) integrated with a handlebar .hbs template.&lt;/p&gt;

&lt;p&gt;✔ A Postman Collection for every API.&lt;/p&gt;

&lt;p&gt;✔ Pipes such as : Abstract validation pipe for objects, ObjectID validation pipe.&lt;/p&gt;

&lt;p&gt;✔ Utils for finding by field, checking field uniqueness, custom error throwing etc..&lt;/p&gt;

&lt;p&gt;✔ A logger middleware.&lt;/p&gt;

&lt;p&gt;✔ Dev and prod environments.&lt;/p&gt;

&lt;p&gt;✔ Dockerized app.&lt;/p&gt;

&lt;p&gt;I wrote an article explaining step by step how this boilerplate was built and how you can use it efficiently.&lt;/p&gt;

&lt;p&gt;You can access the Github repository to get the full project below and use it to your liking.&lt;/p&gt;

&lt;p&gt;I'm open for your suggestions so feel free to give me your opinions 😀.&lt;/p&gt;

</description>
      <category>nestjs</category>
      <category>typescript</category>
      <category>mongodb</category>
      <category>node</category>
    </item>
  </channel>
</rss>
