Skip to content
CAI
Software that uses CAICheck a score

meysamhadeli/booking-microservices-nestjs

56.0

Adequate · 21 September 2026

6.6k

lines of production code

TypeScript

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a microservices-based application for managing flight bookings, comprising distinct services for identity, flight, passenger, and booking management. It leverages NestJS for service implementation, TypeORM for database interactions, and RabbitMQ for asynchronous event-driven communication between services. The architecture includes shared building blocks for configuration, error handling, and observability via OpenTelemetry and Prometheus.

Features

Add booking service with create-booking feature

Introduced a new booking service in the \src/booking\ module, featuring a \CreateBooking\ endpoint at \/booking/v1/booking/create\. The implementation includes a NestJS module wiring up CQRS, TypeORM, and RabbitMQ, along with a \Booking\ entity and DTO. The core logic validates the request, fetches flight and passenger data via HTTP clients (\FlightClient\, \PassengerClient\), reserves a seat, persists the booking, and publishes a \BookingCreated\ event to RabbitMQ. A \Mapper\ class handles mapping between the domain entity and DTO.

src/booking/src/booking · high confidence

Add flight and seat management APIs

Introduced new API endpoints for managing flights and seats. Users can now create, retrieve, and reserve seats, as well as create and retrieve flight details. The changes include new controllers and handlers for creating and fetching flights, and for creating, fetching, and reserving seats, all secured with JWT authentication.

src/flight/src/flight/features/v1, src/flight/src/seat/features/v1 · high confidence

Add observability stack configuration for PostgreSQL monitoring

Added configuration files for a new PostgreSQL monitoring dashboard in Grafana, along with provisioning and datasource configurations for Prometheus, Loki, Tempo, and the OpenTelemetry Collector. This enables users to visualize PostgreSQL metrics and integrate distributed tracing and logging into the existing infrastructure.

deployments · high confidence

Add shared building blocks for configuration, context, contracts, and error handling

Introduces a new \src/building-blocks\ module containing shared infrastructure: a centralized configuration loader (\configs\) that validates environment variables for Postgres, RabbitMQ, JWT, and OpenTelemetry; an \HttpContext\ middleware to store request/response headers; domain-specific event contracts (e.g., \BookingCreated\, \FlightCreated\, \UserCreated\) and DTOs; and a global \ErrorHandlersFilter\ that maps NestJS exceptions to HTTP problem details. These changes provide reusable, standardized patterns for configuration, request context, and error handling across services.

src/building-blocks · high confidence

Added architecture diagrams for microservices and vertical slice patterns

Two new Excalidraw diagram files were added to the assets folder: a microservices architecture diagram and a vertical-slice architecture diagram. These visual aids provide a clearer understanding of the system's structure and design patterns.

assets · high confidence

Added configuration and build infrastructure for the booking service

The booking service now includes environment configuration files (.env.development, .env.docker) defining service ports, database, RabbitMQ, and OpenTelemetry settings. A Dockerfile is added to support containerized builds and runs, while TypeScript, ESLint, Prettier, and NestJS configuration files establish the development and build environment for the service.

src/booking · high confidence

Added contribution guidelines and API testing resources

The repository now includes a CONTRIBUTION.md file that outlines the project's contribution workflow, including the requirement to open an issue before submitting a pull request and adherence to the Conventional Commits specification. Additionally, a booking.rest file has been added to provide a ready-to-use collection of HTTP requests for testing the Identity and Flight microservices, alongside an updated .gitignore to better handle IDE and build artifacts.

(repo-wide) · high confidence

Added create endpoints for Aircraft and Airport entities

New API endpoints have been introduced to create Aircraft and Airport records. The Aircraft creation endpoint accepts model, name, and manufacturingYear, while the Airport creation endpoint accepts code, name, and address. Both endpoints enforce unique name constraints, validate input using Joi schemas, and publish domain events (AircraftCreated/AirportCreated) via RabbitMQ upon successful creation.

src/flight/src/aircraft/features/v1, src/flight/src/airport/features/v1 · high confidence

Added initial database schema for user and token tables

A new TypeORM migration was added to the identity module, creating the 'user' and 'token' tables along with a user role enum. This establishes the foundational database structure for user accounts and authentication tokens.

