.NET 9 Microservices, Modular Monolith: DDD & Vertical Slice

Build an MVP in .NET 9 with C# microservices, DDD, CQRS, Clean Architecture & Vertical Slice, gRPC, messaging & Docker

  • 0.0 (0 Reviews)
  • 0 Students
  • 175 Lessons
  • Laurentiu Dumitrescu

Course Overview

In this course we build real C# microservices and a modular monolith in a .NET 9 solution from scratch: a full MVP for managing scientific articles. You’ll learn how to apply Domain-Driven Design (DDD) and Vertical Slice Architecture to real business workflows — not toy examples.

You'll see how to turn business requirements into bounded contexts, aggregates, value objects and domain events, then implement them end-to-end with C#, ASP.NET Core, EF Core, gRPC, messaging and Docker. Each feature is built as a vertical slice: from the API contract and validation, through command handlers and domain logic, down to persistence and tests.

We implement both synchronous and asynchronous communication between services. You'll learn to differentiate between Core/Critical services (using direct gRPC for reliability) and Domain services (using event-driven architecture with messaging). This gives you practical experience with CQRS and event-driven patterns in a real distributed system.

Along the way we focus on practical architecture decisions: when to use microservices vs a modular monolith, how to design rich domains instead of "anemic" models, how to apply CQRS with MediatR, and how to keep code clean, simple and testable while services communicate over gRPC and messaging.

By the end of this course you will be able to:

  • Design and implement .NET 9 microservices and a modular monolith with DDD and Clean Architecture

  • Apply Vertical Slice, CQRS and event-driven architecture in a real project

  • Model solid aggregates, value objects and domain events

  • Implement sync (gRPC) and async (messaging) communication between services

  • Structure solutions for long-term maintainability and clear boundaries

  • Make pragmatic architecture trade-offs, instead of just following theory

Who is this course for?

Intermediate to senior C# / .NET developers who have already built at least one Web API and want to learn how to design real systems with DDD and microservices/modular monolith.
Ambitious junior developers who are comfortable with C#, ASP.NET Core Web APIs and SQL, and want to move to the next level into architecture and system design.

Software architects who want a concrete end-to-end .NET 9 example of modern architecture patterns.

You should be comfortable with C# fundamentals, have some experience with ASP.NET Core Web APIs, and know basic SQL (tables, relationships, CRUD). It is recommended that this is not your very first C# project, nevertheless I will guide you step by step from an empty solution to a working, production-style architecture.

See more

FAQ

FAQ area empty

Course curriculum

10 chương 175 bài học 25 giờ 44 phút 7 bài học thử miễn phí
Chương 1 Course Overview & Getting Started
Chương 2 Technical Concepts & Architecture Fundamentals
Chương 3 Submission Microservice with MediatR, FluentValidation & EF.Core
  • Overview – Article Workflow & Tech Highlights 1:51
  • Clean Architecture – Layers & Project Setup Plan 3:33
  • Hands-on Kickoff – What We’ll Build & How 1:59
  • Create Solution & Projects – API, Application, Domain, Persistence 6:40
  • CreateArticle – Implement Endpoint with Minimal API & MediatR 19:20
  • CreateArticle – Implement the Domain with DDD Principles 12:43
  • Toolbox – Choosing the Right NuGet Version 4:20
  • CreateArticle – Configure Domain Entities with EF Core 16:14
  • CreateArticle – Implement Generic & Domain Repositories 8:06
  • CreateArticle – Implement Command Handler with MediatR & FluentValidation 3:41
  • Defining User Stories – From Business Scenarios to Requirements 3:59
  • Designing Endpoints – Mapping User Stories to REST Operations 4:02
  • Functional Requirements – Core Features & Rules 6:37
  • Non-Functional Requirements – Scalability, Security & Reliability 3:27
  • High-Level Architecture – Tech Stack, Layers & Dependencies 5:49
  • Tactical DDD – Aggregates, Entities, Value Objects & Domain Events 6:18
  • Application Startup – Configure Services & Modules with Dependency Injection 14:11
  • CreateArticle – Implement NotFound with Repositories & HTTP Status Code 6:16
  • CreateArticle – Implement Domain to Assign Current User as Author 12:15
  • CreateArticle – Configure Persistence to Assign Current User as Author 14:11
  • CreateArticle – Implement Handler to Assign Current User as Author 10:06
  • AssignAuthor – Implement Full Feature with Domain, Handler & Endpoint 20:24
  • CreateAndAssignAuthor – Implement Full Feature with Domain, Handler & Endpoint 9:08
  • UploadManuscript – Implement Endpoint with Minimal API & FromForm Binding 11:51
  • UploadManuscript – Implement Domain with Asset Aggregate and File Value Object 20:46
  • UploadManuscript – Configure Asset and File with EF Core & ComplexProperty 11:22
  • UploadManuscript – Implement Command Handler with MediatR and Repositories 9:33
  • UploadManuscript – Implement In-Memory Cache Repository for AssetType 13:37
  • UploadManuscript – Implement FileStorage Module (Monolith) with Mongo GridFS 29:22
  • UploadManuscript – Integrate FileStorage Module in Command Handle 11:17
  • Module Wrap-Up - All Endpoints & Testing 0:44
