# meysamhadeli/booking-modular-monolith architecture

> Architecture diagram of the GitHub repository meysamhadeli/booking-modular-monolith, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/meysamhadeli/booking-modular-monolith
- Repository: https://github.com/meysamhadeli/booking-modular-monolith

## Overview

1. **System shape**
   - This repository is a **modular monolith**: one deployable solution, but split into bounded-context modules with clear ownership boundaries.
   - The main business modules are **Identity**, **Flight**, **Passenger**, and **Booking**.

2. **Top-level runtime entry points**
   - `src/Api` is the primary **ASP.NET Core API host** exposed to clients.
   - `src/Aspire/src/AppHost` is a separate **local orchestration host** used to wire the services together during development and observability.
   - `deployments/docker-compose` provides the containerized runtime, including infrastructure dependencies.

3. **Request handling pattern**
   - The codebase follows **Vertical Slice Architecture** and **CQRS**.
   - Requests are organized per feature, not per technical layer: each use case has its own command/query, handler, validator, and endpoint surface.
   - API endpoints are intentionally thin and delegate to **MediatR** handlers.

4. **Shared platform layer**
   - `src/BuildingBlocks` is the common foundation used across modules.
   - It contains reusable infrastructure for:
     - CQRS abstractions
     - MediatR pipeline behaviors
     - validation
     - caching
     - logging
     - exception/problem-details handling
     - OpenTelemetry instrumentation
     - HTTP/JWT/OpenAPI helpers
     - MongoDB, EF Core, MassTransit, Polly, and health check wiring
   - This layer is the main architectural boundary that prevents modules from duplicating infrastructure code.

5. **Flight module**
   - `src/Modules/Flight` is the largest business module and models the flight domain.
   - It contains subdomains for **Aircrafts**, **Airports**, **Flights**, and **Seats**.
   - Each subdomain has its own feature slices, DTOs, value objects, exceptions, and mappings.
   - The module includes:
     - an **EF Core write model** (`FlightDbContext`)
     - a separate **read model** (`FlightReadDbContext`)
     - migrations and seeders
     - gRPC server implementation for internal access

6. **Passenger module**
   - `src/Modules/Passenger` manages passenger records and exposes its own feature slices.
   - It also uses a split between **write-side persistence** and **read-side persistence**.
   - The module includes a gRPC server and an integration path from the Identity module via event/consumer flow.
   - Its identity-related folder shows that passenger creation is partially driven by user-registration events.

7. **Booking module**
   - `src/Modules/Booking` is the booking bounded context.
   - It has a booking aggregate, projection/read model, and feature slice for creating bookings.
   - Supporting files such as `BookingProjection`, `BookingEventMapper`, and `BookingRoot` indicate it uses a more event-centric model than the CRUD-style modules.
   - The read model is separated from the domain/write model, consistent with CQRS and event-driven projection updates.

8. **Identity module**
   - `src/Modules/Identity` owns authentication and authorization concerns.
   - It combines **ASP.NET Identity**-style user/role data with **IdentityServer/Duende**-based auth infrastructure.
   - It exposes a registration use case and persistence model for users, roles, claims, logins, and tokens.
   - This module is the security boundary for the rest of the system.

9. **Cross-module communication**
   - The solution uses two main integration styles between modules:
     - **gRPC** for synchronous internal calls, especially where one module needs data from another.
     - **MassTransit** for asynchronous event-driven integration.
   - The Passenger module’s `Identity/Consumers` folder shows a concrete event consumer path from Identity/user registration into passenger creation.
   - Shared contract files under `BuildingBlocks/Contracts/EventBus.Messages` define message boundaries between modules.

10. **Persistence and data boundaries**
   - The architecture separates **write side** and **read side** storage in several modules.
   - EF Core is used for relational persistence; the README says the write side is based on **Postgres**.
   - MongoDB is used for read-side or denormalized views where appropriate.
   - `BuildingBlocks/EventStoreDB` supports event-store-backed workflows and projections, especially relevant to booking-style event evolution.

11. **Non-functional platform concerns**
   - Observability is a first-class subsystem:
     - **OpenTelemetry** for tracing/metrics
     - **Prometheus** and **Grafana** for metrics visualization
     - **Loki** for logs
     - **Tempo/Jaeger-style tracing** assets are included
   - Health checks, retries, and problem-details middleware are part of the shared runtime behavior.
   - The repo also includes Swagger/Scalar OpenAPI generation for API discovery.

12. **Deployment and local development**
   - `deployments/docker-compose` stands up the application with its infrastructure dependencies.
   - `src/Aspire` is used to orchestrate the app locally and provide a unified observability dashboard.
   - Grafana dashboards and provisioning files under `deployments/configs/grafana` show the intended production-like monitoring setup.

