# angel-ncf/apitask architecture

> Architecture diagram of the GitHub repository angel-ncf/apitask, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/angel-ncf/apitask
- Repository: https://github.com/angel-ncf/apitask

## Overview

This is a small FastAPI task-management API backed by MongoDB. A client submits task requests to the routes in `Api.py`; those routes validate task data, perform create/read/update/delete or list operations on the `local.tasks` collection, and convert stored documents to response dictionaries. `BD.py` configures the MongoDB client, while the model and schema modules define the task contract and document conversion. The README’s endpoint table is illustrative and differs from the implemented routes; no `main.py` appears in the supplied tree.

Main entry points: [`Api.py`](https://github.com/angel-ncf/apitask/blob/ApiTask/Api.py) (Task routes), [`DataBase/BD.py`](https://github.com/angel-ncf/apitask/blob/ApiTask/DataBase/BD.py) (Mongo client), [`DataBase/models/models.py`](https://github.com/angel-ncf/apitask/blob/ApiTask/DataBase/models/models.py) (Task models), [`DataBase/schemas/schema.py`](https://github.com/angel-ncf/apitask/blob/ApiTask/DataBase/schemas/schema.py) (Document conversion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Task API"]
  node_routes["Task routes<br/>[Api.py]"]
end

subgraph group_contracts["Task contracts"]
  node_task_models["Task models<br/>[models.py]"]
  node_task_schema["Document conversion<br/>[schema.py]"]
end

subgraph group_persistence["MongoDB persistence"]
  node_db_connection["Mongo client<br/>[BD.py]"]
  node_task_collection[("Tasks collection<br/>[Api.py]")]
end

node_client(("API client"))
node_mongodb[("MongoDB service")]

node_client -->|"calls routes"| node_routes
node_routes -->|"validates tasks"| node_task_models
node_routes -->|"reads and writes"| node_task_collection
node_routes -->|"converts documents"| node_task_schema
node_routes -->|"imports client"| node_db_connection
node_db_connection -->|"connects to"| node_mongodb

click node_routes "https://github.com/angel-ncf/apitask/blob/ApiTask/Api.py"
click node_task_models "https://github.com/angel-ncf/apitask/blob/ApiTask/DataBase/models/models.py"
click node_task_schema "https://github.com/angel-ncf/apitask/blob/ApiTask/DataBase/schemas/schema.py"
click node_db_connection "https://github.com/angel-ncf/apitask/blob/ApiTask/DataBase/BD.py"
click node_task_collection "https://github.com/angel-ncf/apitask/blob/ApiTask/Api.py"

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_routes,node_client toneBlue
class node_task_models,node_task_schema,node_mongodb toneAmber
class node_db_connection,node_task_collection toneMint
```

## Components

### Task API

- [Task routes](https://github.com/angel-ncf/apitask/blob/ApiTask/Api.py): `Api.py`

### Task contracts

- [Task models](https://github.com/angel-ncf/apitask/blob/ApiTask/DataBase/models/models.py): `DataBase/models/models.py`
- [Document conversion](https://github.com/angel-ncf/apitask/blob/ApiTask/DataBase/schemas/schema.py): `DataBase/schemas/schema.py`

### MongoDB persistence

- [Mongo client](https://github.com/angel-ncf/apitask/blob/ApiTask/DataBase/BD.py): `DataBase/BD.py`
- [Tasks collection](https://github.com/angel-ncf/apitask/blob/ApiTask/Api.py): `Api.py`

### Other components

- **API client**
- **MongoDB service**

## Connections

- API client → Task routes: calls routes (evidence: `Api.py`)
- Task routes → Task models: validates tasks (evidence: `Api.py`)
- Task routes → Tasks collection: reads and writes (evidence: `Api.py`)
- Task routes → Document conversion: converts documents (evidence: `Api.py`)
- Task routes → Mongo client: imports client (evidence: `Api.py`)
- Mongo client → MongoDB service: connects to (evidence: `DataBase/BD.py`)
