# nsidnev/fastapi-realworld-example-app architecture

> Architecture diagram of the GitHub repository nsidnev/fastapi-realworld-example-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nsidnev/fastapi-realworld-example-app
- Repository: https://github.com/nsidnev/fastapi-realworld-example-app

## Overview

1. **What this repo is**
   - A FastAPI backend implementing the RealWorld/Conduit API.
   - The system is centered on a REST API backed by PostgreSQL, with JWT-based authentication and separate layers for routing, business logic, and database access.

2. **Request entrypoint and application bootstrap**
   - `app/main.py` is the application entrypoint.
   - `app/core` holds startup/config concerns: environment-based settings, logging, and app-level event hooks.
   - Runtime configuration is split by environment (`development`, `production`, `test`) under `app/core/settings`.

3. **HTTP/API boundary**
   - `app/api/routes` defines the public REST surface: articles, comments, profiles, tags, users, authentication, plus an API aggregator.
   - These route modules are the thin outer boundary: they translate HTTP requests into service calls and return schema objects.
   - `app/api/errors` centralizes HTTP and validation error handling so the API presents consistent responses.

4. **Dependency injection layer**
   - `app/api/dependencies` contains request-scoped wiring for routes.
   - This layer likely resolves the database handle, authenticated user context, and resource-specific helpers.
   - It acts as the bridge between FastAPI request handling and the internal service/repository layers.

5. **Business logic layer**
   - `app/services` contains non-trivial application behavior: article workflows, comments, authentication, JWT handling, and security helpers.
   - This is where cross-cutting rules live, such as credential validation, token creation/verification, and orchestrating multi-step operations.
   - Services sit between HTTP concerns and persistence concerns.

6. **Persistence and data access**
   - `app/db/repositories` is the CRUD boundary for PostgreSQL access.
   - Repositories isolate the rest of the app from raw SQL and database details.
   - `app/db/queries/sql` stores SQL statements by domain area, while `app/db/queries` provides the query abstraction used by repositories.
   - `app/db/migrations` contains Alembic migrations, showing that schema evolution is managed explicitly rather than inferred at runtime.

7. **Domain vs API schema models**
   - `app/models/domain` contains internal domain models used across service and persistence logic.
   - `app/models/schemas` contains request/response schemas for the API layer.
   - The separation is important: domain objects are for internal business use, while schemas define the external contract.
   - Shared base types in `rwmodel.py` and `rwschema.py` likely provide consistent read/write behavior across entities.

8. **Supporting resources and constants**
   - `app/resources/strings.py` centralizes user-facing strings and response text.
   - This suggests the project keeps message text out of route handlers and services to reduce duplication and improve consistency.

9. **Authentication and authorization flow**
   - Authentication is split across `services/authentication.py`, `services/jwt.py`, and `services/security.py`.
   - The flow is: credentials come in through auth routes, are validated in service logic, JWTs are created/checked, and protected endpoints use dependency-based user resolution.
   - Profiles and user-related routes depend on this authenticated identity context.

10. **Data flow through the system**
   - Typical request path: HTTP route -> dependency resolution -> service orchestration -> repository/query execution -> PostgreSQL -> domain/schema serialization -> HTTP response.
   - Errors can be raised at any layer, but API error handlers normalize them before they leave the application boundary.

11. **Testing and quality gates**
   - `tests/` covers API routes, database query behavior, schemas, and JWT service logic.
   - `tests/fake_asyncpg_pool.py` indicates the database layer is tested with a fake async pool, so persistence behavior can be validated without always hitting a live database.
   - GitHub workflows and scripts for tests, linting, formatting, and deployment indicate CI enforces correctness and style.

12. **Deployment/runtime packaging**
   - The repo is container-ready via `Dockerfile` and `docker-compose.yml`.
   - PostgreSQL is a required external service, and the README shows local and Docker-based startup around `DATABASE_URL`, Alembic migrations, and Uvicorn.
   - Postman collection files support API-level verification against the running service.

