How saedjomaa/modularmonolith_cleanarchitecture_domaindrivendesign works
CourseHub is a .NET modular-monolith backend for a course platform. Its principal flow is an instructor publishing a course, followed by students enrolling or joining a waitlists; billing handles invoices and payments, and integration events coordinate bounded contexts and notifications. Users also register, authenticate, and manage profiles; instructors manage courses and view students. The README documents the publishing path and event-based context interactions. Other module paths and capabilities are represented from the tree and README; unsampled implementation details are not assumed.
Main entry points: CourseCommands.cs Course commands · CoursesEndpoints.cs Course endpoints · CourseSeats.cs Course seats · UsersEndpoints.cs User endpoints
Components 34
API entry
- HTTP API
src/Bootstrapper/CourseHub.Api/Program.cs
Users context
- User endpoints
src/Modules/Users/Presentation/UsersEndpoints.cs - Authentication
src/Modules/Users/Application/Users/Authentication/Authentication.cs - Identity adapter
src/Modules/Users/Infrastructure/Identity/IdentityService.cs - Profile use cases
src/Modules/Users/Application/Users/Profiles/Profiles.cs - Profile queries
src/Modules/Users/Infrastructure/Queries/GetMyProfileQueryHandler.cs - Users persistence
src/Modules/Users/Infrastructure/Persistence/UsersPersistence.cs
Courses context
- Course endpoints
src/Modules/Courses/Presentation/CoursesEndpoints.cs - Course commands
src/Modules/Courses/Application/Courses/CourseCommands.cs - Course aggregate
src/Modules/Courses/Domain/Courses/Course.cs - Courses persistence
src/Modules/Courses/Infrastructure/Persistence/CoursesPersistence.cs - Course queries
src/Modules/Courses/Infrastructure/Queries/CourseQueryHandlers.cs - Course events
src/Modules/Courses/IntegrationEvents/CoursesIntegrationEvents.cs
Enrollment context
- Enrollment endpoints
src/Modules/Enrollment/Presentation/EnrollmentEndpoints.cs - Seat commands
src/Modules/Enrollment/Application/Seats/SeatCommands.cs - Course seats
src/Modules/Enrollment/Domain/Seats/CourseSeats.cs - Student enrollment
src/Modules/Enrollment/Domain/Seats/StudentEnrollment.cs - Seat queries
src/Modules/Enrollment/Infrastructure/Queries/SeatQueryHandlers.cs - Enrollment persistence
src/Modules/Enrollment/Infrastructure/Persistence/EnrollmentPersistence.cs - Event handlers
src/Modules/Enrollment/Application/IntegrationEventHandlers/IntegrationEventHandlers.cs
Billing context
- Billing endpoints
src/Modules/Billing/Presentation/BillingEndpoints.cs - Invoice commands
src/Modules/Billing/Application/Invoices/InvoiceCommands.cs - Invoice aggregate
src/Modules/Billing/Domain/Invoices/Invoice.cs - Payment gateway
src/Modules/Billing/Infrastructure/Payments/Payments.cs - Billing persistence
src/Modules/Billing/Infrastructure/Persistence/BillingPersistence.cs - Invoice queries
src/Modules/Billing/Infrastructure/Queries/InvoiceQueryHandlers.cs - Billing event handlers
src/Modules/Billing/Application/IntegrationEventHandlers/IntegrationEventHandlers.cs
Shared infrastructure
- Notification handlers
src/Modules/Notifications/Application/IntegrationEventHandlers/IntegrationEventHandlers.cs - Message composer
src/Modules/Notifications/Domain/Messages/MessageComposer.cs - Outbox and inbox
src/BuildingBlocks/Infrastructure/Messaging/MessagingServiceExtensions.cs - Unit of work
src/BuildingBlocks/Infrastructure/Persistence/UnitOfWork.cs - HTTP result mapping
src/BuildingBlocks/Presentation/Results/ResultHttpExtensions.cs
Other components
- Instructor
- Student
Connections 29
- Instructor → Course endpoints: publishes through
README.md - Course endpoints → Course commands: dispatches
README.md - Course commands → Course aggregate: invokes
README.md - Course commands → Courses persistence: persists via
README.md - Course commands → Course events: publishes language
README.md - Student → Enrollment endpoints: enrolls through
- Enrollment endpoints → Seat commands: dispatches
- Seat commands → Course seats: changes seats
- Course seats → Student enrollment: creates and changes
src/Modules/Enrollment/Domain/Seats/CourseSeats.cs - Seat queries → Enrollment persistence: reads
src/Modules/Enrollment/Infrastructure/Queries/SeatQueryHandlers.cs - Course seats → Enrollment persistence: persists via
src/Modules/Enrollment/Infrastructure/Persistence/EnrollmentPersistence.cs - Event handlers → Course seats: applies events
src/Modules/Enrollment/Application/IntegrationEventHandlers/IntegrationEventHandlers.cs - Student → User endpoints: authenticates through
- User endpoints → Authentication: dispatches
- Authentication → Identity adapter: uses identity port
src/Modules/Users/Infrastructure/Identity/IdentityService.cs - Profile queries → Users persistence: reads
src/Modules/Users/Infrastructure/Queries/GetMyProfileQueryHandler.cs - User endpoints → Profile use cases: dispatches
- Billing event handlers → Invoice aggregate: creates or updates
src/Modules/Billing/Application/IntegrationEventHandlers/IntegrationEventHandlers.cs - Billing endpoints → Invoice commands: dispatches
- Invoice commands → Invoice aggregate: changes invoice
- Invoice commands → Payment gateway: uses gateway
README.md - Invoice queries → Billing persistence: reads
src/Modules/Billing/Infrastructure/Queries/InvoiceQueryHandlers.cs - Invoice aggregate → Billing persistence: persists via
- Notification handlers → Message composer: uses composer
src/Modules/Notifications/Application/IntegrationEventHandlers/IntegrationEventHandlers.cs - Outbox and inbox → Billing event handlers: registers handlers
src/BuildingBlocks/Infrastructure/Messaging/MessagingServiceExtensions.cs - Outbox and inbox → Notification handlers: registers handlers
src/BuildingBlocks/Infrastructure/Messaging/MessagingServiceExtensions.cs - Course endpoints → HTTP result mapping: maps results
- Unit of work → Courses persistence: commits
- HTTP API → Course endpoints: hosts routes