| name | modular-monolith |
| description | Modular monolith with bounded contexts. Use for scalable monoliths. |
Modular Monolith
A Modular Monolith is a single deployable unit (Monolith) where the code is structured into independent modules (like Microservices) with strict boundaries. In 2025, this is the recommended default architecture for most startups and medium-scale apps.
When to Use
- Starting a new project (Greenfield).
- Domain boundaries are not yet fully clear.
- Wanting the speed of simple deployment (one CI pipeline, one DB instance) but preventing "spaghetti code".
- Precursor to Microservices.
Quick Start
/src
/Modules
/Catalog <-- Public Interface defined here
/Core <-- Internals (Classes, Logic) hidden
/API <-- Public Contracts (DTOs)
/Ordering
/Core
/Shipping
/Core
/Shared <-- Infrastructure, Event Bus
public class OrderService {
private readonly ICatalogModule _catalog;
public async Task Checkout(string productId) {
var product = await _catalog.GetProduct(productId);
}
}
Core Concepts