Main entry points: [`app/api/routes/api.py`](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/api.py) (API router), [`app/api/dependencies`](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/api/dependencies) (Deps), [`app/db/queries/queries.py`](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/queries/queries.py) (Queries), [`app/services/authentication.py`](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/authentication.py) (Auth svc)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_app["App runtime"]
  node_app_main["Main app<br/>fastapi entrypoint<br/>[main.py]"]
  node_core_config["Core config<br/>startup config"]
  node_settings_env["Env settings<br/>runtime settings"]
  node_api_router["API router<br/>route aggregator<br/>[api.py]"]
  node_route_articles["Articles API<br/>REST routes"]
  node_route_auth["Auth API<br/>REST routes<br/>[authentication.py]"]
  node_route_comments["Comments API<br/>REST routes<br/>[comments.py]"]
  node_route_profiles["Profiles API<br/>REST routes<br/>[profiles.py]"]
  node_route_tags["Tags API<br/>REST routes<br/>[tags.py]"]
  node_route_users["Users API<br/>REST routes<br/>[users.py]"]
  node_api_errors["API errors<br/>error handling"]
  node_api_deps["Deps<br/>request wiring"]
  node_svc_articles["Articles svc<br/>business logic<br/>[articles.py]"]
  node_svc_comments["Comments svc<br/>business logic<br/>[comments.py]"]
  node_svc_auth["Auth svc<br/>business logic<br/>[authentication.py]"]
  node_svc_jwt["JWT svc<br/>token logic<br/>[jwt.py]"]
  node_svc_security["Security<br/>[security.py]"]
  node_resources["Strings<br/>shared resources<br/>[strings.py]"]
end

subgraph group_group_data["Data layer"]
  node_repo_articles["Articles repo<br/>postgres repo<br/>[articles.py]"]
  node_repo_comments["Comments repo<br/>postgres repo<br/>[comments.py]"]
  node_repo_profiles["Profiles repo<br/>postgres repo<br/>[profiles.py]"]
  node_repo_tags["Tags repo<br/>postgres repo<br/>[tags.py]"]
  node_repo_users["Users repo<br/>postgres repo<br/>[users.py]"]
  node_queries["Queries<br/>sql abstraction<br/>[queries.py]"]
  node_sql_files["SQL files<br/>sql statements"]
  node_migrations["Migrations<br/>alembic"]
end

subgraph group_group_models["Models"]
  node_domain_models["Domain models<br/>internal models"]
  node_api_schemas["API schemas<br/>request/response schemas"]
end

subgraph group_group_tests["Tests"]
  node_tests_api["API tests<br/>pytest suite"]
  node_tests_db["DB tests<br/>pytest suite"]
  node_tests_schemas["Schema tests<br/>pytest suite"]
  node_tests_services["Service tests<br/>pytest suite"]
end

subgraph group_group_ops["Ops"]
  node_docker["Container<br/>runtime packaging"]
  node_ci["CI workflows<br/>automation<br/>[workflows]"]
end

