Skip to content
CAI
Software that uses CAICheck a score

Bryan-Herrera-DEV/node-ts-ddd-prisma-backend

57.8

Adequate · 21 September 2026

671

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 user management service built on a clean architecture, handling user registration, login, and profile retrieval. It utilizes Prisma for PostgreSQL data access with Redis caching and JWT-based authentication. The application includes comprehensive end-to-end and unit tests to ensure reliability and error handling.

Features

Add Prisma-based user repository with Redis caching and JWT authentication strategy

Introduced a new Prisma-based user repository implementation that supports saving and finding users, with read operations cached in Redis for one hour. Additionally, a JWT authentication strategy was added to validate users via bearer tokens, integrating with the new repository to fetch user data.

src/core/User/infraestructure/repositorys · medium confidence

Added Prisma schema for User model

Introduced a new Prisma schema file that defines a User model with fields for id, email, name, lastname, password, and timestamps, configured to use a PostgreSQL database via environment variables.

prisma · high confidence

Added input validation for user login and registration

New data transfer objects (DTOs) have been introduced for user login and registration, implementing input validation using express-validator. The UserLoginDto validates the email and password fields, while the UserRegisterDto validates email, name, last name, and password. Both DTOs enforce string types and email formats, returning 400 errors with validation messages when inputs are invalid.

src/core/User/infraestructure/DTOs · high confidence

Introduce shared providers for authentication, caching, and response handling

The src/shared directory now includes new provider implementations for core application concerns. Authentication is supported via a Passport-based JWT middleware and a custom UnauthorizedError. Caching is enabled through a Redis-backed provider with set/get operations. A response provider standardizes API responses with status codes and messages. Additionally, hash and JWT providers are introduced for password and token management, while console logging is refactored for consistency. These changes provide the foundational infrastructure for user queries, security, and API responses.

src/shared · medium confidence

Introduces containerized user case and repository implementations

Adds new container files that wire up user-related use cases (register, login, get profile) with their respective repository implementations. The UserCasesContainer now instantiates and manages the dependencies for these use cases, while the UserRespositorysContainer provides the concrete repository implementations (save and find) using Prisma.

src/core/User/infraestructure/containers · high confidence

Introduces core user management use cases and repository implementations

This change introduces the application layer for user management, including use cases for user registration, login, and profile retrieval. It also adds repository implementations for finding and saving user data, enabling the system to handle basic user authentication and profile operations.

src/core/User/application · high confidence

Introduces user domain interfaces for registration, login, and profile retrieval

The user domain layer now defines the core data structures and repository contracts for user management. A new IUserBase interface specifies the user entity fields (id, email, name, lastname, password, createdAt, updatedAt). The IUserRepository interface establishes the contract for saving and finding users, supporting filter-based queries. Additionally, application-level use cases for user registration, login, and profile retrieval are defined, each wired to specific provider implementations such as hash, comparison, and JWT creation.

src/core/User/domain · high confidence

Behavioural changes

Add Husky pre-commit hook for style and tests

A new pre-commit hook has been added to the .husky directory, which automatically runs the project's style checks and tests before each commit. This ensures that code quality and test coverage are maintained at the point of entry, preventing unstyled or failing code from being committed to the repository.

.husky · high confidence

Refactored application startup and error handling

The application startup logic has been refactored: the previous \setupApp\ function in \src/main/config/app.ts\ and \src/main/server.ts\ have been replaced by a new \ApplicationProvider\ in \src/main/providers/ApplicationProvider.ts\. This new provider initializes the Express app with middleware (body parser, helmet, cors, compression), registers routes dynamically, and manages the HTTP server lifecycle. Additionally, a comprehensive \ErrorHandlerProvider\ has been introduced to handle syntax errors, not-found routes, client errors, and unauthorized access, replacing the previous error handling approach. Environment variables for port, environment, secret, API prefix, and Redis URL are now explicitly typed in \env.d.ts\ and loaded via \LocalsProvider\.

src/main · high confidence

Test coverage

Added end-to-end tests for error handling and user authentication; Added unit tests for User core components; Added unit tests for database, server, and server shutdown; Added unit tests for shared providers.

Dependencies

Updated project dependencies and tooling

The project's dependencies have been updated to include authentication and data access libraries such as @prisma/client, bcrypt, jsonwebtoken, passport, and redis, alongside testing and development tools like Jest, ts-jest, and husky. This adds support for JWT and Passport-based authentication, Redis integration, and enhanced testing capabilities.

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

Lenses

  • Code Health 86 → 87 (+1.3)
  • Architecture 69 → 69 (+0.0)
  • Maturity 59 → 59 (+0.0)
  • Readiness 48 → 49 (+1.0)
  • Security 60 → 71 (+11.0)

Resolved (42)

  • 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)
  • 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)
  • 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 22 more

New (72)

  • 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)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no licence statement (README.md)
  • Documentation: no usage examples (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)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • …and 52 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

Bryan-Herrera-DEV/node-ts-ddd-prisma-backend 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 0b7c91bd0c5a30f8524b5d98642e31a238d0d60a — 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.