How srrickgrimes/modularmonolith works
• Host (Monolith) Application:
• ASP.NET Core Web API – represents the main server (for instance, the “Server” project in “Monolith” or “MonolithTemplate”).
• CrossCuttingConcerns Library – containing common interfaces (like IModuleInstaller) and shared services.
• Module(s):
• Each module is composed of several layers:
Application Layer – encapsulates business use case logic (e.g., IApplication, ServiceExtensions, and Validators).
Contracts Layer – defines data transfer objects (DTOs) and query/command interfaces.
Domain Layer – contains core business entities (e.g., Message entity).
EndPoints Layer – defines the API endpoints (e.g., HelloWorld endpoint) that expose module functionality.
Infrastructure Layer – includes integration handlers (e.g., GetMessageQueryHandler) and any persistence-related implementations.
Module Installer – responsible for bootstrapping the module (registering services, etc.) into the host application.
• Shared or External Technologies:
• ASP.NET Core
• MediatR (for in-process messaging)
• FastEndpoints (for creating fast and minimal endpoints)
• FluentValidation (for validating requests and commands)
• Ardalis Result (for implementing the Result pattern)
Relationships and interactions
• Within each module, illustrate how the EndPoints layer calls the Application layer. Then show that the Application layer interacts with the Domain layer (for core business logic) and with the Infrastructure layer (for integrations or persistence).
• That the Contracts layer is used as a communication boundary between modules and possibly with external consumers. This layer defines DTOs and queries that flow between endpoints and application logic.
• Dependency from the Host’s CrossCuttingConcerns into the modules, showing how shared interfaces, such as IModuleInstaller, facilitate the integration.
Architectural patterns and design principles
• Clean Architecture: Demonstrate the layered separation (presentation, application, domain, and infrastructure) by grouping the module components by their function.
• Modular Monolith: Explicitly represent that the system is composed of independently installable modules plugged into the host application. Emphasize the role of the module installer in automatically wiring up the module’s services.
• Use Dependency Injection (DI): Indicate how the host automatically registers and loads module components via DI.
• Consistent naming conventions: As described in the README, show that namespaces and naming between Host and modules are maintained consistently.