node_app_main -->|"bootstraps"| node_core_config
node_core_config -->|"selects"| node_settings_env
node_app_main -->|"mounts"| node_api_router
node_api_router -->|"includes"| node_route_articles
node_api_router -->|"includes"| node_route_auth
node_api_router -->|"includes"| node_route_comments
node_api_router -->|"includes"| node_route_profiles
node_api_router -->|"includes"| node_route_tags
node_api_router -->|"includes"| node_route_users
node_route_articles -->|"uses"| node_api_deps
node_route_auth -->|"uses"| node_api_deps
node_route_comments -->|"uses"| node_api_deps
node_route_profiles -->|"uses"| node_api_deps
node_route_users -->|"uses"| node_api_deps
node_api_deps -->|"wires"| node_svc_articles
node_api_deps -->|"wires"| node_svc_comments
node_api_deps -->|"wires"| node_svc_auth
node_api_deps -->|"wires"| node_repo_users
node_api_errors -.->|"guards"| node_api_router
node_svc_auth -->|"calls"| node_svc_security
node_svc_auth -->|"issues"| node_svc_jwt
node_svc_auth -->|"reads/writes"| node_repo_users
node_svc_articles -->|"uses"| node_repo_articles
node_svc_articles -->|"uses"| node_repo_tags
node_svc_comments -->|"uses"| node_repo_comments
node_route_profiles -->|"reads"| node_repo_profiles
node_route_tags -->|"reads"| node_repo_tags
node_route_users -->|"authenticates"| node_svc_auth
node_repo_articles -->|"executes"| node_queries
node_repo_comments -->|"executes"| node_queries
node_repo_profiles -->|"executes"| node_queries
node_repo_tags -->|"executes"| node_queries
node_repo_users -->|"executes"| node_queries
node_queries -->|"loads"| node_sql_files
node_queries -.->|"aligns with"| node_migrations
node_svc_articles -->|"uses"| node_domain_models
node_svc_comments -->|"uses"| node_domain_models
node_repo_articles -->|"returns"| node_domain_models
node_repo_comments -->|"returns"| node_domain_models
node_api_router -->|"serializes"| node_api_schemas
node_route_auth -->|"serializes"| node_api_schemas
node_resources -.->|"messages"| node_api_errors
node_tests_api -.->|"covers"| node_api_router
node_tests_api -.->|"covers"| node_api_errors
node_tests_db -.->|"covers"| node_queries
node_tests_db -.->|"covers"| node_migrations
node_tests_schemas -.->|"covers"| node_domain_models
node_tests_services -.->|"covers"| node_svc_jwt

