# gtorrico-fs/task-manager-api architecture

> Architecture diagram of the GitHub repository gtorrico-fs/task-manager-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gtorrico-fs/task-manager-api
- Repository: https://github.com/gtorrico-fs/task-manager-api

## Overview

This is a small FastAPI task-management API. Its demonstrated workflow is an HTTP client submitting a validated task, the endpoint adding a creation timestamp and inserting it into MongoDB, then reading the inserted document and serializing it as the response. Configuration supplies app and database settings. The excerpts show task creation only; no README or source evidence documents other task operations. The MongoDB service is external.

Main entry points: [`api/v1/endpoints/create_task.py`](https://github.com/gtorrico-fs/task-manager-api/blob/main/api/v1/endpoints/create_task.py) (Create task), [`main.py`](https://github.com/gtorrico-fs/task-manager-api/blob/main/main.py) (FastAPI app), [`core/database.py`](https://github.com/gtorrico-fs/task-manager-api/blob/main/core/database.py) (Database access), [`api/v1/router.py`](https://github.com/gtorrico-fs/task-manager-api/blob/main/api/v1/router.py) (API router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API routing"]
  node_app["FastAPI app<br/>[main.py]"]
  node_router["API router<br/>[router.py]"]
end

subgraph group_task["Task creation"]
  node_create["Create task<br/>[create_task.py]"]
  node_schema["Task models<br/>[tasks.py]"]
  node_serializer["Task serializer<br/>[mongo.py]"]
end

subgraph group_storage["Persistence"]
  node_config["Settings<br/>[config.py]"]
  node_database["Database access<br/>[database.py]"]
  node_mongodb[("MongoDB")]
end

node_client(("HTTP client"))

node_client -->|"sends request"| node_app
node_app -->|"mounts routes"| node_router
node_app -->|"reads settings"| node_config
node_router -->|"loads endpoint"| node_create
node_create -->|"validates task"| node_schema
node_create -->|"gets collection"| node_database
node_create -->|"inserts and reads"| node_mongodb
node_create -->|"serializes result"| node_serializer
node_database -->|"reads settings"| node_config
node_database -->|"opens connection"| node_mongodb

click node_app "https://github.com/gtorrico-fs/task-manager-api/blob/main/main.py"
click node_router "https://github.com/gtorrico-fs/task-manager-api/blob/main/api/v1/router.py"
click node_create "https://github.com/gtorrico-fs/task-manager-api/blob/main/api/v1/endpoints/create_task.py"
click node_schema "https://github.com/gtorrico-fs/task-manager-api/blob/main/schemas/tasks.py"
click node_serializer "https://github.com/gtorrico-fs/task-manager-api/blob/main/utils/mongo.py"
click node_config "https://github.com/gtorrico-fs/task-manager-api/blob/main/core/config.py"
click node_database "https://github.com/gtorrico-fs/task-manager-api/blob/main/core/database.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_app,node_router,node_client toneBlue
class node_create,node_schema,node_serializer toneAmber
class node_config,node_database,node_mongodb toneMint
```

## Components

### API routing

- [FastAPI app](https://github.com/gtorrico-fs/task-manager-api/blob/main/main.py): `main.py`
- [API router](https://github.com/gtorrico-fs/task-manager-api/blob/main/api/v1/router.py): `api/v1/router.py`

### Task creation

- [Create task](https://github.com/gtorrico-fs/task-manager-api/blob/main/api/v1/endpoints/create_task.py): `api/v1/endpoints/create_task.py`
- [Task models](https://github.com/gtorrico-fs/task-manager-api/blob/main/schemas/tasks.py): `schemas/tasks.py`
- [Task serializer](https://github.com/gtorrico-fs/task-manager-api/blob/main/utils/mongo.py): `utils/mongo.py`

### Persistence

- [Settings](https://github.com/gtorrico-fs/task-manager-api/blob/main/core/config.py): `core/config.py`
- [Database access](https://github.com/gtorrico-fs/task-manager-api/blob/main/core/database.py): `core/database.py`
- **MongoDB**

### Other components

- **HTTP client**

## Connections

- HTTP client → FastAPI app: sends request
- FastAPI app → API router: mounts routes (evidence: `main.py`)
- FastAPI app → Settings: reads settings (evidence: `main.py`)
- API router → Create task: loads endpoint (evidence: `api/v1/router.py`)
- Create task → Task models: validates task (evidence: `api/v1/endpoints/create_task.py`)
- Create task → Database access: gets collection (evidence: `api/v1/endpoints/create_task.py`)
- Create task → MongoDB: inserts and reads (evidence: `api/v1/endpoints/create_task.py`)
- Create task → Task serializer: serializes result (evidence: `api/v1/endpoints/create_task.py`)
- Database access → Settings: reads settings (evidence: `core/database.py`)
- Database access → MongoDB: opens connection (evidence: `core/database.py`)
