Skip to main content

Build REST APIs with
Hybrid DDD Architecture

A production-ready .NET 8 template featuring Domain-Driven Design principles, CQRS pattern, and event-driven architecture for scalable REST APIs.

Quick Start

Get your hybrid DDD architecture API up and running in minutes.

1

Clone the repository

Start by cloning the template repository to your local machine.
git clone https://github.com/FedeJG82/HybridArchitecture.NET.git
cd HybridArchitecture.NET/HybridDDDArchitecture
2

Configure your database

Set up your connection string in appsettings.json for SQL Server or MongoDB.
{
  "ConnectionStrings": {
    "SqlConnection": "Server=localhost;Database=HybridDDD;User Id=sa;Password=YourPassword;"
  }
}
3

Run the application

Build and run the Template-API project to start your REST API.
dotnet run --project Template-API/Template-API.csproj
The API will be available at https://localhost:5001 with Swagger UI for exploring endpoints.
4

Create your first entity

Follow the creating entities guide to define your domain model and implement use cases.

Core Features

Everything you need to build enterprise-grade REST APIs with clean architecture.

CQRS Pattern

Command and Query separation with a built-in bus for handling operations.

Event-Driven

RabbitMQ integration for asynchronous event handling and microservices communication.

Multiple Repositories

Support for SQL Server and MongoDB with a unified repository pattern.

HTTP Adapters

Abstractions for external service communication with built-in resilience.

Architecture Overview

Learn about the hybrid DDD architecture and core design principles.

Domain Layer

Entities, value objects, and business rules at the core of your application.

Application Layer

Use cases, DTOs, and application services orchestrating domain logic.

Infrastructure Layer

Repository implementations, external adapters, and technical concerns.

Developer Resources

Comprehensive guides and API reference to help you build faster.

Implementation Guides

Step-by-step tutorials for implementing entities, use cases, and controllers.

API Reference

Detailed documentation of all interfaces, base classes, and extension points.

Database Setup

Configure Entity Framework migrations and multiple database providers.

Docker Deployment

Containerize and deploy your API with Docker and Docker Compose.

Ready to build your API?

Start with the quickstart guide to create your first REST API with hybrid DDD architecture in minutes.

Start Building