Chương 4 Auth Microservice with FastEndpoints, JWT Auth, and Role-Based Access Control
  • Overview – Auth Flow, User Stories & Endpoint Design 6:48
  • Requirements – Features, Performance & Security 2:54
  • High Level Architecture – Tech Stack, Layers & Design Choices 6:08
  • Integration – Auth Flow with JWT Tokens for SSO Across Services 2:25
  • Tactical DDD – Aggregates, Entities, Value Objects & Domain Events 3:44
  • Architecture Summary - Key Patterns, Tools & Design Decisions 1:49
  • CreateUser – Overview & Architecture C4 Component Diagram 2:25
  • CreateUser – Implement Command & Validator Logic with FluentValidation 14:12
  • CreateUser – Implement User Domain Aggregate with DDD Principles 19:58
  • CreateUser – Implement Domain Persistence with EF Core & SQL Server 14:54
  • Toolbox – Upgrade to .NET 9 5:52
  • CreateUser – Implement Command Handler with ASP.NET Identity & FastEndpoints 22:37
  • EmailService Module – Implement SMTP Integration in Modular Monolith 20:48
  • CreateUser – Implement Domain Event for Confirmation Email with FastEndpoints 11:40
  • Application Startup – Configure Services & Modules via Dependency Injection 19:06
  • Login – Architecture Overview & Auth Flow Diagram 1:58
  • Login – Implement Command & Validator Logic with FluentValidation 4:17
  • Login – Implement Command Handler with ASP.NET Identity & FastEndpoints 5:00
  • Login – Generate JWT Token in Command Handler 14:16
  • Login – Generate & Persist Refresh Token 7:05
  • Login – Refactor with SRP & DDD: Move Token Generation to Factory 12:13
Chương 5 Journal Microservice with FastEndpoints, Redis & gRPC
  • Overview – Auth Flow, User Stories & Endpoint Design 7:19
  • Requirements – Features, Performance & Security 2:23
  • High Level Architecture – Tech Stack, Layers & Design Choices 6:15
  • Integration - Sync Journal Data Across Services with Events 1:17
  • Integration - Validate Editor in Submission via Journal gRPC Service 1:38
  • Tactical DDD – Aggregates, Entities, Value Objects & Domain Events 2:26
  • Architecture Summary - Key Patterns, Tools & Decisions 1:58
  • CreateJournal - Clean Architecture & Setup 1:26
  • CreateJournal - Architecture Overview with C4 Component Diagram 3:22
  • CreateJournal – Implement Command & Validator Logic with FluentValidation 9:53
  • CreateJournal - Implement Domain & Persistence with Redis.OM & StackExchange 16:33
  • CreateJournal – Implement Command Handler with FastEndpoints & Redis.OM 9:20
  • GetPerson - Implement gRPC Contracts with protobuf-net 14:29
  • GetPerson – Implement Aggregate Decomposition: Split User into Person & User 10:17
  • GetPerson – Implement Person Persistence with EF.Core & SQL Server 10:03
  • GetPerson – Implement Login Refactor for Person Aggregate 11:14
  • GetPerson – Implement CreateUser Refactor for Person Aggregate 7:02
  • GetPerson - Implement Person gRPC service with Grpc.AspNetCore & protobuf-net 10:00
  • CreateJournal – Implement Editor Creation via Person gRPC Service 3:58
  • Application Startup – Configure Services & Modules with Dependency Injection 14:50
  • SearchJournals – Implement Redis Index & Full-Text Search 19:46
  • ApproveArticle – Implement Minimal API Endpoint, Command & Fluent Validator 10:55
  • ApproveArticle– Implement Command Handler with MediatR & Repository 9:52
  • ApproveArticle– Implement CreateEditor scenario via Person gRPC 6:20
  • Journal - Implement IsEditorAssignedToJournal gRPC Contracts (protobuf-net) 5:34
  • Journal - Implement IsEditorAssignedToJournal gRPC Service & Repository 6:30
  • ApproveArticle -Implement IsEditorAssignedToJournal via Journal gRPC Service 5:56
Chương 6 Review Microservice with MediatR, FluentValidation & EF.Core
  • Overview – Article Flow, User Stories & Endpoint Design 7:31
  • Requirements – Features, Performance & Security 3:12
  • High Level Architecture – Tech Stack, Layers & Design Choices 3:57
  • Tactical DDD – Aggregates, Entities, Value Objects & Domain Events 5:05
  • Architecture Summary - Key Patterns, Tools & Decisions 1:25
  • Clean Architecture & Setup 1:31
  • ArticleApproved- Architecture Overview with C4 Dynamic Sequence Diagram 3:33
  • ArticleApproved - Projects Setup 3:48
  • Implement Aggregate Root for Domain Events, Identity & Boundaries 6:25
  • Dispatch Domain Events – EF Core Interceptor, MediatR & FastEndpoints 13:10
  • ArticleApproved - Publish ArticleApproved Integration Event with MassTransit 12:09
  • ArticleApproved - Create Mapster configuration 5:49
  • ArticleApproved - Configure MassTransit with RabbitMQ 10:01
  • ArticleApproved – Include Article Aggregate Entities with EF Core & LINQ 3:47
  • ArticleApproved - Comsume ArticleApproved Event with MassTransit & RabbitMq 3:57
  • ArticleApproved – Implement Domain Aggregates with DDD Principles 23:23
  • ArticleApproved – Persist Domain with EF Core & SQL Server 29:37
  • ArticleApproved - Implement ArticleApproved Consumer with RabbitMQ & MassTransit 23:56
  • ArticleApproved - Implement Transfer Files with FileStorage (Mongo GridFS) 12:52
  • Refactor FileStorage Integration – Clean Architecture Principles 8:06
  • ArticleApproved - Finalize File Transfer with FileStorage (Mongo GridFS) 5:54
  • Application Startup – Configure Services & Modules with Dependency Injection 19:55
  • InviteReviewer – Implement Endpoint with Carter & FluentValidation 15:39
  • InviteReviewer - Implement Domain with DDD Principles 13:15
  • InviteReviewer - Implement Command Handler with MediatR, Repos & Behaviors 27:39
  • AcceptInvitation - Architecture Overview with C4 Dynamic Sequence Diagram 2:33
  • AcceptInvitation - Implement Endpoint with Carter & FluentValidation 7:22
  • AcceptInvitation - Implement Command Handler with gRPC, Repos & Behaviors 29:32
  • AcceptInvitation – Implement Domain Event for Confirmation Email with MediatR 3:54
Chương 7 ArticleHub Microservice with GraphQL, Hasura & MassTransit Events
  • Overview – Search Article Flow, User Stories & Endpoint Design 6:48
  • Requirements – Features, Performance & Security 6:08
  • High-Level Architecture – Tech Stack, Layers & Design Choices 5:44
  • Tactical DDD – Aggregates, Entities, Value Objects & Domain Events 2:33
  • Architecture Summary - Key Patterns, Tools & Decisions 2:13
  • ArticleFeed - C4 Dynamic Sequence Diagram 3:56
  • ArticleFeed - Setting Up the Event Consumers 5:42
  • ArticleFeed – Implement Article Domain Aggregate with DDD Principles 8:08
  • ArticleFeed – Implement Domain Persistence with EF Core & PostgreSQL 14:23
  • ArticleFeed - Implement ApprovedForReview Event Consumer with MassTransit 17:18
  • ArticleFeed - Implement Integration Event Building Block 8:49
  • ArticleFeed - Implement AcceptForProduction Consumer with MassTransit 5:07
  • Search Articles - Implement GraphQL Query with Hasura & PostgreSQL 18:23
  • Search Articles - Implement Search Pagination 7:17
  • Application Startup – Configure Services & Modules with Dependency Injection 12:35
