How oguzhantomak/hotelguide works
Main Components
• HotelManagementService:
• API Layer: Represents the HTTP endpoints (see the API project under HotelManagementService.API).
• Business/Application Layer: Contains the use-case logic, DTOs, services, validators, and exceptions.
• Domain Layer: Houses core business entities like Hotel, ContactInformation, and domain events (e.g., HotelCreatedEvent).
• Infrastructure Layer: Deals with data access via Entity Framework Core and repositories.
• ReportService:
• API Layer: Exposes endpoints (e.g., ReportController, WeatherForecastController).
• Business/Application Layer: Contains DTOs for reports, service classes, domain events (e.g., ReportCreatedEvent), and messaging interfaces.
• Domain Layer: Contains key report entities, value objects, and related domain logic.
• Infrastructure Layer: Integrates with external dependencies like MongoDB for report storage, HTTP clients (for hotel management data), and RabbitMQ for messaging.
• Cross-Service/Additional Components:
• RabbitMQ: Used for event-driven communication. HotelManagementService emits events (such as when a hotel is created) that ReportService subscribes to.
• Databases:
• SQL (or equivalent through Entity Framework Core) for HotelManagementService.
• MongoDB for ReportService storage.
• Docker & Docker Compose: Indicates containerization and orchestration for both services, supporting deployment isolation.
And Reflect the Layered Architecture
• Microservice with its four distinct layers:
• Domain, Application, Infrastructure, and API.
• That within each microservice, the relationships between these layers are clearly expressed. For example, the API layer delegates requests to the Application layer, which in turn utilizes the Domain and Infrastructure layers.
• From HotelManagementService API to its Domain (e.g., creating a Hotel entity).
• From the Application/Domain layers of HotelManagementService to the Infrastructure layer (repository accessing the database).
• Outbound event emission from HotelManagementService to RabbitMQ.
• Flow from ReportService to MongoDB for persisting reports.
Architectural Patterns
• Domain-Driven Design:
• How Aggregate Roots (Hotel, Report) reside in the Domain layer.
• Value Objects (e.g., Address or ContactType) as part of the Domain.
• Domain Events (HotelCreatedEvent, ReportCreatedEvent) and the decoupling they bring.
• Clean Architecture:
• Separation of concerns by illustrating the four layers.
• Dependency inversion where the higher-level layers depend on abstractions defined in the Domain and Application layers.
• Event-Driven:
• RabbitMQ component and its role in decoupling reporting updates.
Final Touches
• Verify that every component from the file tree that plays a role in the architecture is represented (even if not every file needs to be drawn: focus on conceptual components like Controllers, Services, Repositories, Domain Entities).