Skip to content
CAI
Software that uses CAICheck a score

meysamhadeli/booking-modular-monolith

65.7

Weak · 8 November 2026

5.5k

lines of production code

C#

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a modular monolith for managing flight operations, encompassing core capabilities for handling flights, passengers, user identity, and flight bookings. It employs a dual-storage architecture, using PostgreSQL for authoritative write models and MongoDB for optimized read models, while leveraging event sourcing within the Booking module. The application exposes functionality through REST and gRPC APIs, integrating external services with resilience patterns and supporting local development via .NET Aspire orchestration.

How it got here

2022 — Modular monolith scaffolding with .NET 10 and Aspire

4 changes.

The project was initialized as a modular monolith targeting .NET 10, integrating .NET Aspire for orchestration and distributed observability. The architecture was structured around a central API and distinct modules (Booking, Flight, Identity, Passenger) utilizing technologies like gRPC, Wolverine, and PostgreSQL. Documentation and visual diagrams were updated to reflect this new vertical slice and modular design.

2025–2026 — Core module implementation and infrastructure setup

12 changes.

This period focused on establishing the foundational domain modules for Flights, Bookings, Passengers, and Identity, implementing their respective data models, validation logic, and dual-storage architectures. Concurrently, the project configured the local development environment using Aspire and integrated essential infrastructure services like PostgreSQL, MongoDB, and EventStoreDB. The work also included enforcing code quality standards through commit linting and adding initial unit tests to verify core business rules.

Features

Identity module database schema and configuration established

The Identity module now includes its foundational data layer, introducing an Entity Framework Core context backed by PostgreSQL with snake\_case table naming. This change adds initial database migrations that create the standard ASP.NET Identity tables (Users, Roles, Claims, Logins, Tokens) and applies specific constraints: first and last names are limited to 50 characters, and the passport number is restricted to 10 characters to align with the Passenger module. The configuration also defines Duende IdentityServer resources, including API scopes for Flight, Passenger, Booking, and Identity APIs, and sets up a Resource Owner Password Credentials client for authentication.

src/Modules/Identity, src/Modules/Identity/src/Identity/Features/RegisteringNewUser · high confidence

Initial Booking module implementation with event-sourced architecture

The Booking module is introduced, providing the capability to create flight reservations. It implements an event-sourcing pattern using EventStoreDB for the write model and MongoDB for the read model, projecting domain events into a \BookingReadModel\. The module exposes a minimal API endpoint to create bookings, which triggers a \BookingCreated\ domain event. It integrates with external Flight and Passenger services via gRPC clients, featuring resilience policies (retry, circuit breaker, timeout) and configuration options for service addresses. The implementation includes specific domain exceptions for validation errors (e.g., invalid flight date, seat number), DTOs for request/response mapping, and integration tests that mock the gRPC dependencies to verify the booking creation flow.

src/Modules/Booking · high confidence

Initial Flight module scaffolding with read/write data models

The Flight module now includes the foundational data layer for managing aircraft, airports, flights, and seats. This change introduces Entity Framework Core write-model configurations and PostgreSQL migrations for the core domain entities, alongside MongoDB read-model definitions and Mapster mappings to support a CQRS-style data access pattern. It also provides a data seeder to populate initial reference data for airports, aircraft, and flights upon startup.

src/Modules/Flight · high confidence

Initial Passenger module with read/write database separation and gRPC access

The Passenger module is introduced, providing the ability to manage passenger records through a dual-storage architecture: a PostgreSQL database for write operations (managed via Entity Framework Core migrations and a \PassengerDbContext\) and a MongoDB store for read operations (via \PassengerReadDbContext\). The module exposes a gRPC service (\PassengerGrpcService\) that allows clients to retrieve passenger details by ID. It also includes infrastructure for handling user registration events, automatically creating passenger records when a new user is registered, and utilizes a MediatR pipeline behavior to ensure database transactions are committed alongside domain events.

src/Modules/Passenger · high confidence

Initial implementation of Flight module CRUD operations

This change introduces the core Flight module, providing the ability to create, read, update, and delete flights, as well as manage associated aircraft, airports, and seats. It exposes a set of V1 API endpoints (e.g., POST /flight, GET /flight/{id}) that handle flight lifecycle management, including validation for flight status, pricing, and seat class. The implementation supports a dual-storage architecture: it writes to a relational database (via EF Core) for authoritative state and synchronizes to a MongoDB read-model for query performance. Additionally, it includes a booking feature that allows users to create bookings by reserving seats on available flights, integrating with external flight and passenger services via gRPC.

(repo-wide) · high confidence

Introduce Aspire AppHost for local development orchestration

This change adds the Aspire AppHost project (\src/Aspire/src/AppHost\), which configures the local development environment by orchestrating infrastructure services including PostgreSQL, MongoDB, Redis, EventStore, RabbitMQ, and observability tools (Jaeger, Zipkin, OpenTelemetry Collector, Prometheus). It also introduces a \ServiceDefaults\ library that registers shared health checks, OpenTelemetry observability, service discovery, and standard HTTP resilience policies for the application services.

src/Aspire · high confidence

Introduce Booking domain model with validation-enforced value objects

