How tempoodev/booking works
Main Components
• • .NET Aspire Orchestration: Represented by the “Aspire/Booking.AppHost” component, which is the entry point for running the microservices.
• • API Layer: Located in “src/Booking/Api”. This component exposes HTTP endpoints for client interactions.
• • Application Layer: Shown under “src/Booking/Application”. This layer includes common/shared logic and feature-specific modules (e.g., TodoItems and TodoLists) that coordinate business operations.
• • Domain Layer: Within the Application modules, the Domain folders (and ValueObjects) hold the core business entities and rules.
• • Infrastructure Layer: Included in parts of “src/Booking/Application/Common/Infrastructure” and “src/Booking/Application/TodoItems/Infrastructure” where database context, migrations, and external service implementations reside.
• • Migration Service: Under “src/Booking/Booking.MigrationService”, which is responsible for applying EF Core migrations at deployment.
• • Shared Library: Found in “src/Shared/Shared” that provides common shared components like API base controllers, behaviours, and security utilities.
• • Test Suite: Depicted as separate units (unit tests and integration tests in the “tests” directory) verifying both business logic and integration points.
• • HTTP Request Samples: The “requests” folder contains HTTP files to simulate API interactions, useful for integration testing and verification.
Component Relationships and Data Flows
• The API layer then calls into the Application Layer, which coordinates business logic in the Domain Layer.
• Domain operations often trigger Domain Events (as seen in the TodoItems feature) that are handled by event handlers.
• The Infrastructure layer supports the Application and Domain layers by providing persistence (via EF Core DbContext) and other processes like CSV file generation.
• The Migration Service interacts directly with the database to ensure schema updates are applied automatically.
• Optionally, include a depiction of external dependencies (e.g., PostgreSQL from ‘sqlServer’ defined in the Aspire configuration).
Architectural Patterns
• DDD: Emphasize the separation between the Domain, Application, and Infrastructure layers.
• Microservices: Each “service” (like Booking.Api, Booking.MigrationService, and potential future services) should be graphically isolated but connected via the Aspire orchestration.
• Clean Architecture principles: Clearly separate concerns – for example, showing that business logic (Domain) is independent from external frameworks and delivery mechanisms (API).
Incorporate Relevant Technologies and Frameworks
• .NET 9 and EF Core for database migrations and ORM.
• Entity Framework Core specifics, such as migration scripts and configuration classes.
• .NET Aspire features for container orchestration, service discovery, and health monitoring.
• ASP.NET Core for the API layer.
• Use of Dependency Injection (DI) as seen in Program.cs files across microservices.