Skip to content
CAI
Software that uses CAICheck a score

andrea-acampora/nestjs-ddd-devops

52.1

Adequate · 21 September 2026

1.9k

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 NestJS-based backend application that implements a Domain-Driven Design architecture to manage user accounts and authentication. It exposes both REST and GraphQL APIs to handle user registration, login, and profile retrieval, while also providing health check endpoints for monitoring. The codebase is structured with clear separation of concerns, utilizing CQRS, microservices patterns, and automated testing to ensure reliability.

Features

Add REST API endpoints for user login, signup, and token refresh

Users can now authenticate and manage their session via new REST endpoints: a login route at /auth/login, a signup route at /auth/signup, and a token refresh route at /auth/token/refresh. The implementation includes request body validation (email, password, name fields) and integrates with the underlying use cases to return JWT access and refresh tokens. Additionally, an AuthGuard has been introduced to enforce authentication and role-based access control on protected routes.

src/modules/auth/api · high confidence

Add config utility for safe value retrieval

A new utility function, getConfigValue, has been added to the library to safely retrieve configuration values from the NestJS ConfigService. This function wraps the standard get method with an error-throwing fallback, ensuring that missing configuration keys are caught immediately rather than returning undefined.

src/libs/util · high confidence

Add custom HTTP exception classes and a global exception filter

The src/libs/exceptions directory now includes new custom exception classes for handling bad requests, conflicts, and not-found scenarios, each extending NestJS's HttpException with specific status codes. Additionally, a global exception filter has been introduced to standardize error responses for both HTTP and GraphQL endpoints, ensuring consistent JSON formatting with status codes, messages, timestamps, and request paths.

src/libs/exceptions · high confidence

Add health check endpoint for monitoring system status

A new health check module has been introduced, exposing a REST endpoint at /health that verifies the status of external connectivity, the database, and disk storage. This provides a public API for monitoring the application's operational state.

src/modules/health · high confidence

Add project configuration, environment, and build files

The project now includes essential configuration and build files to support development and deployment. A \.dockerignore\ file is added to optimize Docker builds, while \.env.dist\ and \.env.test\ provide environment variable templates for database, JWT, and port configurations. The \Dockerfile\ and \docker-compose.yml\ are introduced to containerize the application and manage a local PostgreSQL development database. Additionally, \nest-cli.json\ configures the NestJS build process, \tsconfig.json\ and \tsconfig.build.json\ define TypeScript compilation settings, and \eslint.config.mjs\ sets up code linting. The \lefthook.yml\ configures pre-commit and commit-msg hooks for linting and testing, while \release.config.cjs\ and \renovate.json\ automate semantic versioning and dependency updates.

(repo-wide) · high confidence

Add user management handlers for CRUD operations

New application-layer handlers are introduced to support user creation, registration, and retrieval. The system now includes a CreateUserHandler and RegisterUserHandler to process commands for creating and registering users, while query handlers (GetAllUsersHandler, GetUserByIdHandler, GetAuthUserByEmailHandler, CheckAuthUserByIdHandler) enable fetching user data by ID, email, or authentication status. These handlers bridge commands and queries to the underlying use cases and repositories, establishing the foundation for user management features.

src/modules/user/application/handler · high confidence

Add user management via REST and GraphQL APIs

Introduced new endpoints for managing users across both REST and GraphQL interfaces. The REST API exposes a /users controller supporting creation (including admin roles), listing with pagination/filtering/sorting, and individual retrieval. The GraphQL API provides a corresponding resolver with a createUser mutation, a getUsers query, and a getUser query, all backed by shared domain models and CQRS commands. Input validation is enforced via class-validator decorators on both API layers.

src/modules/user/api · high confidence

Added command objects for user registration and creation

New command classes have been introduced to support user management workflows. A RegisterUserCommand was added to the auth module to handle registration details (email, password, first and last name), while a CreateUserCommand was added to the user module to handle creation details including an explicit role assignment.

src/modules/auth/application/command, src/modules/user/application/command · high confidence

Added database persistence layer for the User module

The user module now includes a complete database persistence stack, introducing a MikroORM entity for the user table, a mapper for domain-to-persistence transformation, and a repository implementation that supports querying by email and ID, creating users, and retrieving paginated, filtered, and sorted user lists.

src/modules/user/infrastructure · high confidence

Added login and signup use cases for authentication

Users can now log in and sign up via new application use cases. The login flow validates credentials against the stored password hash and returns an auth user object, while the signup flow checks for existing emails to prevent conflicts and registers new users. Both use cases interact with the domain via CQRS buses and return structured user data.

src/modules/auth/application/use-case · high confidence

Added query classes for checking and retrieving authenticated users

Introduced two new application-layer query classes: CheckAuthUserByIdQuery, which accepts a user ID, and GetAuthUserByEmailQuery, which accepts an email address. These classes serve as the entry points for querying authenticated user data by their unique identifier and email, respectively.

src/modules/auth/application/query · high confidence

Added shared pagination and role definitions to the API library

The API library now includes foundational types and utilities for handling paginated data and user roles. This includes an ApiRole enum defining ADMIN and USER roles, a generic Paginated type for GraphQL responses, and REST-specific interfaces for paginated query parameters (offset, limit) and responses. These changes provide a consistent structure for implementing pagination and role-based access control across the API.

src/libs/api · high confidence

Initial NestJS application setup with Fastify, GraphQL, and microservices modules