src/identity/src/data/migrations · high confidence

Added passenger retrieval endpoints for v1 API

Introduced two new query endpoints for the v1 passenger API: one to retrieve a single passenger by ID and another to list all passengers with pagination, sorting, and search capabilities. Both endpoints are protected by JWT authentication and return structured DTOs, enabling clients to fetch individual or paginated lists of passenger records.

src/passenger/src/passenger/features/v1 · high confidence

Added v1 authentication endpoints for login, logout, token refresh, and token validation

The identity service now exposes a complete v1 authentication flow. Users can log in with email and password to receive access and refresh tokens, refresh expired access tokens using a valid refresh token, explicitly log out to invalidate an access token, and validate tokens against the repository. These new controllers and command handlers implement the core identity management capabilities for version 1 of the API.

src/identity/src/auth/features/v1 · high confidence

Identity service bootstraps with OpenTelemetry, Swagger, and Prometheus metrics

The identity service now initializes with full observability and documentation support. It integrates OpenTelemetry for tracing and logging, exposes a Prometheus metrics endpoint, and generates a Swagger API documentation page at /swagger. The application also configures global validation pipes, versioning, and a health-check route that returns the service name.

src/identity/src · high confidence

Identity service scaffolding and configuration

The identity service is now fully configured for development, Docker, and testing environments, including environment variables for PostgreSQL, RabbitMQ, and OpenTelemetry. The service includes a data seeder that creates an initial admin user, and provides repository implementations for managing users and authentication tokens. Configuration files for TypeScript, ESLint, Prettier, and NestJS are also added to support the service's build and linting processes.

src/identity · high confidence

Initial flight service implementation with database and domain models

The flight service now includes the core domain models and data access layer for Aircraft, Airport, Flight, and Seat, each with corresponding DTOs, TypeORM entities, and repository implementations. A database migration script creates the corresponding tables and relationships, and a data seeder populates initial records. The application module wires these modules together, configures TypeORM with manual migration support, and sets up routing, OpenTelemetry, and Swagger documentation.

src/flight/src · high confidence

Introduce new AuthModule and token mapping for identity service

A new AuthModule is added to the identity service, wiring together controllers and handlers for login, logout, and token refresh/generation/validation, along with repositories for tokens and users. Additionally, a new mapping is introduced to convert Token entities to TokenDto objects, ensuring correct data transfer between layers.

src/identity/src/auth · medium confidence

Introduce passenger management and user creation via RabbitMQ

Added a new passenger domain including the Passenger entity, DTO, and type enum, along with a mapper for data transformation. The passenger module now exposes controllers and handlers for retrieving passengers and consumes a 'UserCreated' event from RabbitMQ to automatically create a new passenger record when a user is created.

src/passenger/src/passenger · high confidence

Introduce the Booking service entry point and module configuration

The Booking service is now bootstrapped with a NestJS application module that configures core infrastructure: it registers TypeORM for PostgreSQL, sets up JWT authentication via Passport, enables OpenTelemetry for observability, and registers the BookingModule at the root path. The main entry point configures global prefixes, API versioning, Swagger documentation, validation, error handling, Prometheus metrics, and a root route that returns the service name.

src/booking/src · high confidence

Introduce user management API endpoints

The identity service now exposes a new v1 user management API. Users can create, retrieve (by ID or paginated list), update, and delete user accounts. The implementation includes a User entity with role-based access (USer/ADMIN), DTOs for data transfer, and a mapping layer. The API is protected by JWT authentication and publishes events (UserCreated, UserUpdated, UserDeleted) via RabbitMQ.

src/identity/src/user · high confidence

Introduces TypeORM-based data layer for the passenger service

The passenger service now uses TypeORM for database interactions, replacing any previous approach. A new data-source configuration connects to PostgreSQL, and a migration script creates the 'passenger' table with fields for name, passport number, age, and passenger type. A repository class provides methods to create passengers, find by ID, and list passengers with pagination and search capabilities.

src/passenger/src/data · high confidence

Launch passenger service with OpenTelemetry, Swagger, and Prometheus metrics

The passenger service is now available, bootstrapped via a new \AppModule\ and \main.ts\ entry point. It integrates OpenTelemetry for observability, Swagger for API documentation, and Prometheus for metrics. The service runs on port 3355, uses URI-based versioning, and applies global error handling and validation pipes.

