Skip to content

Experimental full-stack application showcasing Domain-Driven Design, Microservices, Event Sourcing, CQRS and Angular.

License

Notifications You must be signed in to change notification settings

falberthen/EcommerceDDD

Repository files navigation

πŸ›’ EcommerceDDD

An experimental full-stack application showcasing cutting-edge technologies and architectural patterns for building scalable e-commerce systems.

⭐ If you find this project useful, please consider giving it a star! It helps others discover the project. GitHub Stars

.NET Angular License

Build Docker


Demo 1

Demo 2

Demo 3


πŸ—οΈ Architecture

High-Level Overview

High-Level Architecture

Detailed Architecture

Detailed Architecture


πŸ“ Project Structure

β”œβ”€β”€ Core                    # Building blocks and abstractions
β”œβ”€β”€ Core.Infrastructure     # Shared infrastructure implementations
β”‚
β”œβ”€β”€ Crosscutting
β”‚   β”œβ”€β”€ ServiceClients      # Kiota-generated HTTP clients
β”‚   β”œβ”€β”€ ApiGateway          # Ocelot API Gateway
β”‚   β”œβ”€β”€ SignalR             # Real-time communication
β”‚   └── IdentityServer      # Authentication & authorization
β”‚
β”œβ”€β”€ Services
β”‚   β”œβ”€β”€ CustomerManagement
β”‚   β”œβ”€β”€ InventoryManagement
β”‚   β”œβ”€β”€ OrderProcessing
β”‚   β”œβ”€β”€ PaymentProcessing
β”‚   β”œβ”€β”€ ProductCatalog
β”‚   β”œβ”€β”€ QuoteManagement
β”‚   └── ShipmentProcessing
β”‚
β”œβ”€β”€ SPA                     # Angular frontend
└── docker-compose          # Container orchestration
Layer
Core Defines building blocks and abstractions used across all projects. Highly abstract with no implementations.
Core.Infrastructure Shared infrastructure abstractions and implementations for all microservices.
Crosscutting Projects that cross-cut all microservices: IdentityServer, API Gateway, and ServiceClients with Kiota-generated HTTP clients.
Services Backend microservices built with a vertically sliced structure.
SPA Lightweight Angular-based Single Page Application.

Microservice Structure

Each microservice follows a clean vertical slice architecture.

β”œβ”€β”€ EcommerceDDD.ProductCatalog
β”‚   β”œβ”€β”€ API              # RESTful endpoints
β”‚   β”œβ”€β”€ Application      # Use cases, commands & queries
β”‚   β”œβ”€β”€ Domain           # Aggregates, entities, domain events
β”‚   └── Infrastructure   # Data persistence & external integrations

πŸ”— Service Communication

External Communication (SPA β†’ Backend)

  • Koalesce.OpenAPI aggregates all OpenAPI definitions exposed in the API Gateway.
  • Kiota generates typed TypeScript clients from this unified spec.
  • The Angular SPA communicates through the API Gateway using the clients.

Internal Communication (Service-to-Service)

Microservices communicate directly using Kiota-generated typed HTTP clients.


πŸ› οΈ Tech Stack

Backend

Technology Version
.NET 10
C# 12
Koalesce 1.0.0-beta.5
Ocelot 24.1.0
Marten 8.19.0
Confluent Kafka 2.13.0
Entity Framework Core 10.0.2
Npgsql (PostgreSQL) 10.0.0
Duende IdentityServer 7.4.5
Polly 8.6.5
Microsoft Kiota 1.21.2
xUnit 2.9.3
NSubstitute 5.3.0

Frontend

Technology Version
Angular 19.2.7
TypeScript 5.5.4
Jest 29.7.0
NgBootstrap 18.0.0
Bootstrap 5.3.5
Font Awesome 6.7.2
Toastr 19.0.0

πŸ”Œ Getting Started

Running with Docker

Backend only β€” starts all microservices, databases, Kafka, and infrastructure:

docker compose up

Backend + Frontend β€” also builds and serves the Angular SPA at http://localhost:4200:

docker compose --profile frontend up

πŸ’‘ Tip: You can also set docker-compose.dcproj as the startup project in Visual Studio for debugging.


Running the SPA locally (with hot-reload)

If you prefer running the frontend outside Docker for development, start the backend with docker compose up, then:

cd src/EcommerceDDD.Spa
npm install
ng serve

The app will be available at http://localhost:4200.


Advanced: Regenerating Kiota Clients

If you want to regenerate all typed HTTP clients, after containers are running:

docker-compose --profile tools run regenerate-clients

This generates:

  • Backend clients (C#): ServiceClients/Kiota/
  • Single Frontend client (TypeScript): EcommerceDDD.Spa/src/app/clients/

πŸ“„ License

This project is licensed under the terms of the LICENSE file.


Made with ❀️ by Felipe Henrique

About

Experimental full-stack application showcasing Domain-Driven Design, Microservices, Event Sourcing, CQRS and Angular.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •