explaingit

kgrzybek/modular-monolith-with-ddd

13,657C#Audience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

A complete, real-world .NET application in C# that shows how to structure a large app into clean, self-contained modules using Domain-Driven Design and CQRS.

Mindmap

mindmap
  root((modular-monolith-ddd))
    Architecture
      Modular monolith
      Domain-Driven Design
      CQRS pattern
      Event sourcing
    Features
      Authentication
      Logging
      Unit tests
      Integration tests
    Tech Stack
      C#
      .NET
      React
      SQL
    Domain
      Meeting groups
      User accounts
      Meetup-style rules
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Study a production-quality example to learn how to split a .NET application into modules without turning it into microservices.

USE CASE 2

Use the architecture decisions and diagrams as a reference when designing your own .NET app with Domain-Driven Design.

USE CASE 3

See how CQRS separates read and write operations in a real application with authentication, logging, and tests included.

USE CASE 4

Copy the meeting-group domain model as a starting template for a .NET app that has real business rules beyond basic create-read-update-delete.

Tech stack

C#.NETReactSQL

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires .NET SDK and a SQL database, the React front end needs Node.js, full setup involves reading the architecture documentation.

Use is conditional on the user taking a public stance on the Russia-Ukraine conflict, review the repository license before use.

In plain English

This repository is a full, working .NET application built in C# that demonstrates how to structure a moderately large application as a modular monolith using Domain-Driven Design principles. A modular monolith means the code runs as a single deployed application, but is organized internally into clear, self-contained modules rather than a tangle of interconnected code. Domain-Driven Design is an approach where the structure of the code closely mirrors the real-world business concepts and rules it represents. The author built this because most example projects on GitHub that claim to show these patterns are either too simple to be useful, unfinished, or do not clearly explain the decisions behind them. The goal here is to show what a real, production-ready implementation looks like, including things like authentication, logging, unit tests, integration tests, event sourcing, and database change management. The business domain chosen for the example is a meeting-group organizer, similar to Meetup.com. Users can join groups, create meetings, and interact with other members. This domain was picked because it is familiar to many people, has real business rules beyond simple create-read-update-delete operations, and does not require specialized knowledge to understand. The project also uses an architectural pattern called CQRS, which separates the actions that read data from the actions that write data. There is a companion front-end application built in React. The README includes diagrams, architecture decision records, and detailed explanations of each design choice. The project requires a stance on the Russia-Ukraine conflict as a condition of use, as stated in the repository itself. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Based on the kgrzybek modular monolith example, show me how to define a module boundary in .NET with an internal API that other modules can call without direct class references.
Prompt 2
How does kgrzybek/modular-monolith-with-ddd implement CQRS commands and queries? Show me the pattern for adding a new command handler.
Prompt 3
Walk me through the event sourcing setup in kgrzybek/modular-monolith-with-ddd and how domain events are dispatched between modules.
Prompt 4
How do I run the kgrzybek modular monolith sample locally including the database migrations and the React front end?
Open on GitHub → Explain another repo

← kgrzybek on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.