# bakkali-mohamed12/task_api architecture

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

- Interactive diagram: https://gitdiagram.com/bakkali-mohamed12/task_api
- Repository: https://github.com/bakkali-mohamed12/task_api

## Overview

Task API is a small FastAPI service: clients call its welcome, health, and task endpoints; task operations use Pydantic models and a process-local list. The README documents the endpoints and in-memory lifetime, while main.py shows the handlers and state mutations. The graph omits deployment and test tooling; it reflects only the runtime API. All runtime behavior is implemented in main.py.

Main entry points: [`main.py`](https://github.com/bakkali-mohamed12/task_api/blob/main/main.py) (Create task)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP API"]
  node_welcome["Welcome endpoint<br/>[main.py]"]
  node_health["Health endpoint<br/>[main.py]"]
  node_list["List tasks<br/>[main.py]"]
  node_create["Create task<br/>[main.py]"]
  node_complete["Complete task<br/>[main.py]"]
end

subgraph group_tasks["Task State"]
  node_models["Task models<br/>[main.py]"]
  node_memory[("In-memory tasks<br/>[main.py]")]
end

node_client(("API client"))

node_client -->|"GET /"| node_welcome
node_client -->|"GET /health"| node_health
node_client -->|"GET /tasks"| node_list
node_client -->|"POST /tasks"| node_create
node_client -->|"PATCH complete"| node_complete
node_list -->|"reads"| node_memory
node_create -->|"constructs"| node_models
node_create -->|"appends"| node_memory
node_complete -->|"searches and updates"| node_memory
node_complete -->|"copies task"| node_models

click node_welcome "https://github.com/bakkali-mohamed12/task_api/blob/main/main.py"
click node_health "https://github.com/bakkali-mohamed12/task_api/blob/main/main.py"
click node_list "https://github.com/bakkali-mohamed12/task_api/blob/main/main.py"
click node_create "https://github.com/bakkali-mohamed12/task_api/blob/main/main.py"
click node_complete "https://github.com/bakkali-mohamed12/task_api/blob/main/main.py"
click node_models "https://github.com/bakkali-mohamed12/task_api/blob/main/main.py"
click node_memory "https://github.com/bakkali-mohamed12/task_api/blob/main/main.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_welcome,node_health,node_list,node_create,node_complete,node_client toneBlue
class node_models,node_memory toneAmber
```

## Components

### HTTP API

- [Welcome endpoint](https://github.com/bakkali-mohamed12/task_api/blob/main/main.py): `main.py`
- [Health endpoint](https://github.com/bakkali-mohamed12/task_api/blob/main/main.py): `main.py`
- [List tasks](https://github.com/bakkali-mohamed12/task_api/blob/main/main.py): `main.py`
- [Create task](https://github.com/bakkali-mohamed12/task_api/blob/main/main.py): `main.py`
- [Complete task](https://github.com/bakkali-mohamed12/task_api/blob/main/main.py): `main.py`

### Task State

- [Task models](https://github.com/bakkali-mohamed12/task_api/blob/main/main.py): `main.py`
- [In-memory tasks](https://github.com/bakkali-mohamed12/task_api/blob/main/main.py): `main.py`

### Other components

- **API client**

## Connections

- API client → Welcome endpoint: GET / (evidence: `README.md`)
- API client → Health endpoint: GET /health (evidence: `README.md`)
- API client → List tasks: GET /tasks (evidence: `README.md`)
- API client → Create task: POST /tasks (evidence: `README.md`)
- API client → Complete task: PATCH complete (evidence: `README.md`)
- List tasks → In-memory tasks: reads (evidence: `main.py`)
- Create task → Task models: constructs (evidence: `main.py`)
- Create task → In-memory tasks: appends (evidence: `main.py`)
- Complete task → In-memory tasks: searches and updates (evidence: `main.py`)
- Complete task → Task models: copies task (evidence: `main.py`)
