Skip to content

Repository files navigation

Modulith

Work in progress...

dotnet new templates for building modular monoliths in C#, published to nuget.org as the Modulith package.

dotnet new modulith scaffolds a .NET solution: a Blazor Server host plus one vertical slice per feature, each owning its own Contracts/Domain/Application/Infrastructure/Web projects, its own EF Core DbContext, and its own Postgres schema. Features reach each other only through Contracts, and architecture tests enforce that. dotnet new modulith-feature adds another slice to an existing solution — layer projects, test projects and solution registration, fully wired.

Use it when a set of microservices would be premature but you still want the module boundaries that make splitting one out later a mechanical job.

Heavily inspired by:

Install

dotnet new install Modulith

Then scaffold a new solution:

dotnet new modulith -n MyApp -o MyApp

Add another feature slice to an existing generated solution (run from that solution's root):

dotnet new modulith-feature --appName MyApp -n Payments

Built for AI coding agents

The generated solution ships with a CLAUDE.md describing its VSA + DDD architecture, layer boundaries, and commands. It gives coding agents the structure and guardrails to add or modify features consistently — where each layer's responsibilities end, how features stay isolated from one another, and how to verify a change (build, test, architecture tests) before calling it done.

Development

Test the package:

dotnet new install working/content/modulith

Package:

cd working
dotnet pack
dotnet new install bin/Release/Modulith.*.nupkg

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages