Skip to content
CAI
Software that uses CAICheck a score

dyarleniber/simple-blog-application-backend-challenge

55.9

Adequate · 21 September 2026

2.1k

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 Node.js backend service for managing user accounts, posts, and comments. It implements a clean architecture with distinct layers for domain entities, application use cases, and infrastructure handling MongoDB persistence and HTTP request processing. The service provides full CRUD operations for posts and comments, alongside user authentication and authorization via JWT tokens.

Features

Add Bcrypt and JWT cryptographic adapters

New BcryptAdapter and JWTAdapter classes have been added to the cryptography infrastructure, implementing the HashGenerator, HashComparer, JWTGenerator, and JWTVerifier interfaces to provide password hashing and token generation/verification capabilities.

src/infra/cryptography · medium confidence

Add post management use cases

The application layer now includes new use cases for managing posts: creating, deleting, updating, and retrieving posts by ID or as a latest list. Additionally, a dedicated use case updates the total comment count for a post, supporting comment aggregation.

src/application/use-cases/posts · medium confidence

Add post use-case interfaces

Added new interfaces for post-related use cases, including CreatePost, DeletePost, GetLatestPosts, GetPostById, UpdatePost, and UpdatePostTotalComments. These interfaces define the contracts for creating, deleting, retrieving, and updating posts, as well as updating the total comment count associated with a post.

src/application/interfaces/use-cases/posts · high confidence

Added MongoDB repository implementations for posts, comments, and users

The application now includes concrete MongoDB repository implementations for Posts, Comments, and Users, enabling data persistence for these core entities. The PostRepository includes logic to update the total comment count on a post when comments are created or deleted. Additionally, helper utilities for MongoDB connection management and document mapping have been added to support these repositories.

src/infra/db · high confidence

Added authentication use cases for sign-in, sign-up, and token verification

The application now includes implementation and interface definitions for three authentication use cases: SignIn, SignUp, and Authenticate. The SignIn use case validates user credentials and generates a JWT, the SignUp use case creates new users with hashed passwords, and the Authenticate use case verifies JWTs to authorize requests.

src/application/interfaces/use-cases/authentication, src/application/use-cases/authentication · high confidence

Added domain entities for User, Post, and Comment

New domain entities have been introduced to model the core data structures of the application. The \User\ entity now includes fields for name, username, email, and password. The \Post\ entity tracks post content, authorship, and comment count. The \Comment\ entity captures post and user associations along with title and text content. These entities form the foundation of the domain layer.

src/domain · high confidence

Initial project scaffolding and tooling setup

The repository was initialized with essential development tooling and configuration files. This includes TypeScript configuration (tsconfig.json, tsconfig-build.json), ESLint setup (.eslintrc.json) with TypeScript and Airbnb style guides, Jest testing configuration (jest.config.ts, jest-mongodb-config.js) for unit and integration tests, and a Docker Compose environment (docker-compose.yml) for local development with Node.js and MongoDB. The project also includes standard repository files like .gitignore, README.md, and a MIT LICENSE.

(repo-wide) · high confidence

Introduces HTTP layer with authentication, validation, and CRUD controllers

The HTTP infrastructure now includes a full set of controllers for managing posts and comments (create, read, update, delete), alongside authentication endpoints for sign-in and sign-up. This change introduces a \BaseController\ for standardized request handling and validation, an \AuthMiddleware\ to extract user identity from headers, and specific validation classes (e.g., \EmailValidation\, \RequiredFieldValidation\) to enforce input constraints before requests reach the application layer.

src/infra/http · high confidence

Introduces application-layer interfaces and error classes for posts, comments, and authentication

The application layer now includes a set of new interface definitions and error classes to support post, comment, and authentication features. Specifically, the diff adds repository interfaces for creating, reading, updating, and deleting posts and comments, as well as user loading and creation. It also introduces cryptography interfaces for hashing and JWT generation/verification, alongside a generic UseCase interface. Additionally, specific error classes such as CommentNotFoundError, PostNotFoundError, EmailInUseError, ForbiddenError, and UnauthorizedError are added to handle application-specific failure states.

src/application · high confidence

New comment management use cases

The application now includes use cases for creating, retrieving, updating, and deleting comments. Specifically, it introduces interfaces and implementations for creating a comment, fetching a comment by ID, fetching the latest comments for a post with pagination, updating a comment, and deleting a single comment or all comments for a post.

src/application/interfaces/use-cases/comments, src/application/use-cases/comments · high confidence

Behavioural changes

Added Husky pre-commit hook for linting

The project now includes a Husky pre-commit hook that automatically runs lint-staged before each commit. This ensures that staged files are linted automatically, helping maintain code quality and catch issues early in the development workflow.

.husky · high confidence

Introduce authentication and authorization for posts and comments

The application now enforces authentication on all write and delete operations for posts and comments. The \authMiddleware\ validates the user's token before allowing access to create, update, or delete posts and comments. Read-only endpoints (like fetching the latest posts or comments) remain publicly accessible. Additionally, the \userId\ is now passed through the HTTP request context, enabling the system to associate actions with specific users.

src/main · high confidence

Test coverage

Add integration tests for authentication routes; Added test coverage for HTTP controllers, middleware, and validation; Added unit tests for post use cases.

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

Lenses

  • Code Health 84 → 96 (+11.9)
  • Architecture 100 → 80 (-19.7)
  • Maturity 67 → 67 (+0.0)
  • Readiness 61 → 58 (-2.4)
  • Security 63 → 76 (+13.9)
  • Accessibility 43 (new)

Resolved (58)

  • 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)
  • 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)
  • …and 38 more

New (67)

  • 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)
  • Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (the committed lockfile is in a format this engine cannot resolve)
  • Documentation: no installation or build instructions (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)
  • …and 47 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

dyarleniber/simple-blog-application-backend-challenge 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 63fec9d337dd35de073801d43a0ebc458b75d216 — 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.