0xTheProDev/fastapi-clean-example
57.9
Adequate · 22 September 2026
675
lines of production code
Python
primary language
7
measurements over time
What this system is
This system is a backend application for managing authors and books, built with FastAPI and supporting both REST and GraphQL interfaces. It implements a layered architecture featuring repository and service patterns to handle data access and business logic for creating, reading, updating, and deleting entities. The system includes comprehensive testing and uses centralized configuration for environment and database management.
Features
Add GraphQL and Pydantic schemas for Authors and Books
New schema definitions have been added for the Author and Book entities, supporting both GraphQL (using Strawberry) and Pydantic models. The GraphQL layer introduces query fields to retrieve and list authors and books, as well as mutation fields to create, update, and delete them. The Pydantic layer defines request and response schemas for these entities. This change enables the application to expose and manage Author and Book data through a GraphQL API.
schemas · high confidence
Add database models for books and authors
New SQLAlchemy models are introduced for Books and Authors, establishing a many-to-many relationship between them via a dedicated association table. The Book model includes a dynamic relationship to Authors, and the Author model includes a dynamic relationship to Books, enabling the system to track which authors have written which books.
models · high confidence
Added route metadata for Authors and Books
Introduced new metadata definitions for 'author' and 'book' routes, each with a descriptive label indicating CRUD operations for those entities. This provides structured information about the available API endpoints for managing authors and books.
metadata · high confidence
Centralized configuration management for database and environment settings
The application now uses a centralized configuration system to manage environment variables and database connections. Environment settings are defined in a new \Environment.py\ module, which loads variables from \.env\ files based on the runtime environment. This allows the \Database.py\ module to dynamically construct the database URL and create SQLAlchemy engine and session factories using these environment variables. Additionally, \GraphQL.py\ is introduced to manage GraphQL context and dependency injection for services, supporting the new GraphQL feature.
configs · high confidence
Initial project setup with FastAPI, GraphQL, and testing infrastructure
The application is initialized with a FastAPI core, integrating both REST endpoints (for Authors and Books) and a GraphQL interface. The project structure includes configuration for code coverage, environment variables for testing, and pre-commit hooks for code formatting. The README is updated to reflect the new project name, dependencies (Pipenv, Pydantic), and testing procedures.
(repo-wide) · high confidence
Introduce Author and Book service layers with dependency injection
New service classes (AuthorService, BookService) are added to encapsulate business logic for authors and books. These services use FastAPI's dependency injection to manage repositories, providing methods for creating, reading, updating, and deleting entities, as well as managing the many-to-many relationship between books and authors.
services · high confidence
Introduce repository pattern for data access
The codebase now uses a repository pattern to manage data access for Authors and Books. New files (AuthorRepository, BookRepository, and RepositoryMeta) provide standardized create, read, update, and delete operations, along with a list method that supports filtering by name and pagination. The abstract base class RepositoryMeta defines the interface for these repositories, ensuring consistent data access methods across the application.
repositories · high confidence
New API endpoints for managing Authors and Books
The application now exposes RESTful API routes for Authors and Books, enabling users to create, read, update, and delete records for both entities. The Author router provides endpoints to list, retrieve, create, update, and delete authors, as well as fetch associated books. Similarly, the Book router allows users to manage books and associate or disassociate authors with specific books. These new endpoints expand the platform's capabilities for content management.
routers · high confidence
Test coverage
Added unit tests for Author and Book repositories and services
Added new unit tests for the Author and Book repositories and their corresponding services. The test suite covers create, read, update, delete, and list operations for both entities, verifying that the services correctly invoke the underlying repository methods.
\\tests\\_ · high confidence_
Dependencies
Migrate to Pipenv and add DevX tooling
The project has switched from pip to Pipenv for dependency management, introducing Pipfile and Pipfile.lock to pin specific versions of packages such as FastAPI, SQLAlchemy, and Strawberry GraphQL. Additionally, development tools including Black, isort, and pre-commit have been added to the environment, with configuration for Black, isort, and pytest defined in pyproject.toml.
(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 51 → 58 (+6.4)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 100 (-0.3)
- Architecture 69 → 69 (+0.0)
- Maturity 78 → 82 (+3.6)
- Readiness 24 → 36 (+11.7)
- Security 82 → 87 (+4.8)
Resolved (21)
- Coverage not included — suite not readable by the collector
- Critical CVE: [GHSA redacted] (Pipfile.lock)
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- High CVE: [GHSA redacted] (Pipfile.lock)
- High CVE: [GHSA redacted] (Pipfile.lock)
- High CVE: [GHSA redacted] (Pipfile.lock)
- High CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: PYSEC-2024-38 (Pipfile.lock)
- Medium CVE: PYSEC-2026-2132 (Pipfile.lock)
- No exposed public API
- Test reliability not included
- The README lists only tooling and badge graphics; it contains no prose describing what the FastAPI application does or how to use any endpoint. (README.md)
- early-stage repository — too few commits for a meaningful bus factor
- …and 1 more
New (19)
- Critical CVE: [GHSA redacted] (Pipfile.lock)
- Critical CVE: [GHSA redacted] (Pipfile.lock)
- Documentation: no installation or build instructions (README.md)
- Documentation: no licence statement (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (6 lines × 2) (repositories/AuthorRepository.py)
- High CVE: [GHSA redacted] (Pipfile.lock)
- High CVE: [GHSA redacted] (Pipfile.lock)
- High CVE: [GHSA redacted] (Pipfile.lock)
- High CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: [GHSA redacted] (Pipfile.lock)
- Medium CVE: PYSEC-2024-38 (Pipfile.lock)
- Medium CVE: PYSEC-2026-2132 (Pipfile.lock)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
0xTheProDev/fastapi-clean-example 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 181bb46cf7f7e7cdb58844ba65020b1a4aadbdc3 — 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.