Skip to content
CAI
Software that uses CAICheck a score

Flaiers/fastapi-clean-architecture

38.3

Weak · 22 September 2026

782

lines of production code

Python

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Python-based backend service built with FastAPI and Flask, designed to manage application records via a RESTful API. It provides comprehensive infrastructure for local development using Docker Compose, including PostgreSQL and RabbitMQ integration. The architecture supports asynchronous database operations, message queue-based RPC communication, and standardized data transfer objects for validation and error handling.

Features

Add AMQP RPC router for v1 endpoints

Introduced a new AMQP-based RPC router that registers the v1 API namespace. The router mounts the /v1 prefix and includes the /applications sub-router, which exposes a /metrics procedure for retrieving system metrics.

internal/controller/amqp · high confidence

Add RabbitMQ RPC client and server components

The package now includes a new RPC implementation for RabbitMQ, introducing a client and server architecture. The client (RPCClient) manages connections and supports pluggable RPC types (JsonRPC or UnionRPC). The server (RPCServer) handles incoming RPC requests and integrates with an RPCRouter for route registration. A dependency helper (get\_rpc) is also provided for FastAPI integration.

pkg · high confidence

Add phone number validation support

The internal/usecase/pydantic directory now contains a new set of files that provide phone number validation capabilities. This includes a custom Pydantic data type (PhoneStr) that enforces a specific format for phone numbers, along with associated error handling and validation logic. Users can now utilize these components to validate phone numbers within their Pydantic models.

internal/usecase/pydantic · high confidence

Added Alembic migration configuration and templates

The project now includes the necessary files to support database migrations using Alembic. A new \migrations/env.py\ file has been added to configure the Alembic environment, including async database connection handling and logging setup. Additionally, a \migrations/script.py.mako\ template has been introduced to generate migration scripts with appropriate revision identifiers and upgrade/downgrade function stubs.

migrations · high confidence

Added Docker configuration for backend, migration, and RabbitMQ services

Users can now run the application locally using Docker Compose. The change introduces a new .env.example file with configuration defaults for the backend, database, and RabbitMQ. It also adds Dockerfiles for the backend and database migration services, a main docker-compose.yml defining the database, migration, and backend services, and a separate docker-compose.yml for RabbitMQ. This enables a complete local development environment with PostgreSQL, the FastAPI backend, and RabbitMQ message broker.

docker · high confidence

Added SQLAlchemy entity definitions for the application module

New files were added to internal/entity to define the data models. This includes a Base class with a UUID primary key and automatic table naming, a TimestampMixin providing created\_at, updated\_at, and deleted\_at datetime columns, and an Application entity with unique constraints on phone and email fields.

internal/entity · high confidence

Added entry points for admin and backend applications

New main.py files were added for the admin and backend applications, each setting up the Python path and importing their respective app factories (admin\_app and backend\_app) to serve as the application entry points.

cmd · high confidence

Introduce Application DTOs for API data transfer

Added new data transfer objects for handling application data, including a base model with phone, email, and text fields, a read model with an ID, and a filter class for querying applications by phone and email.

internal/dto · high confidence

Introduce ApplicationService for managing application records

A new ApplicationService class has been added to the internal service layer, providing methods to create, find, and soft-delete application records. The service leverages an InjectRepository pattern with SQLAlchemy's AsyncSession to handle database interactions, including filtering by phone and email and retrieving records by ID.

internal/service · high confidence

Introduce HTTP router for API versioning

A new router file has been added to the HTTP controller layer, establishing a versioned API structure by including the v1 router under the /v1 prefix.

internal/controller/http · high confidence

Introduce centralized configuration and database session management

The application now uses a centralized settings module to manage environment variables for database (PostgreSQL) and message queue (RabbitMQ) connections, automatically constructing URIs from individual components. Additionally, new database utilities provide both synchronous and asynchronous session factories, enabling consistent database access across the application.

internal/config · high confidence

Introduce v1 HTTP controllers for applications and health checks

Added new FastAPI route modules for the v1 API: an applications endpoint supporting paginated listing, creation, and deletion of applications, plus a /health check endpoint. These controllers wire the application and health routers into the v1 router, enabling users to manage applications and verify service health via the v1 HTTP interface.

internal/controller/http/v1 · high confidence

Behavioural changes

Add application database table

A new 'application' table is introduced in the database schema, containing fields for id, created\_at, updated\_at, deleted\_at, phone, email, and text. The table includes unique constraints on email and phone, and indexes on id, email, and phone to support efficient querying and data integrity.

migrations/versions · medium confidence

Added empty usecase module initialization

An empty \_\init\\_.py file was added to the internal/usecase directory, creating the package structure for the usecase module.

internal/usecase · high confidence

Separate application entry points for backend and admin services

The application now provides distinct entry points for the backend API and the admin interface. The backend service is built with FastAPI, configuring CORS, pagination, and RPC routers, while the admin service is built with Flask and Flask-Admin, exposing a database model view. This structural change allows the two services to be initialized and run independently.

internal/app · high confidence

Standardized exception handling and response schemas in usecase utilities

The internal usecase utilities now provide a centralized set of exception handlers for database errors, not-found conditions, and HTTP exceptions, ensuring consistent error responses. Additionally, new response utilities including ResponseExample, ResponseSchema, and SuccessfulResponse are introduced to standardize API response structures and documentation.

internal/usecase/utils · high confidence

Test coverage

Added placeholder for tests directory

A .gitkeep file was added to the tests directory to ensure the directory is tracked by version control.

tests · high confidence

Dependencies

Migrate project to Poetry for dependency management

The project has switched its dependency management from pip/requirements.txt to Poetry, introducing a pyproject.toml and a generated poetry.lock file. This change standardizes the build system, ensuring reproducible builds and consistent dependency resolution for both main and development dependencies.

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

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 40 → 40 (+0.7)
  • Readiness 15 → 15 (+0.0)
  • Security 76 → 81 (+4.5)

Resolved (22)

  • Critical CVE: [GHSA redacted] (poetry.lock)
  • Critical CVE: [GHSA redacted] (poetry.lock)
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: PYSEC-2024-38 (poetry.lock)
  • Medium CVE: PYSEC-2026-2132 (poetry.lock)
  • Medium IaC: CKV_DOCKER_3 (docker/Dockerfile.backend)
  • Medium IaC: CKV_DOCKER_3 (docker/Dockerfile.migration)
  • …and 2 more

New (28)

  • Critical CVE: [GHSA redacted] (poetry.lock)
  • Critical CVE: [GHSA redacted] (poetry.lock)
  • Critical CVE: [GHSA redacted] (poetry.lock)
  • Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no project overview (README.md)
  • Documentation: no usage examples (README.md)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High CVE: [GHSA redacted] (poetry.lock)
  • High IaC: WD-DOCKER-0001 (docker/Dockerfile.backend)
  • High IaC: WD-DOCKER-0001 (docker/Dockerfile.migration)
  • Low IaC: DS-0026 (docker/Dockerfile.backend)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • Medium CVE: [GHSA redacted] (poetry.lock)
  • …and 8 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

Flaiers/fastapi-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 22 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 1e5a2ccc080c52563d360e6d8c4bc7573351e358 — 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-821afab8930d.