JamieLivingstone/node-clean-architecture
60.8
Adequate · 21 September 2026
717
lines of production code
TypeScript
primary language
4
measurements over time
What this system is
This system is a production-ready URL shortening service built on a Clean Architecture with Fastify and Prisma. It manages shortened URLs and their associated visit records, providing endpoints for creation, redirection, and analytics. The application includes comprehensive validation, structured logging, and integration tests to ensure reliability.
Features
Add URL shortener feature with create and redirect endpoints
Introduces the URL shortener feature, providing a POST /api/v1/shorten endpoint to create shortened URLs and a GET /r/:id endpoint to redirect to the original URL. The implementation includes validation for URLs and expiration dates, handles ID collisions with retries, records visit analytics, and normalizes URLs (including IDN domains) for security. This is accompanied by comprehensive test coverage for both use cases and supporting plugins for dependency injection, error handling, health checks, rate limiting, and Swagger documentation.
src/features/url-shortener, src/plugins · high confidence
Added Prisma schema and migrations for URL shortener
Introduced the database schema for a URL shortening feature, defining a 'ShortenedUrl' model and a 'Visit' model with a one-to-many relationship. The change includes the Prisma configuration file, the schema definition, and the initial PostgreSQL migration script to create the 'shortened\_urls' and 'visits' tables.
prisma · high confidence
Introduce domain models and repository interfaces for URLs and visits
The application now includes domain entities for ShortenedUrl and Visit, each with their respective repository interfaces (ShortenedUrlsRepository and VisitsRepository) to support data persistence and retrieval. This establishes the foundational structure for managing shortened URLs and their associated visit records.
src/domain · high confidence
Major architectural overhaul: Fastify, Prisma, and Clean Architecture
The project has been completely refactored from a basic template into a production-ready, Clean Architecture implementation. The HTTP server has been migrated to Fastify, and the database layer now uses Prisma with Zod for runtime validation. The codebase is now structured into domain, infrastructure, and feature layers, with dependency injection and exhaustive pattern matching for error handling. Tooling has been updated to use npm, Biome for linting/formatting, and tsup for bundling. The Node.js runtime target has been updated to version 24, and the project now includes comprehensive documentation, Docker configuration, and a CI pipeline.
(repo-wide) · medium confidence
Behavioural changes
Introduce Prisma-based data access and structured logging
The infrastructure layer now uses Prisma for database interactions, with new repository implementations for shortened URLs and visits that map Prisma models to domain entities. A new dependency injection setup wires the Prisma client, repositories, and a structured logger (Pino) into a single dependencies object, while environment configuration is validated using Zod.
src/infrastructure · medium confidence
Introduce new application entry points and server lifecycle management
The application now exposes new entry points in src/app.ts and src/server.ts. The app.ts file centralizes Fastify plugin registration, including CORS, Helmet, rate limiting, error handling, health checks, and Swagger (in non-production environments). The server.ts file handles Fastify initialization, dependency injection setup, and graceful shutdown handling for SIGTERM and SIGINT signals, ensuring clean resource disposal.
src · medium confidence
Test coverage
Added integration tests for URL shortener, health, and error handling
Added new integration tests covering the URL shortener API (creation, expiration, and validation), health check endpoints (/health, /ready), and the error handler plugin (404 responses). A test helper was added to bootstrap the Fastify server, and a setup/teardown script manages the test database schema.
tests · high confidence
Dependencies
Upgrade to Fastify v5 and Prisma v7, and switch to Node.js 24
The project has been modernized by upgrading the core framework from Express to Fastify v5.6.2, along with its ecosystem packages (cors, helmet, rate-limit, swagger, swagger-ui, type-provider-json-schema-to-ts). The database layer has been upgraded to Prisma v7.2.0 (and the pg adapter). Development tooling has shifted to use Biome for linting/formatting, tsup for bundling, and lefthook for pre-commit hooks. The project now requires Node.js 24 or higher.
(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 61 → 61 (+0.2)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 96 → 100 (+3.9)
- Architecture 69 → 69 (+0.0)
- Maturity 69 → 69 (+0.0)
- Readiness 46 → 47 (+0.5)
- Security 74 → 83 (+8.7)
Resolved (30)
- Coverage not included — suite not readable by the collector
- 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)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- …and 10 more
New (49)
- Coverage not measured — JavaScript/TypeScript suite
- Critical CVE: [GHSA redacted] (package-lock.json)
- 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)
- 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 29 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
JamieLivingstone/node-clean-architecture 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 c94aacef32c7da8c0a1282ed4b78f7e284e6e90c — 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.