Chương 8 Tech Foundations: Middleware, Interception, Docker, EF Core & More
  • Tech Foundations – Why This Section 1:35
  • Middleware – Global Exception Handling 22:02
  • Interception – All Interception Points (Pipeline Overview) 3:57
  • Interception – Endpoint Filters (Minimal APIs) 22:19
  • Interception – Behaviors (MediatR) 4:42
  • Interception – Pre-Processors (FastEndpoints) 6:09
  • Interception – gRPC Interceptors 5:29
  • Interception – Summary & Best Practices 3:59
  • Docker & Docker-Compose – Configure & Run 32:19
  • EF Core Migrations – Manage Migrations per Microservice 24:22
  • EF Core Migrations – Design-Time Factory 8:13
Chương 9 Technical Deep Dives – Individual Topics
  • Auth Token Factory – Generating JWT & Refresh Tokens 3:04
  • Base Repository – Implementation 6:48
  • Cache Repository – Adding Caching to Repositories 12:57
  • Claims Provider – Extracting User Claims 15:10
  • Configure & Validate Options – Strongly Typed Settings 5:58
  • Email Service (SMTP) – Sending Notifications 20:17
  • Entity Configuration – Implement the Base Class with EF.Core 4:03
  • Enum Entity – Typed Enumerations 2:43
  • Fixing NuGet Version Conflicts – Consolidate & Update Package Versions 0:59
  • Global Usings – Centralizing Common Namespaces 1:03
  • Handling Missing Entities - Not Found Exception & HTTP Code 5:07
  • Value Object – Base Class Implementation 4:59
  • String Value Object – Base Class Implementation 2:13
  • Validation Behavior – Wiring FluentValidation into the MediatR Pipeline 3:07
Chương 10 Testing & Debugging with Postman
  • Introduction 0:34
  • Running Docker for Local Testing 6:48
  • Importing Postman Collection 2:09
  • Testing Auth Service 13:57
  • Using Postman Environments 4:51
  • Testing Submission Service 29:21
  • Testing Review Service 13:41
  • Testing Article Hub 17:24
  • Testing Journals 17:52

Requirment

  • Basic knowledge of C# and .NET (classes, interfaces, async/await)

  • Familiarity with REST APIs (HTTP methods, JSON, controllers)

  • Understanding of databases and SQL (basic queries, relations)

  • Familiarity with Visual Studio or VS Code

  • Some experience with Git and GitHub is helpful

  • Familiarity with Docker is a plus

Outcomes

  • Build 5 real microservices end-to-end — and see how modular monoliths fit in the same solution

  • Implement CQRS & Interceptors using both MediatR and FastEndpoints

  • Use gRPC for synchronous and MassTransit for asynchronous microservices communication

  • Design your system first with C4 diagrams, sequence diagrams and tactical DDD

  • Apply Vertical Slice and Clean Architecture to organize your microservices

  • Apply DDD to model aggregates, value objects and domain events around real business rules

  • Use Docker to containerize your microservices & external dependencies

  • Build flexible Minimal APIs using ASP.NET Core, with or without Carter

  • Build global exception handling middleware for clean, consistent error responses

  • Apply interception with endpoint filters, MediatR behaviors, pre-processors and gRPC interceptors

  • Use GraphQL to query and filter efficiently from a PostgreSQL database

  • Secure your APIs using role-based authentication with .NET Identity and JWT tokens

  • Use Redis as a database to boost your microservice performance

  • Implement a CacheRepository pattern with DbContext and InMemoryCache for faster queries

  • Store your files in Azure Blob Storage or Mongo GridFS for scalable file management

  • Handle domain events to trigger side effects across your services using SaveChangesInterceptor

  • Map DTOs and integration events efficiently using Mapster or AutoMapper

Instructor

...
Laurentiu Dumitrescu

0.0

  • ... 0 Student
  • ... 1 Course
  • ... 0 review

View Details

Reviews

Rate this course :

Remove all