src/passenger/src · high confidence

Behavioural changes

Introduces TypeORM migration-based database configuration

The identity service now uses a dedicated data-source configuration for PostgreSQL that enables explicit migration management. This change replaces automatic table synchronization with a migration-based approach, allowing database schema changes to be tracked and applied via standard TypeORM commands. Users can now generate new migration files and apply them to the database, ensuring consistent schema state across environments.

src/identity/src/data · medium confidence

Introduces TypeORM-based database layer with manual migrations

The booking service now uses TypeORM for data persistence, replacing the previous approach with a dedicated data-source configuration and a manual migration file to create the 'booking' table. A new BookingRepository is provided to handle database interactions, and a readme file documents the migration commands for generating and running database schema updates.

src/booking/src/data · medium confidence

Test coverage

Added end-to-end, integration, and unit tests for the user creation flow

New test files and supporting fixtures have been added to the identity service to cover the user creation feature. This includes an end-to-end test verifying the HTTP endpoint, an integration test checking database and message queue interactions, and a unit test mocking dependencies for the command handler. Supporting test utilities, such as fake data generators and test fixtures for Postgres and RabbitMQ, were also introduced to facilitate these tests.

src/identity/test · high confidence

Dependencies

Added package.json manifests for five new services and a shared building-blocks library

The diff introduces five new \package.json\ files for the \booking\, \flight\, \identity\, and \passenger\ services, each configured with NestJS 10.4.x, TypeORM, and related dependencies. A sixth manifest is added for the \building-blocks\ shared library, which includes OpenTelemetry packages (v0.203.0/2.0.1) and other utilities. These changes establish the dependency structure for the new microservices and shared codebase.

(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 33 → 56 (+23.2)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 80 → 84 (+4.5)
  • Architecture 79 → 84 (+4.6)
  • Maturity 64 → 66 (+2.1)
  • Readiness 31 → 36 (+4.9)
  • Security 80 → 80 (-0.1)

Resolved (14)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — no supported dependency manifest was read
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium IaC: CKV_DOCKER_3 (src/booking/Dockerfile)
  • Medium IaC: CKV_DOCKER_3 (src/flight/Dockerfile)
  • Medium IaC: CKV_DOCKER_3 (src/identity/Dockerfile)
  • Medium IaC: CKV_DOCKER_3 (src/passenger/Dockerfile)
  • No exposed public API
  • Scanner failed to run — not a clean result
  • Secret: jwt (booking.rest)
  • Secret: jwt (booking.rest)
  • Test reliability not included
  • dormant codebase — no living knowledge left to concentrate

New (30)

  • Coverage not measured — JavaScript/TypeScript suite
  • Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no committed lockfile, so no resolved version to grade)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • High IaC: WD-COMPOSE-0002 (deployments/docker-compose/docker-compose.yaml)
  • High IaC: WD-COMPOSE-0002 (deployments/docker-compose/docker-compose.yaml)
  • High IaC: WD-COMPOSE-0002 (deployments/docker-compose/docker-compose.yaml)
  • High IaC: WD-COMPOSE-0002 (deployments/docker-compose/docker-compose.yaml)
  • High IaC: WD-COMPOSE-0002 (deployments/docker-compose/docker-compose.yaml)
  • High IaC: WD-COMPOSE-0002 (deployments/docker-compose/docker-compose.yaml)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium IaC: WD-COMPOSE-0002 (deployments/docker-compose/docker-compose.yaml)
  • Medium IaC: WD-DOCKER-0003 (src/booking/Dockerfile)
  • Medium IaC: WD-DOCKER-0003 (src/booking/Dockerfile)
  • Medium IaC: WD-DOCKER-0003 (src/flight/Dockerfile)
  • Medium IaC: WD-DOCKER-0003 (src/flight/Dockerfile)
  • Medium IaC: WD-DOCKER-0003 (src/identity/Dockerfile)
  • Medium IaC: WD-DOCKER-0003 (src/identity/Dockerfile)
  • …and 10 more

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-microservices-nestjs 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 1eeeb941e1bd95b375337e2e1e53a0abd77c7f62 — 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-b84573e22831.