click node_app_main "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/main.py"
click node_core_config "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/core"
click node_settings_env "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/core/settings"
click node_api_router "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/api.py"
click node_route_articles "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/api/routes/articles"
click node_route_auth "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/authentication.py"
click node_route_comments "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/comments.py"
click node_route_profiles "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/profiles.py"
click node_route_tags "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/tags.py"
click node_route_users "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/users.py"
click node_api_errors "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/api/errors"
click node_api_deps "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/api/dependencies"
click node_svc_articles "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/articles.py"
click node_svc_comments "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/comments.py"
click node_svc_auth "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/authentication.py"
click node_svc_jwt "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/jwt.py"
click node_svc_security "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/security.py"
click node_repo_articles "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/articles.py"
click node_repo_comments "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/comments.py"
click node_repo_profiles "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/profiles.py"
click node_repo_tags "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/tags.py"
click node_repo_users "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/users.py"
click node_queries "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/queries/queries.py"
click node_sql_files "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/db/queries/sql"
click node_migrations "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/db/migrations"
click node_domain_models "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/models/domain"
click node_api_schemas "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/models/schemas"
click node_resources "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/resources/strings.py"
click node_tests_api "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/tests/test_api"
click node_tests_db "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/tests/test_db"
click node_tests_schemas "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/tests/test_schemas"
click node_tests_services "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/tests/test_services"
click node_docker "https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/Dockerfile"
click node_ci "https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/.github/workflows"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_main,node_core_config,node_settings_env,node_api_router,node_route_articles,node_route_auth,node_route_comments,node_route_profiles,node_route_tags,node_route_users,node_api_errors,node_api_deps,node_svc_articles,node_svc_comments,node_svc_auth,node_svc_jwt,node_svc_security,node_resources toneBlue
class node_repo_articles,node_repo_comments,node_repo_profiles,node_repo_tags,node_repo_users,node_queries,node_sql_files,node_migrations toneAmber
class node_domain_models,node_api_schemas toneMint
class node_tests_api,node_tests_db,node_tests_schemas,node_tests_services toneRose
class node_docker,node_ci toneIndigo
```

## Components

### App runtime

FastAPI application layers and runtime bootstrapping.

- [Main app](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/main.py): fastapi entrypoint · Application entrypoint and startup wiring. · `app/main.py`
- [Core config](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/core): startup config · Environment settings, logging, and app event hooks. · `app/core`
- [Env settings](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/core/settings): runtime settings · Development, production, and test configuration variants. · `app/core/settings`
- [API router](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/api.py): route aggregator · Top-level REST surface composition. · `app/api/routes/api.py`
- [Articles API](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/api/routes/articles): REST routes · Article endpoints and article resource flow. · `app/api/routes/articles`
- [Auth API](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/authentication.py): REST routes · Authentication, login, and registration endpoints. · `app/api/routes/authentication.py`
- [Comments API](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/comments.py): REST routes · Comment endpoints. · `app/api/routes/comments.py`
- [Profiles API](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/profiles.py): REST routes · Profile and follow endpoints. · `app/api/routes/profiles.py`
- [Tags API](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/tags.py): REST routes · Tag listing endpoints. · `app/api/routes/tags.py`
- [Users API](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/api/routes/users.py): REST routes · User account endpoints. · `app/api/routes/users.py`
- [API errors](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/api/errors): error handling · HTTP and validation error normalization. · `app/api/errors`
- [Deps](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/api/dependencies): request wiring · Request-scoped dependency injection for routes. · `app/api/dependencies`
- [Articles svc](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/articles.py): business logic · Article workflows and orchestration. · `app/services/articles.py`
- [Comments svc](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/comments.py): business logic · Comment workflows and orchestration. · `app/services/comments.py`
- [Auth svc](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/authentication.py): business logic · Credential validation and authentication orchestration. · `app/services/authentication.py`
- [JWT svc](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/jwt.py): token logic · JWT creation and verification. · `app/services/jwt.py`
- [Security](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/services/security.py): security helpers · Password and auth security helpers. · `app/services/security.py`
- [Strings](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/resources/strings.py): shared resources · Centralized user-facing messages and response text. · `app/resources/strings.py`

### Data layer

PostgreSQL access, queries, and migrations.

- [Articles repo](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/articles.py): postgres repo · Article persistence boundary. · `app/db/repositories/articles.py`
- [Comments repo](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/comments.py): postgres repo · Comment persistence boundary. · `app/db/repositories/comments.py`
- [Profiles repo](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/profiles.py): postgres repo · Profile persistence and lookup. · `app/db/repositories/profiles.py`
- [Tags repo](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/tags.py): postgres repo · Tag persistence and lookup. · `app/db/repositories/tags.py`
- [Users repo](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/repositories/users.py): postgres repo · User persistence boundary. · `app/db/repositories/users.py`
- [Queries](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/app/db/queries/queries.py): sql abstraction · Database query abstraction used by repositories. · `app/db/queries/queries.py`
- [SQL files](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/db/queries/sql): sql statements · Domain SQL grouped by area. · `app/db/queries/sql`
- [Migrations](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/db/migrations): alembic · Explicit database schema evolution. · `app/db/migrations`

### Models

Internal domain objects and external API schemas.

- [Domain models](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/models/domain): internal models · Business-domain objects shared by services and persistence. · `app/models/domain`
- [API schemas](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/app/models/schemas): request/response schemas · External contract for requests and responses. · `app/models/schemas`

### Tests

Representative test coverage for API, DB, schemas, and services.

- [API tests](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/tests/test_api): pytest suite · Route and error handling coverage. · `tests/test_api`
- [DB tests](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/tests/test_db): pytest suite · Query and table behavior coverage. · `tests/test_db`
- [Schema tests](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/tests/test_schemas): pytest suite · Domain and schema model validation coverage. · `tests/test_schemas`
- [Service tests](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/tests/test_services): pytest suite · JWT service behavior coverage. · `tests/test_services`

### Ops

Container, workflow, and API tooling around the app.

- [Container](https://github.com/nsidnev/fastapi-realworld-example-app/tree/master/Dockerfile): runtime packaging · Docker and compose packaging for local/runtime deployment. · `Dockerfile`
- [CI workflows](https://github.com/nsidnev/fastapi-realworld-example-app/blob/master/.github/workflows): automation · GitHub Actions for tests, linting, styles, and deploy. · `.github/workflows`

## Connections

- Main app → Core config: bootstraps · Main application loads core startup behavior.
- Core config → Env settings: selects · Core config chooses environment-specific settings.
- Main app → API router: mounts · Application exposes the aggregated API router.
- API router → Articles API: includes · API surface includes article routes.
- API router → Auth API: includes · API surface includes auth routes.
- API router → Comments API: includes · API surface includes comment routes.
- API router → Profiles API: includes · API surface includes profile routes.
- API router → Tags API: includes · API surface includes tag routes.
- API router → Users API: includes · API surface includes user routes.
- Articles API → Deps: uses · Routes resolve request-scoped dependencies.
- Auth API → Deps: uses · Routes resolve request-scoped dependencies.
- Comments API → Deps: uses · Routes resolve request-scoped dependencies.
- Profiles API → Deps: uses · Routes resolve request-scoped dependencies.
- Users API → Deps: uses · Routes resolve request-scoped dependencies.
- Deps → Articles svc: wires · Dependencies connect routes to article logic.
- Deps → Comments svc: wires · Dependencies connect routes to comment logic.
- Deps → Auth svc: wires · Dependencies connect routes to auth logic.
- Deps → Users repo: wires · Dependencies provide database-backed user access.
- API errors → API router: guards · API error handling normalizes route failures.
- Auth svc → Security: calls · Authentication uses security helpers.
- Auth svc → JWT svc: issues · Authentication creates and validates JWTs.
- Auth svc → Users repo: reads/writes · Auth logic verifies and updates user records.
- Articles svc → Articles repo: uses · Article workflows persist through article repository.
- Articles svc → Tags repo: uses · Article workflows depend on tags data.
- Comments svc → Comments repo: uses · Comment workflows persist through comment repository.
- Profiles API → Profiles repo: reads · Profile routes resolve profile data.
- Tags API → Tags repo: reads · Tag routes resolve tag data.
- Users API → Auth svc: authenticates · User routes depend on authentication context.
- Articles repo → Queries: executes · Repositories execute through the query abstraction.
- Comments repo → Queries: executes · Repositories execute through the query abstraction.
- Profiles repo → Queries: executes · Repositories execute through the query abstraction.
- Tags repo → Queries: executes · Repositories execute through the query abstraction.
- Users repo → Queries: executes · Repositories execute through the query abstraction.
- Queries → SQL files: loads · Query layer is backed by domain SQL files.
- Queries → Migrations: aligns with · Queries operate against the migrated schema.
- Articles svc → Domain models: uses · Services manipulate internal domain objects.
- Comments svc → Domain models: uses · Services manipulate internal domain objects.
- Articles repo → Domain models: returns · Repositories map database records into domain objects.
- Comments repo → Domain models: returns · Repositories map database records into domain objects.
- API router → API schemas: serializes · Routes expose API schemas to clients.
- Auth API → API schemas: serializes · Auth routes use request/response schemas.
- Strings → API errors: messages · Shared text supports consistent error responses.
- API tests → API router: covers · API tests exercise route behavior.
- API tests → API errors: covers · API tests exercise error handling.
- DB tests → Queries: covers · DB tests verify query behavior.
- DB tests → Migrations: covers · DB tests verify schema expectations.
- Schema tests → Domain models: covers · Schema tests validate shared model behavior.
- Service tests → JWT svc: covers · Service tests exercise JWT logic.
