# tabassumfathima28/crud_api architecture

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

- Interactive diagram: https://gitdiagram.com/tabassumfathima28/crud_api
- Repository: https://github.com/tabassumfathima28/crud_api

## Overview

#### Purpose and runtime
This repository is a small Python CRUD API for managing tasks. It runs as a FastAPI application served by Uvicorn; task data is intentionally in-memory and disappears on process restart.

- Application module and ASGI entry point: `main.py`
- Python dependencies: `requirements.txt`
- Run command: `python -m uvicorn main:app --reload`

#### Application entry point
`main.py` defines the FastAPI `app` object consumed by Uvicorn. FastAPI also exposes generated OpenAPI/Swagger documentation, available at `/docs` while the server is running.

#### HTTP interface
The API boundary is REST-style HTTP routes implemented in `main.py`:

- Service/basic availability: `GET /` and `GET /health`
- Collection operations: `GET /tasks`, `POST /tasks`
- Item operations: `GET /tasks/{task_id}`, `PUT /tasks/{task_id}`, `DELETE /tasks/{task_id}`

FastAPI handles request routing, request/body validation where declared, JSON response serialization, and interactive API documentation.

#### Task lifecycle flow
A client submits task data through `POST /tasks`; the application creates and retains a task in process memory. Clients retrieve either the task collection or an individual task, update an existing task by ID, or delete it by ID. The task ID path parameter forms the key boundary between collection-level and item-level operations.

- Route handlers and task state: `main.py`

#### State and persistence boundary
The sole data store is application memory owned by the running Python process. There is no database, cache, message queue, filesystem persistence, or external service integration represented in the repository. Restarting Uvicorn resets all tasks; deployment scaling to multiple processes/instances would likewise require replacing or coordinating this local state.

- In-memory implementation location: `main.py`

#### Infrastructure and dependencies
The runtime stack is Python, FastAPI, and Uvicorn. Uvicorn is the ASGI server accepting HTTP traffic and invoking the FastAPI application. Dependency versions and installable packages are defined in `requirements.txt`.

- Runtime entry/module: `main.py`
- Dependency manifest: `requirements.txt`

Main entry points: [`main.py`](https://github.com/tabassumfathima28/crud_api/blob/main/main.py) (FastAPI App), [`requirements.txt`](https://github.com/tabassumfathima28/crud_api/blob/main/requirements.txt) (Dependencies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Python API Runtime"]
  node_uvicorn{{"Uvicorn<br/>ASGI server"}}
  node_fastapi_app["FastAPI App<br/>[main.py]"]
  node_task_state[("Task State<br/>in-memory store<br/>[main.py]")]
  node_requirements["Dependencies<br/>Python manifest<br/>[requirements.txt]"]
end

subgraph group_api["HTTP API"]
  node_docs["Swagger Docs<br/>OpenAPI UI<br/>[main.py]"]
  node_availability_routes["Availability Routes<br/>GET /, GET /health<br/>[main.py]"]
  node_task_collection_routes["Task Collection Routes<br/>GET /tasks, POST /tasks<br/>[main.py]"]
  node_task_item_routes["Task Item Routes<br/>GET/PUT/DELETE /tasks/&#123;task_id&#125;<br/>[main.py]"]
end

node_client(("API Client<br/>external client"))

node_client -->|"HTTP requests"| node_uvicorn
node_uvicorn -->|"ASGI invocation"| node_fastapi_app
node_fastapi_app -->|"serves /docs"| node_docs
node_fastapi_app -->|"routes"| node_availability_routes
node_fastapi_app -->|"routes"| node_task_collection_routes
node_fastapi_app -->|"routes"| node_task_item_routes
node_task_collection_routes -->|"list and create"| node_task_state
node_task_item_routes -->|"read, update, delete by ID"| node_task_state
node_requirements -.->|"provides"| node_uvicorn
node_requirements -.->|"provides"| node_fastapi_app

click node_fastapi_app "https://github.com/tabassumfathima28/crud_api/blob/main/main.py"
click node_docs "https://github.com/tabassumfathima28/crud_api/blob/main/main.py"
click node_availability_routes "https://github.com/tabassumfathima28/crud_api/blob/main/main.py"
click node_task_collection_routes "https://github.com/tabassumfathima28/crud_api/blob/main/main.py"
click node_task_item_routes "https://github.com/tabassumfathima28/crud_api/blob/main/main.py"
click node_task_state "https://github.com/tabassumfathima28/crud_api/blob/main/main.py"
click node_requirements "https://github.com/tabassumfathima28/crud_api/blob/main/requirements.txt"

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_uvicorn,node_fastapi_app,node_task_state,node_requirements toneBlue
class node_docs,node_availability_routes,node_task_collection_routes,node_task_item_routes toneAmber
class node_client toneNeutral
```

## Components

### Python API Runtime

- **Uvicorn**: ASGI server · Runs main:app and accepts HTTP traffic.
- [FastAPI App](https://github.com/tabassumfathima28/crud_api/blob/main/main.py): application · ASGI application and OpenAPI documentation provider. · `main.py`
- [Task State](https://github.com/tabassumfathima28/crud_api/blob/main/main.py): in-memory store · Process-local state is lost on restart. · `main.py`
- [Dependencies](https://github.com/tabassumfathima28/crud_api/blob/main/requirements.txt): Python manifest · Defines FastAPI, Uvicorn, and installable packages. · `requirements.txt`

### HTTP API

- [Swagger Docs](https://github.com/tabassumfathima28/crud_api/blob/main/main.py): OpenAPI UI · Available at /docs while the application runs. · `main.py`
- [Availability Routes](https://github.com/tabassumfathima28/crud_api/blob/main/main.py): GET /, GET /health · `main.py`
- [Task Collection Routes](https://github.com/tabassumfathima28/crud_api/blob/main/main.py): GET /tasks, POST /tasks · `main.py`
- [Task Item Routes](https://github.com/tabassumfathima28/crud_api/blob/main/main.py): GET/PUT/DELETE /tasks/{task_id} · The task_id path parameter selects task state. · `main.py`

### Other components

- **API Client**: external client

## Connections

- API Client → Uvicorn: HTTP requests
- Uvicorn → FastAPI App: ASGI invocation
- FastAPI App → Swagger Docs: serves /docs
- FastAPI App → Availability Routes: routes
- FastAPI App → Task Collection Routes: routes
- FastAPI App → Task Item Routes: routes
- Task Collection Routes → Task State: list and create
- Task Item Routes → Task State: read, update, delete by ID
- Dependencies → Uvicorn: provides
- Dependencies → FastAPI App: provides
