Self-hosted service
phongnguyend/Practical.CleanArchitecture avatar
phongnguyend/Practical.CleanArchitecture

Practical.CleanArchitecture: A .NET 10 Reference Solution for Clean Architecture and DDD

Full-stack .Net 10 Clean Architecture (Microservices, Modular Monolith, Monolith), Blazor, Angular 22, React 19, Vue 3.5, BFF with YARP, NextJs 16, Domain-Driven Design, CQRS, SOLID, Asp.Net Core Identity Custom Storage, OpenID Connect, EF Core, OpenTelemetry, SignalR, Background Services, Health Checks, Rate Limiting, Clouds (Azure, AWS, GCP), ...

2,462 stars610 forksC#MIT

At a glance

What is it?
phongnguyend/Practical.CleanArchitecture is a full-stack .NET 10 sample that ships the same ClassifiedAds domain three ways: monolith, modular monolith and microservices, with Blazor, Angular, React, Vue and NextJs front ends. It is a teaching repository, and its own README says the samples are not always best practices.
Who is it for?
Adopt it if you are a .NET engineer who learns by reading a working solution rather than a blog post, or a team that wants a concrete starting point for Clean Architecture, DDD and CQRS across monolith, modular monolith and microservices. Do not adopt it as a production baseline without review: the README itself warns that the code samples contain multiple ways and patterns to do things and are not always best practices.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Practical.CleanArchitecture Actually Is

This is a reference solution, not a framework and not a library you add to a project. The repository is a C# codebase built around a single working domain, ClassifiedAds, and it exists to show how Clean Architecture, Domain-Driven Design, CQRS and SOLID look when they are written out in full rather than described in a diagram. The README opens with a warning that the code samples contain multiple ways and patterns to do things and not always be considered best practices or recommended for all situations. That sentence should set your expectations for the whole repository.

The audience is .NET engineers and architects. If you already know what the dependency rule means and you want to see how it is enforced across a real solution with EF Core, OpenID Connect, SignalR, background services, health checks and rate limiting, the repository is aimed at you. If you are looking for a package to install, this is the wrong project. The licence is MIT, and the default branch is master.

One Domain, Three Deployment Shapes

The structure that distinguishes this repository is that the same ClassifiedAds product is implemented as a monolith, a modular monolith and a set of microservices. The README documents the three solution structures separately, with diagrams for the monolith, the modular monolith and the microservices layouts, and it also documents Vertical Slice Architecture in the modular monolith context. That means you can compare how the same feature is cut along different boundaries without switching projects.

The front end is equally broad. The description lists Blazor, Angular 22, React 19, Vue 3.5 and NextJs 16, with a BFF built on YARP, and the most recent release, v2025.11, is tagged with .NET 9, Angular 20, React 19, Vue 3.5 and NextJs 15. The gap between the description and the release tag is worth noticing: the description reflects the current state of master, while v2025.11 is a snapshot from 2025-11-13. If you need a pinned set of versions, the release tag is the safer reference than the branch.

Layer Dependencies and the Architecture Diagrams

The README spends most of its length on diagrams rather than prose. It includes Database Centric vs Domain Centric Architecture, Hexagonal Architecture, Onion Architecture, The Clean Architecture, Classic Three-layer Architecture, Modern Four-layer Architecture, Layer Dependencies and Layer Examples. Each image links to a draw.io source file stored under docs/imgs, so you can open and edit the diagrams rather than only viewing them.

That is the useful part. The diagrams are the argument: they show where dependencies are allowed to point, and the Layer Dependencies diagram is the one that matters most if you are trying to explain the dependency rule to a team. The limitation is that the README does not narrate these diagrams. There is no paragraph explaining why one layout was chosen over another, and no migration path described between the three deployment shapes. You are expected to read the code and the pictures together.

Installing and Running the ClassifiedAds Sample

The README does not give a single clone-and-run command sequence. Its How to Run section is organised as configuration steps, and it points at specific appsettings.json files inside the solution. Start by getting the repository onto your machine, then open the appsettings.json for the host you intend to run, for example the one under ClassifiedAds.WebMVC or ClassifiedAds.WebAPI in the monolith solution.

bash
git clone https://github.com/phongnguyend/Practical.CleanArchitecture.git
cd Practical.CleanArchitecture

The first configuration block you are told to look at is ConfigurationSources. By default the SQL Server source is disabled and points at a local server on port 127.0.0.1 with the database name ClassifiedAds. Enabling it makes the application read configuration entries from a table using the query shown in the README.

json
"ConfigurationSources": {
  "SqlServer": {
    "IsEnabled": false,
    "ConnectionString": "Server=127.0.0.1;Database=ClassifiedAds;User Id=sa;Password=sqladmin123!@#",
    "SqlQuery": "select [Key], [Value] from ConfigurationEntries"
  },
  "AzureKeyVault": {
    "IsEnabled": false,
    "VaultName": "https://xxx.vault.azure.net/"
  }
}

The README shows three variants: SQL Server only, Azure Key Vault only, and both enabled at once. If you enable both, the README does not state which source wins on a conflicting key, so keep one source enabled until you have confirmed the resolution order yourself.

The next block is Storage. The provider defaults to Local, and the README gives the exact shapes for local files, Azure Blob and Amazon S3, including the Path, ConnectionString, Container, AccessKeyID, SecretAccessKey, BucketName and RegionEndpoint keys. The third block is Messaging, configured in ClassifiedAds.Background/appsettings.json, where the provider defaults to RabbitMQ and the README lists host name, credentials, exchange name, routing keys and queue names for FileUploadedEvent, FileDeletedEvent, EmailMessageCreatedEvent and SmsMessageCreatedEvent.