13. **Testing strategy**
   - Each module has its own test suite, commonly split into:
     - **unit tests**
     - **integration tests**
     - for Flight, **end-to-end tests**
   - The tests use **xUnit**, **Testcontainers**, and **Respawn** to exercise real infrastructure with isolated state.
   - The test layout mirrors the production feature slices, which makes the tests part of the architecture rather than an afterthought.

14. **How to draw the architecture**
   - A useful diagram would center on the **API host** and **Aspire host**, then show four bounded contexts behind it.
   - Draw **shared building blocks** as a horizontal foundation layer consumed by all modules.
   - Show **synchronous gRPC** links between modules where needed and **asynchronous event bus** links for cross-module reactions.
   - Separate **write models** from **read models** inside each module, and call out the specialized infrastructure: EF/Postgres, Mongo, EventStoreDB, and observability stack.

Main entry points: [`src/Modules/Flight/src/Flight.csproj`](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Flight.csproj) (Flight module), [`src/Modules/Identity/src/Identity.csproj`](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Identity/src/Identity.csproj) (Identity module), [`src/Modules/Booking/src/Booking.csproj`](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/Booking.csproj) (Booking module), [`src/Api/src/Program.cs`](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Api/src/Program.cs) (API host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_runtime["Runtime hosts"]
  node_api_host["API host<br/>ASP.NET Core host<br/>[Program.cs]"]
  node_aspire_host["AppHost<br/>Aspire orchestration<br/>[Program.cs]"]
end

subgraph group_grp_platform["Shared platform"]
  node_building_blocks["Building blocks<br/>shared foundation"]
  node_event_contracts["Event contracts<br/>shared messages<br/>[EventBus.Messages]"]
end

subgraph group_grp_identity["Identity"]
  node_identity_module["Identity module<br/>security bounded context<br/>[Identity.csproj]"]
  node_identity_api["Register user<br/>command slice<br/>[RegisterNewUser.cs]"]
  node_identity_model[("Users/roles<br/>relational model<br/>[User.cs]")]
  node_identity_db[("Identity DB<br/>EF Core/Postgres<br/>[IdentityContext.cs]")]
end

subgraph group_grp_passenger["Passenger"]
  node_passenger_module["Passenger module<br/>bounded context<br/>[Passenger.csproj]"]
  node_passenger_identity_consumer["User consumer<br/>MassTransit consumer<br/>[RegisterNewUser.cs]"]
  node_passenger_write[("Passenger write<br/>domain model<br/>[Passenger.cs]")]
  node_passenger_read[("Passenger read<br/>projection model")]
  node_passenger_grpc["Passenger gRPC<br/>internal service"]
end

subgraph group_grp_flight["Flight"]
  node_flight_module["Flight module<br/>bounded context<br/>[Flight.csproj]"]
  node_flight_flights["Flights<br/>feature slice<br/>[CreateFlight.cs]"]
  node_flight_aircrafts["Aircrafts<br/>feature slice<br/>[CreateAircraft.cs]"]
  node_flight_airports["Airports<br/>feature slice<br/>[CreateAirport.cs]"]
  node_flight_seats["Seats<br/>feature slice<br/>[ReserveSeat.cs]"]
  node_flight_write[("Flight write<br/>EF Core/Postgres<br/>[FlightDbContext.cs]")]
  node_flight_read[("Flight read<br/>Mongo projection")]
  node_flight_grpc["Flight gRPC<br/>internal service"]
end

subgraph group_grp_booking["Booking"]
  node_booking_module["Booking module<br/>bounded context<br/>[Booking.csproj]"]
  node_booking_create["Create booking<br/>command slice<br/>[CreateBooking.cs]"]
  node_booking_domain[("Booking model<br/>event-centric aggregate<br/>[Booking.cs]")]
  node_booking_read[("Booking read<br/>projection model")]
  node_booking_grpc_client["Booking gRPC client<br/>internal client<br/>[flight.proto]"]
end

subgraph group_grp_ops["Operations"]
  node_docker_compose["Docker compose<br/>container runtime"]
  node_grafana_stack["Observability<br/>metrics/logs/traces"]
end

node_api_host -->|"uses"| node_building_blocks
node_aspire_host -->|"uses"| node_building_blocks
node_api_host -->|"hosts"| node_identity_module
node_api_host -->|"hosts"| node_passenger_module
node_api_host -->|"hosts"| node_flight_module
node_api_host -->|"hosts"| node_booking_module
node_identity_module -->|"contains"| node_identity_api
node_identity_module -->|"owns"| node_identity_model
node_identity_module -->|"persists to"| node_identity_db
node_identity_module -.->|"publishes events to"| node_passenger_identity_consumer
node_passenger_module -->|"owns"| node_passenger_write
node_passenger_module -->|"projects to"| node_passenger_read
node_passenger_module -->|"serves"| node_passenger_grpc
node_passenger_identity_consumer -.->|"creates"| node_passenger_write
node_flight_module -->|"contains"| node_flight_flights
node_flight_module -->|"contains"| node_flight_aircrafts
node_flight_module -->|"contains"| node_flight_airports
node_flight_module -->|"contains"| node_flight_seats
node_flight_module -->|"persists to"| node_flight_write
node_flight_module -->|"projects to"| node_flight_read
node_flight_module -->|"serves"| node_flight_grpc
node_booking_module -->|"contains"| node_booking_create
node_booking_module -->|"owns"| node_booking_domain
node_booking_module -->|"projects to"| node_booking_read
node_booking_module -.->|"calls"| node_booking_grpc_client
node_booking_grpc_client -.->|"sync calls"| node_flight_grpc
node_booking_grpc_client -.->|"sync calls"| node_passenger_grpc
node_booking_module -.->|"consumes"| node_event_contracts
node_passenger_module -.->|"consumes"| node_event_contracts
node_identity_module -.->|"publishes"| node_event_contracts
node_flight_module -.->|"publishes"| node_event_contracts
node_aspire_host -.->|"complements"| node_docker_compose
node_docker_compose -->|"provisions"| node_grafana_stack

click node_api_host "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Api/src/Program.cs"
click node_aspire_host "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Aspire/src/AppHost/Program.cs"
click node_docker_compose "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/deployments/docker-compose/docker-compose.yaml"
click node_grafana_stack "https://github.com/meysamhadeli/booking-modular-monolith/tree/main/deployments/configs/grafana"
click node_building_blocks "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/BuildingBlocks/BuildingBlocks.csproj"
click node_event_contracts "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/BuildingBlocks/Contracts/EventBus.Messages"
click node_identity_module "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Identity/src/Identity.csproj"
click node_identity_api "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Identity/src/Identity/Features/RegisteringNewUser/V1/RegisterNewUser.cs"
click node_identity_model "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Identity/src/Identity/Models/User.cs"
click node_identity_db "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Identity/src/Data/IdentityContext.cs"
click node_passenger_module "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/Passenger.csproj"
click node_passenger_identity_consumer "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/Identity/Consumers/RegisteringNewUser/V1/RegisterNewUser.cs"
click node_passenger_write "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/Passengers/Models/Passenger.cs"
click node_passenger_read "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/Passengers/Models/PassengerReadModel.cs"
click node_passenger_grpc "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/GrpcServer/Services/PassengerGrpcServices.cs"
click node_flight_module "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Flight.csproj"
click node_flight_flights "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Flights/Features/CreatingFlight/V1/CreateFlight.cs"
click node_flight_aircrafts "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Aircrafts/Features/CreatingAircraft/V1/CreateAircraft.cs"
click node_flight_airports "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Airports/Features/CreatingAirport/V1/CreateAirport.cs"
click node_flight_seats "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Seats/Features/ReservingSeat/V1/ReserveSeat.cs"
click node_flight_write "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Data/FlightDbContext.cs"
click node_flight_read "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Data/FlightReadDbContext.cs"
click node_flight_grpc "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/GrpcServer/Services/FlightGrpcServices.cs"
click node_booking_module "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/Booking.csproj"
click node_booking_create "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/Booking/Features/CreatingBook/V1/CreateBooking.cs"
click node_booking_domain "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/Booking/Models/Booking.cs"
click node_booking_read "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/Booking/Models/BookingReadModel.cs"
click node_booking_grpc_client "https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/GrpcClient/Protos/flight.proto"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api_host,node_aspire_host,node_docker_compose,node_grafana_stack toneBlue
class node_building_blocks,node_event_contracts toneAmber
class node_identity_module,node_identity_api,node_identity_model,node_identity_db toneMint
class node_passenger_module,node_passenger_identity_consumer,node_passenger_write,node_passenger_read,node_passenger_grpc toneRose
class node_flight_module,node_flight_flights,node_flight_aircrafts,node_flight_airports,node_flight_seats,node_flight_write,node_flight_read,node_flight_grpc toneIndigo
class node_booking_module,node_booking_create,node_booking_domain,node_booking_read,node_booking_grpc_client toneTeal
```

## Components

### Runtime hosts

Entry points that host or orchestrate the modular monolith.

- [API host](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Api/src/Program.cs): ASP.NET Core host · Primary client-facing application entry point. · `src/Api/src/Program.cs`
- [AppHost](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Aspire/src/AppHost/Program.cs): Aspire orchestration · Local development host that wires services and observability together. · `src/Aspire/src/AppHost/Program.cs`

### Shared platform

Cross-cutting building blocks reused by all modules.

- [Building blocks](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/BuildingBlocks/BuildingBlocks.csproj): shared foundation · Common CQRS, validation, logging, telemetry, persistence, web, and integration helpers. · `src/BuildingBlocks/BuildingBlocks.csproj`
- [Event contracts](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/BuildingBlocks/Contracts/EventBus.Messages): shared messages · Cross-module integration message boundaries. · `src/BuildingBlocks/Contracts/EventBus.Messages`

### Identity

Authentication and authorization bounded context.

- [Identity module](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Identity/src/Identity.csproj): security bounded context · Owns users, roles, tokens, registration, and auth infrastructure. · `src/Modules/Identity/src/Identity.csproj`
- [Register user](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Identity/src/Identity/Features/RegisteringNewUser/V1/RegisterNewUser.cs): command slice · Registration use case surface for new users. · `src/Modules/Identity/src/Identity/Features/RegisteringNewUser/V1/RegisterNewUser.cs`
- [Users/roles](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Identity/src/Identity/Models/User.cs): relational model · Identity persistence model for users, roles, claims, logins, and tokens. · `src/Modules/Identity/src/Identity/Models/User.cs`
- [Identity DB](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Identity/src/Data/IdentityContext.cs): EF Core/Postgres · Identity write-side database and migrations. · `src/Modules/Identity/src/Data/IdentityContext.cs`

### Passenger

Passenger bounded context and its integration flow.

- [Passenger module](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/Passenger.csproj): bounded context · Manages passenger records and registration completion. · `src/Modules/Passenger/src/Passenger.csproj`
- [User consumer](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/Identity/Consumers/RegisteringNewUser/V1/RegisterNewUser.cs): MassTransit consumer · Consumes identity registration events to initiate passenger creation. · `src/Modules/Passenger/src/Identity/Consumers/RegisteringNewUser/V1/RegisterNewUser.cs`
- [Passenger write](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/Passengers/Models/Passenger.cs): domain model · Passenger aggregate and write-side persistence. · `src/Modules/Passenger/src/Passengers/Models/Passenger.cs`
- [Passenger read](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/Passengers/Models/PassengerReadModel.cs): projection model · Passenger read-side persistence for queries. · `src/Modules/Passenger/src/Passengers/Models/PassengerReadModel.cs`
- [Passenger gRPC](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Passenger/src/GrpcServer/Services/PassengerGrpcServices.cs): internal service · Synchronous internal access surface for passenger data. · `src/Modules/Passenger/src/GrpcServer/Services/PassengerGrpcServices.cs`

### Flight

Flight bounded context with multiple subdomains and dual models.

- [Flight module](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Flight.csproj): bounded context · Largest domain module covering aircrafts, airports, flights, and seats. · `src/Modules/Flight/src/Flight.csproj`
- [Flights](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Flights/Features/CreatingFlight/V1/CreateFlight.cs): feature slice · Flight lifecycle use cases and domain model. · `src/Modules/Flight/src/Flights/Features/CreatingFlight/V1/CreateFlight.cs`
- [Aircrafts](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Aircrafts/Features/CreatingAircraft/V1/CreateAircraft.cs): feature slice · Aircraft management features and write/read models. · `src/Modules/Flight/src/Aircrafts/Features/CreatingAircraft/V1/CreateAircraft.cs`
- [Airports](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Airports/Features/CreatingAirport/V1/CreateAirport.cs): feature slice · Airport management features and write/read models. · `src/Modules/Flight/src/Airports/Features/CreatingAirport/V1/CreateAirport.cs`
- [Seats](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Seats/Features/ReservingSeat/V1/ReserveSeat.cs): feature slice · Seat creation, availability, and reservation use cases. · `src/Modules/Flight/src/Seats/Features/ReservingSeat/V1/ReserveSeat.cs`
- [Flight write](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Data/FlightDbContext.cs): EF Core/Postgres · Flight domain write database and transactional persistence. · `src/Modules/Flight/src/Data/FlightDbContext.cs`
- [Flight read](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/Data/FlightReadDbContext.cs): Mongo projection · Flight read-side database and denormalized views. · `src/Modules/Flight/src/Data/FlightReadDbContext.cs`
- [Flight gRPC](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Flight/src/GrpcServer/Services/FlightGrpcServices.cs): internal service · Synchronous internal access surface for flight data. · `src/Modules/Flight/src/GrpcServer/Services/FlightGrpcServices.cs`

### Booking

Booking bounded context centered on reservation creation and projections.

- [Booking module](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/Booking.csproj): bounded context · Reservation creation and event-centric booking model. · `src/Modules/Booking/src/Booking.csproj`
- [Create booking](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/Booking/Features/CreatingBook/V1/CreateBooking.cs): command slice · Feature slice for creating reservations/bookings. · `src/Modules/Booking/src/Booking/Features/CreatingBook/V1/CreateBooking.cs`
- [Booking model](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/Booking/Models/Booking.cs): event-centric aggregate · Booking aggregate, root, and projection mapping. · `src/Modules/Booking/src/Booking/Models/Booking.cs`
- [Booking read](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/Booking/Models/BookingReadModel.cs): projection model · Separated read model for booking queries. · `src/Modules/Booking/src/Booking/Models/BookingReadModel.cs`
- [Booking gRPC client](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/src/Modules/Booking/src/GrpcClient/Protos/flight.proto): internal client · Calls flight and passenger services synchronously for booking workflows. · `src/Modules/Booking/src/GrpcClient/Protos/flight.proto`

### Operations

Deployment, orchestration, and observability stack.

- [Docker compose](https://github.com/meysamhadeli/booking-modular-monolith/blob/main/deployments/docker-compose/docker-compose.yaml): container runtime · Containerized application and infrastructure bootstrap. · `deployments/docker-compose/docker-compose.yaml`
- [Observability](https://github.com/meysamhadeli/booking-modular-monolith/tree/main/deployments/configs/grafana): metrics/logs/traces · Provisioned dashboards and telemetry backends for runtime visibility. · `deployments/configs/grafana`

## Connections

- API host → Building blocks: uses · API host composes shared pipeline, web, telemetry, and persistence helpers.
- AppHost → Building blocks: uses · Aspire host relies on shared service defaults and observability wiring.
- API host → Identity module: hosts · API exposes identity endpoints and module services.
- API host → Passenger module: hosts · API exposes passenger endpoints and module services.
- API host → Flight module: hosts · API exposes flight endpoints and module services.
- API host → Booking module: hosts · API exposes booking endpoints and module services.
- Identity module → Register user: contains · Identity module centers on the registration slice.
- Identity module → Users/roles: owns · Identity owns user and role persistence.
- Identity module → Identity DB: persists to · Identity uses EF Core-backed relational storage.
- Identity module → User consumer: publishes events to · Identity registration emits integration events consumed by passenger.
- Passenger module → Passenger write: owns · Passenger maintains the write-side aggregate.
- Passenger module → Passenger read: projects to · Passenger keeps a separate read model.
- Passenger module → Passenger gRPC: serves · Passenger exposes internal synchronous access via gRPC.
- User consumer → Passenger write: creates · Registration consumer drives passenger creation flow.
- Flight module → Flights: contains · Flights is one of the core flight subdomains.
- Flight module → Aircrafts: contains · Aircrafts is one of the core flight subdomains.
- Flight module → Airports: contains · Airports is one of the core flight subdomains.
- Flight module → Seats: contains · Seats is one of the core flight subdomains.
- Flight module → Flight write: persists to · Flight write-side uses EF Core relational storage.
- Flight module → Flight read: projects to · Flight maintains a separate read-side store.
- Flight module → Flight gRPC: serves · Flight exposes internal synchronous access via gRPC.
- Booking module → Create booking: contains · Booking is centered on the create-reservation slice.
- Booking module → Booking model: owns · Booking uses an event-centric aggregate and projections.
- Booking module → Booking read: projects to · Booking separates query storage from the domain model.
- Booking module → Booking gRPC client: calls · Booking depends on flight and passenger data via gRPC.
- Booking gRPC client → Flight gRPC: sync calls · Booking queries flight capabilities synchronously.
- Booking gRPC client → Passenger gRPC: sync calls · Booking queries passenger capabilities synchronously.
- Booking module → Event contracts: consumes · Booking participates in shared integration contracts.
- Passenger module → Event contracts: consumes · Passenger consumes shared bus messages.
- Identity module → Event contracts: publishes · Identity emits user-registration integration messages.
- Flight module → Event contracts: publishes · Flight emits domain/integration messages for other modules.
- AppHost → Docker compose: complements · Aspire and compose provide local orchestration paths.
- Docker compose → Observability: provisions · Compose brings up telemetry and monitoring dependencies.
