Skip to content
CAI
Software that uses CAICheck a score

meysamhadeli/booking-modular-monolith

58.4

Weak · 21 September 2026

11.6k

lines of production code

C#

primary language

4

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, aircraft, and passenger data, built on .NET 10 with Aspire for local development and observability. It implements a CQRS architecture using MediatR, separating write models via Entity Framework Core/PostgreSQL from read models in MongoDB. The application exposes public APIs and gRPC services to handle core domain logic, while enforcing code quality and commit standards through Husky and Commitlint.

How it got here

2022 — .NET 10 and Aspire migration

5 changes.

The project upgraded its target framework to .NET 10 and integrated Aspire for observability and hosting. This period established a modular monolith architecture by introducing CQRS, event sourcing, and shared infrastructure components within the BuildingBlocks layer.

2025 — CQRS and module implementation

7 changes.

This period focused on implementing core domain modules for Flight, Passenger, and Booking, utilizing a CQRS architecture with separate write and read models. The work included establishing gRPC clients, database configurations, and comprehensive test coverage, while also enforcing code quality standards through Husky and commit linting.

Features

Added Aspire AppHost and ServiceDefaults for local development and observability

The Aspire AppHost was introduced to define the local development environment, configuring infrastructure services including PostgreSQL, MongoDB, Redis, EventStore, RabbitMQ, Jaeger, Zipkin, the OpenTelemetry Collector, and Prometheus. Additionally, ServiceDefaults were added to provide standardized health checks, observability, service discovery, and HTTP resilience for all services.

src/Aspire · medium confidence

Added modular monolith architecture diagram

A new SVG diagram illustrating the 'booking-modular-monolith' architecture has been added to the assets folder. The diagram visualizes the system's structure, including an 'Identity Module' and other components, providing a visual reference for the project's design.

assets · high confidence

Adds CQRS, event sourcing, and caching building blocks

The BuildingBlocks layer introduces a comprehensive set of infrastructure components. It adds CQRS interfaces (ICommand, IQuery, and their handlers) to support the MediatR pipeline. It introduces an event-driven architecture with domain, integration, and internal command events, along with an EventDispatcher to route domain events to integration events and internal commands. Additionally, it provides a caching mechanism with CachingBehavior and InvalidateCachingBehavior for MediatR, as well as an EventStoreDB integration with aggregate event sourcing and background workers. The EF Core layer is expanded with an AppDbContextBase that handles soft deletes, audit fields, and transactional behavior, alongside database seeding and migration utilities.

src/BuildingBlocks · high confidence

Introduce CQRS-based APIs for managing flights, aircraft, airports, and seats

The Flight module now exposes a comprehensive set of new endpoints for creating, updating, deleting, and retrieving flights, aircraft, airports, and seats. Each feature is implemented using a Command/Query pattern with separate handlers for the write model (SQL/Entity Framework) and the read model (MongoDB), ensuring consistent data synchronization. Users can now create and manage flight schedules, aircraft details, airport information, and seat configurations through the public API, with validation rules and authorization checks applied at the endpoint level.

(repo-wide) · high confidence

Introduce Passenger module with EF Core, gRPC, and MongoDB read models

The Passenger module now includes a full data access layer using Entity Framework Core with PostgreSQL, featuring a \PassengerDbContext\ and a \PassengerReadDbContext\ for MongoDB. The module exposes a gRPC service to retrieve passenger details by ID and handles user registration events to create new passenger records. Additionally, integration tests have been added to verify the complete registration and retrieval workflows.

src/Modules/Passenger · high confidence

Introduce booking module with domain models, gRPC clients, and integration tests

The Booking module now includes core domain models (Booking, Trip, PassengerInfo) and value objects that validate flight and passenger details. The module registers gRPC clients for Flight and Passenger services with resilience (retry, circuit breaker, timeout) and maps domain events to integration events. A MongoDB-based read model and projection are added to store booking data, and the module is wired into the application via infrastructure extensions. Additionally, integration tests are added to verify the booking creation flow, including mocking gRPC responses for flight and passenger services.

src/Modules/Booking · high confidence

Introduce domain models, value objects, and database configurations for Flight, Aircraft, and Airport modules

The Flight module now includes the core domain models (Aircraft, Airport, Flight, Seat) along with their corresponding read models, value objects (e.g., AircraftId, Name, Model), and DTOs. This change adds the necessary data access layer, including Entity Framework Core configurations for the PostgreSQL database and MongoDB read models, enabling the system to persist and query flight-related data.

src/Modules/Flight · high confidence

Introduce modular monolith API entry point and shared infrastructure