The application is bootstrapped using NestJS with the Fastify adapter, enabling URI-based API versioning, global validation pipes, and static asset serving. The core module configures a suite of integrations including MikroORM for database access, Apollo GraphQL, caching, rate limiting, event handling, and scheduling. Additionally, new modules for user management, authentication, and communication are introduced, along with supporting value objects like user roles and states.

src · high confidence

Initial database configuration and admin user setup

The application now includes a MikroORM configuration file that connects to a PostgreSQL database using environment variables for credentials and host. A new database migration has been added to create an initial admin user with the email '[e-mail redacted]' and a hashed password ('Test1234!'). Additionally, environment variable constants for JWT secrets and the application port have been defined.

src/config · high confidence

Introduce authentication module with login and signup capabilities

The auth module is now available, providing login and signup use cases along with a JWT service and authentication guard. This enables users to register new accounts and log in to the system.

src/modules/auth · high confidence

Introduce base entity and user domain event

Added a new abstract BaseEntity class in the database library that provides common fields (id, createdAt, updatedAt, deletedAt) for all database entities. Additionally, introduced a CreatedUserEvent domain event in the user module to handle user creation notifications, implementing the IEvent interface from NestJS CQRS.

src/libs/database, src/modules/user/domain/event · high confidence

Introduce core DDD infrastructure interfaces and abstractions

The \src/libs/ddd\ library now includes a set of new interfaces and abstract classes that define the foundational contracts for a Domain-Driven Design architecture. This includes \ApplicationService\, \DomainService\, \UseCase\, and \Mapper\ interfaces, alongside abstract base classes for \DomainEvent\ and \ValueObject\. Additionally, a generic \Repository\ interface and a \MikroOrmRepository\ implementation are added, providing a standardized way to interact with persistence layers using the Effect library's \Option\ type for safe null handling.

src/libs/ddd · high confidence

Introduce user management capabilities including creation, retrieval, and GraphQL/REST APIs

Users can now create accounts and retrieve user data through new application use cases and handlers. The change introduces a \CreateUserUseCase\ that handles user creation with password hashing and event publishing, alongside repository interfaces and implementations for querying users by email, ID, and paginated lists. The \UserModule\ registers these components, exposing functionality via a REST \UserController\ and a GraphQL \UserResolver\, enabling clients to interact with user data through both API styles.

src/modules/user · medium confidence

JWT authentication service implementation

The authentication module now includes a concrete implementation for handling JSON Web Tokens. A new \JwtAuthService\ interface and its \JwtService\ implementation have been added to manage token generation and verification. This enables the system to issue and validate access and refresh tokens, supporting the underlying login and user management workflows.

src/modules/auth/application/service, src/modules/auth/infrastructure · high confidence

New decorators and validation pipe for query parameters and authentication

The library now includes new utilities for handling HTTP requests: an authentication decorator for managing user roles and public endpoints, a query parameter decorator that parses and converts query string values (including nested objects), and a validation pipe that enforces DTO schemas on query parameters, throwing a BadRequestException with detailed error messages when validation fails.

src/libs/decorator · high confidence

Behavioural changes

Add email notification for new user registration

A new communication module has been introduced to handle the 'user created' event by sending a welcome email. This includes an event handler that listens for the CreatedUserEvent, an EmailService interface, and an EmailServiceImpl that logs the email address being sent to. The module registers the handler and service implementation, wiring the email service via dependency injection.

src/modules/communication · high confidence

Enforce conventional commit message format

Added a new commit-msg hook script that validates commit messages against the Conventional Commits specification. The script checks that each commit message starts with a valid type (such as fix, feat, chore, etc.), followed by an optional scope, a delimiter, and a subject line. This ensures all commit messages adhere to a standardized format before being accepted.

.lefthook · high confidence

Introduce User domain entity with aggregate root pattern

The User domain entity has been introduced as a new file, extending the AggregateRoot base class to implement the aggregate root pattern. The entity includes properties for email, password, first and last name, role, state, and timestamps, and applies a CreatedUserEvent upon creation.

src/modules/user/domain/entity · medium confidence

Test coverage

Added Jest test configuration files; Added end-to-end test for the health check endpoint; Added end-to-end tests for authentication flows; Added end-to-end tests for user management.

Dependencies

Initialize project dependencies and lockfile

Added package.json and package-lock.json to the project, establishing the initial set of dependencies for a NestJS application. This includes core frameworks (NestJS v11, GraphQL, Apollo), ORM (MikroORM v6), and various utility libraries (bcryptjs, jsonwebtoken, uuid). Development dependencies for testing (Jest, Supertest), linting (ESLint v9, Prettier), and CI/CD (semantic-release) are also included.

(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

Score

  • CAI 59 → 52 (-6.6)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 86 → 88 (+1.8)
  • Architecture 90 → 76 (-14.6)
  • Maturity 54 → 54 (+0.0)
  • Readiness 53 → 40 (-13.0)
  • Security 55 → 65 (+10.0)

Resolved (61)

  • Coverage not included — suite not readable by the collector
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • …and 41 more

New (120)

  • Coverage not measured — JavaScript/TypeScript suite
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Critical CVE: [GHSA redacted] (package-lock.json)
  • Documentation: no installation or build instructions (README.md)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • …and 100 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

andrea-acampora/nestjs-ddd-devops 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 e8f4f5528c0563a55cb92d4dc90b09d29d78fb9f — 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.