How baranacikgoz/modular-monolith-ddd-vsa-webapi works
This is a .NET modular-monolith WebAPI boilerplate. Its user-facing flow is an API request entering the host, passing module endpoint and authorization handling, then brokering identity or domain work to backing services and returning a result. The repository also documents event-driven messaging, inter-module requests, background jobs, persistence, caching, and observability. Some module links below are documented in the README rather than shown in sampled implementation excerpts; those edges cite the README.
Main entry points: Program.cs Web API Host · IAM.Endpoints Identity Endpoints · KeycloakPermissionAuthorizationHandler.cs Permission Authorization · Products Products
Components 18
API Host
- Web API Host
src/Host/Host/Program.cs - Module Registration
src/Host/Host/Infrastructure/Setup.Modules.cs
Identity and Access
- Identity Endpoints
src/Modules/IAM/IAM.Endpoints - Permission Authorization
src/Modules/IAM/IAM.Infrastructure/Auth/KeycloakPermissionAuthorizationHandler.cs - Keycloak Admin Client
src/Modules/IAM/IAM.Infrastructure/Keycloak/KeycloakAdminClient.cs
Domain Modules
- Products
src/Modules/Products - Inventory
src/Modules/Inventory - Notifications and OTP
src/Modules/Notifications
Shared Infrastructure
- Relational Database
- Redis Cache
- OpenTelemetry
src/Host/Host/Infrastructure/Setup.Observability.cs
Messaging and Jobs
- Transactional Outbox
src/Common/Common.Infrastructure/EventBus/IntegrationEventOutbox.cs - Event Dispatch
src/Common/Common.Infrastructure/EventBus/EventDispatcher.cs - Inter-module Requests
src/Common/Common.InterModuleRequests/Contracts/MassTransitInterModuleRequestClient.cs - Background Jobs
src/Modules/BackgroundJobs/BackgroundJobs/BackgroundJobsService.cs
Other components
- API Client
- Keycloak
- RabbitMQ
Connections 21
- API Client → Web API Host: sends requests
README.md - Web API Host → Module Registration: registers modules
README.md - Module Registration → Identity Endpoints: loads modules
README.md - Identity Endpoints → Permission Authorization: checks permissions
README.md - Permission Authorization → Keycloak: decides permissions
src/Modules/IAM/IAM.Infrastructure/Auth/KeycloakPermissionAuthorizationHandler.cs - Identity Endpoints → Keycloak Admin Client: brokers identity
README.md - Keycloak Admin Client → Keycloak: manages identities
src/Modules/IAM/IAM.Infrastructure/Keycloak/KeycloakAdminClient.cs - Web API Host → Products: routes module requests
README.md - Web API Host → Inventory: routes module requests
README.md - Web API Host → Notifications and OTP: routes module requests
README.md - Products → Relational Database: persists domain data
README.md - Inventory → Relational Database: persists domain data
README.md - Notifications and OTP → Relational Database: persists domain data
README.md - Permission Authorization → Redis Cache: caches decisions
src/Modules/IAM/IAM.Infrastructure/Auth/KeycloakPermissionAuthorizationHandler.cs - Transactional Outbox → Relational Database: stores messages
README.md - Transactional Outbox → Event Dispatch: delivers messages
README.md - Event Dispatch → RabbitMQ: publishes events
README.md - Inter-module Requests → RabbitMQ: requests responses
README.md - Products → Inter-module Requests: requests other modules
README.md - Background Jobs → Relational Database: runs persisted jobs
README.md - Web API Host → OpenTelemetry: exports telemetry
README.md