What you should see after this is a running ClassifiedAds host backed by whichever storage, messaging and configuration providers you enabled. The README does not document a container-compose one-liner, so expect to wire SQL Server, RabbitMQ or Kafka and your chosen storage provider yourself before the application behaves end to end.

Where This Repository Will Mislead You

The warning at the top of the README is the most important line in it. A repository that deliberately contains multiple ways to do the same thing is a catalogue, not a style guide. Copying a pattern out of it because it appears in the solution is a mistake the README explicitly anticipates.

The second limitation is scope. This is a sample built on a classified ads domain, and the description lists Azure, AWS and GCP among its topics, but breadth of topics is not depth of coverage in any one of them. The README's configuration sections show how to point at Azure Key Vault, Azure Blob and Amazon S3, which is a demonstration of pluggability rather than a production hardening guide. There is no documented rollback procedure if a configuration source misbehaves, and the README does not describe failure handling for the message broker beyond the provider switch.

The third is version drift. The description advertises .NET 10, Angular 22 and NextJs 16, while the newest release, v2025.11, is tagged .NET 9, Angular 20 and NextJs 15. If your team standardises on a release, you are adopting the older stack. If you track master, you inherit whatever the branch contains today. Neither choice is documented as supported.

How It Compares to Jason Taylor's Clean Architecture Template

The obvious alternative for a .NET developer is Jason Taylor's Clean Architecture solution template, distributed as a dotnet new template. The difference in approach is fundamental. A template generates a fresh, opinionated skeleton for one application: you run the template command, get a single solution with one deployment shape, and start adding your own features. Practical.CleanArchitecture does the opposite. It is a finished, wide solution that shows the same domain in three deployment shapes and five front-end stacks, and you read it rather than generate from it.

That makes the template better when you want to start building today with a consistent structure, and this repository better when you want to understand the trade-offs between monolith, modular monolith and microservices before choosing. The repository is also stronger as a comparison reference for front-end integration, since the template does not carry Blazor, Angular, React, Vue and NextJs variants side by side. Neither is a production system, and the README here says so about its own samples.

Maintenance, Licence and Upgrade Cost

The repository is not archived and the last push was on 2026-09-28, so it is being updated. The release cadence is annual and named by year: v2023.12 in December 2023, v2024.12 in December 2024, and v2025.11 in November 2025. Each release moves the underlying stack forward, from .NET 7 with Angular 16 in v2023.12, to .NET 8 with Angular 18 in v2024.12, to .NET 9 with Angular 20 in v2025.11. If you build on a release tag, expect to repeat that migration roughly once a year across both the .NET side and the JavaScript front ends.

The licence is MIT, which permits use, modification and redistribution with the licence and copyright notice retained. That is a permissive arrangement, but it says nothing about the correctness or fitness of the sample code, and the README's own warning about patterns applies regardless of licence. Nothing here is legal advice; read the LICENSE file for the actual terms. The repository carries gitleaks configuration and an Azure Pipelines gitleaks file, which suggests secret scanning is part of its own CI, but the README does not document a support policy or a version compatibility matrix.

Editorial conclusion

Adopt it if you are a .NET engineer who learns by reading a working solution rather than a blog post, or a team that wants a concrete starting point for Clean Architecture, DDD and CQRS across monolith, modular monolith and microservices. Do not adopt it as a production baseline without review: the README itself warns that the code samples contain multiple ways and patterns to do things and are not always best practices. Before you commit, verify three things in the repository: which solution under src/ maps to the deployment shape you want, whether the ConfigurationSources and Storage providers you need are enabled in the relevant appsettings.json, and which release tag matches the .NET and front-end versions your team can support. The last push was on 2026-09-28, so the repository is current, but currency is not the same as production readiness.

Frequently asked questions

What is Clean Architecture in simple terms, and how does this repository demonstrate it?

Clean Architecture organises code so that dependencies point inward toward the domain rather than outward toward databases and frameworks. This repository demonstrates it through the Layer Dependencies and Layer Examples diagrams in the README, and by implementing the same ClassifiedAds domain as a monolith, a modular monolith and microservices.

What are the drawbacks of Clean Architecture, and does Practical.CleanArchitecture acknowledge them?

The README does not list drawbacks of Clean Architecture itself. It does warn that the code samples contain multiple ways and patterns to do things and not always be considered best practices or recommended for all situations, which is a caution about the sample code rather than about the architecture.

Are DDD and Clean Architecture the same thing in Practical.CleanArchitecture?

They are treated as separate concerns. The repository description lists Domain-Driven Design and Clean Architecture as distinct topics, and the README's diagrams cover Database Centric vs Domain Centric Architecture separately from the layering diagrams such as Onion Architecture and The Clean Architecture.

What is the difference between clean code and a Clean Architecture?

The repository does not define clean code, and the README does not compare the two concepts. What it does show is architectural structure: layer dependency diagrams, hexagonal and onion layouts, and three solution structures for the same domain.

Official sources

  1. Issues
  2. License: MIT
  3. phongnguyend/Practical.CleanArchitecture on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/phongnguyend-practical-cleanarchitecture.svg)](https://hysenlabs.com/projects/phongnguyend-practical-cleanarchitecture)