The API project now includes a new Program.cs and SharedInfrastructureExtensions.cs that wire up the application's shared services, including JWT authentication, MassTransit for in-memory messaging, gRPC, EasyCaching, and observability (OpenTelemetry/Aspire). Configuration is provided via appsettings.json, which specifies PostgreSQL connection strings for Flight, Identity, and Passenger databases, alongside MongoDB, EventStore, and JWT settings. Development and test environments are configured with separate appsettings files, and a temporary RSA key is included for development.

src/Api/src · medium confidence

Upgrade to .NET 10 and introduce Aspire integration

The project has been upgraded to target .NET 10, as specified in the global.json SDK version and Directory.Build.props TargetFramework. Additionally, Aspire integrations have been added, including a new AppHost and ServiceDefaults projects within the src/Aspire directory, alongside corresponding solution structure updates.

(repo-wide) · high confidence

Behavioural changes

Enforce commit message and pre-commit formatting

The project now enforces commit message standards and code formatting. A new \.husky/commit-msg\ script runs \commitlint\ to validate commit messages, while the \.husky/pre-commit\ script executes \npm run format\ and \npm run ci-format\ to ensure consistent code style before commits.

.husky · medium confidence

Test coverage

Added unit tests for flight, aircraft, and airport creation and update logic

Added unit tests for the CreateAircraft, CreateAirport, and CreateFlight command handlers and validators, as well as domain logic for flight creation and updates. The new tests verify that valid commands create entities correctly, null commands throw exceptions, and domain events are queued appropriately.

(repo-wide) · high confidence

Dependencies

Initialize .NET 10 and Aspire 13.1.1 dependencies

The project dependencies have been updated to use .NET 10.0 and Aspire 13.1.1. This includes adding the Aspire hosting packages (Docker, MongoDB, PostgreSQL, RabbitMQ, Redis) and updating the core building blocks to target .NET 10.0, alongside standardizing test project dependencies on xUnit 2.9.3 and Microsoft.NET.Test.Sdk 18.0.1.

(dependencies) · high confidence

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

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 59 → 58 (-1.0)
  • Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 79 → 56 (-22.5)
  • Architecture 79 → 79 (-0.0)
  • Maturity 70 → 62 (-8.8)
  • Readiness 51 → 56 (+5.3)
  • Security 63 → 59 (-3.7)
  • Domain Modelling 76 → 81 (+4.7)
  • Event-Driven 82 → 82 (+0.0)
  • Performance 63 → 63 (+0.0)

Resolved (37)

  • Duplicated block (12 lines × 2) (src/BuildingBlocks/EFCore/AppDbContextBase.cs)
  • Duplicated block (16 lines × 3) (src/BuildingBlocks/EFCore/AppDbContextBase.cs)
  • Duplicated block (19 lines × 3) (src/BuildingBlocks/OpenTelemetryCollector/CoreDiagnostics/Commands/CommandHandlerMetrics.cs)
  • Duplicated block (19 lines × 3) (src/BuildingBlocks/OpenTelemetryCollector/CoreDiagnostics/Query/QueryHandlerMetrics.cs)
  • Duplicated block (19 lines × 3) (src/Modules/Flight/src/Data/EfTxFlightBehavior.cs)
  • Duplicated block (24 lines × 3) (src/BuildingBlocks/EFCore/AppDbContextBase.cs)
  • Duplicated block (9 lines × 2) (src/BuildingBlocks/PersistMessageProcessor/PersistMessageProcessor.cs)
  • Duplicated block (9 lines × 2) (src/Modules/Flight/src/Flights/Features/CreatingFlight/V1/CreateFlight.cs)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: MessagePack 2.5.192
  • High CVE: MessagePack 2.5.192
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Inconsistent naming for entity identifiers and common properties. Some entities use a specific suffix like 'AircraftId' or 'FlightId' for their primary key, while others use a generic 'Id' property. Similarly, audit properties are named 'CreatedBy' and 'CreatedAt' in one place, but 'Id' is used for keys in value objects while 'Id' is also used in read models. The inconsistency lies in the mix of specific vs generic naming for IDs and the lack of a unified pattern for audit fields (some use CreatedBy/CreatedAt, others might use different names or be missing).
  • Inconsistent naming for exception-related classes. 'CustomException' is a very generic name, while 'GrpcExceptionInterceptor' is more specific. The exception class should have a more descriptive name if it's not a base exception.
  • Inconsistent naming for test container instances. Some are named 'TestContainer' (method), while others are 'TestContainers' (class/namespace) or 'TestReadFixture'/'TestWriteFixture'. The naming for container options also varies between 'ImageName' and potentially other properties.
  • …and 17 more

New (219)

  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • …and 199 more

API surface

  • Unchanged — 1 HTTP endpoints

Written by watchdog.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 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 37104461815d230a1311f734664603ded7a94305 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.