The Booking module now includes the core domain entities required to represent a booking. The \Booking\ aggregate root manages the lifecycle of a booking by applying a \BookingCreatedDomainEvent\, ensuring the booking ID and associated data are persisted correctly. It relies on two new value objects: \PassengerInfo\, which validates that the passenger name is not null or whitespace, and \Trip\, which enforces strict validation on flight details including flight number, aircraft ID, departure/arrival airport IDs, flight date, price, and seat number. These changes establish the foundational data structures and integrity checks for the booking feature.

Booking.Booking · high confidence

Introduce Flight domain model and value objects

The Flights module now includes the core domain model for flights, defined by a new \Flight\ aggregate record and associated value objects (\FlightId\, \FlightNumber\, \AircraftId\, \AirportId\, \DurationMinutes\, \Price\, \ArriveDate\, \DepartureDate\, \FlightDate\). This change establishes the data structure and validation logic for creating, updating, and deleting flights, including the emission of corresponding domain events.

Flights · high confidence

Behavioural changes

Enforced commit message linting and code formatting on commit

The project now automatically validates commit messages against conventional commit standards and formats code before every commit. A new commit-msg hook runs commitlint to ensure message structure, while a pre-commit hook executes formatting scripts to maintain consistent code style.

.husky · high confidence

Introduce modular monolith API with Griffin framework and Aspire observability

The API entry point and shared infrastructure have been restructured to use the Griffin framework, integrating JWT authentication, gRPC, EasyCaching, and Wolverine for message handling. The application now supports Aspire integration for distributed observability, including OpenTelemetry and dashboard endpoints, and is configured to connect to PostgreSQL databases for flight, identity, and passenger modules.

src/Api/src · high confidence

Upgrade to .NET 10 and introduce Aspire orchestration

The application has been upgraded to target .NET 10, requiring the .NET 10 SDK (version 10.0.103) to build and run. This update includes a comprehensive set of library upgrades to their .NET 10-compatible versions, such as Microsoft.EntityFrameworkCore, Duende.IdentityServer, and Microsoft.Extensions.Http.Resilience. Additionally, the project now integrates .NET Aspire for local service discovery and orchestration, adding an AppHost and ServiceDefaults project to the solution structure.

(repo-wide) · high confidence

Test coverage

Added unit tests for Flight module create operations; Added unit tests for RegisterNewUserValidator.

Dependencies

Added BuildingBlocks submodule

The src directory now includes a new git submodule named BuildingBlocks, initialized at commit d088133. This integrates external shared code into the project structure.

src · high confidence

Initial project scaffolding with .NET 10 and Aspire integration

The repository has been initialized with a new modular monolith structure for the 'booking-modular-monolith' application. The solution targets .NET 10.0 and integrates Microsoft Aspire (version 13.1.1) for hosting and service defaults, including support for Docker, MongoDB, PostgreSQL, RabbitMQ, Redis, EventStore, and Elasticsearch. The architecture is split into an Api project and four modules (Booking, Flight, Identity, Passenger), with the Flight and Passenger modules utilizing gRPC. Development tooling includes Husky and Commitlint for Git hooks, and the test projects use xUnit and Microsoft.NET.Test.Sdk.

(dependencies) · high confidence

Housekeeping

Updated project documentation assets and diagrams

The project's visual documentation has been refreshed, including updates to the README diagrams and the addition of new or updated logos. Architectural diagrams illustrating the booking modular monolith and vertical slice architecture have also been modified to reflect current project structures.

assets · high confidence · unverified

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 66 → 66 (-0.3)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 60 → 60 (-0.0)
  • Architecture 82 → 82 (-0.1)
  • Maturity 71 → 73 (+2.8)
  • Readiness 69 → 69 (+0.0)
  • Security 66 → 64 (-1.8)
  • Domain Modelling 100 → 100 (+0.0)
  • Performance 100 → 100 (+0.0)

Resolved (9)

  • Coverage not measured — no coverage collector is wired up
  • Projects may be oversized for their cohesion
  • Typo in exception name: 'FlightNotFountException' is missing the 'u' in 'Found'. It should be 'FlightNotFoundException' to match standard English spelling and the pattern of other exception names like 'FlightAlreadyExistException'.
  • XML-doc coverage: Api (src/Api/src/Api.csproj)
  • XML-doc coverage: Booking (src/Modules/Booking/src/Booking.csproj)
  • XML-doc coverage: Flight (src/Modules/Flight/src/Flight.csproj)
  • XML-doc coverage: Identity (src/Modules/Identity/src/Identity.csproj)
  • XML-doc coverage: Passenger (src/Modules/Passenger/src/Passenger.csproj)
  • XML-doc coverage: ServiceDefaults (src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj)

New (2)

  • Projects may be oversized for their cohesion (src/Modules/Flight/src/Flight.csproj)
  • top-level statements (cyclomatic 16) (src/Aspire/src/AppHost/Program.cs)

API surface

  • Unchanged — 1 HTTP endpoints

Architecture

  • Unchanged — 4 containers · 6 contexts · 3 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

meysamhadeli/booking-modular-monolith was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 8 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 58162f7bb6add6d277550bac1ff10b89b5c90898 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-45ab2cab63de.