# marian2022/twaaos architecture

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

- Interactive diagram: https://gitdiagram.com/marian2022/twaaos
- Repository: https://github.com/marian2022/twaaos

## Overview

The repository contains two small FastAPI products: an in-memory product inventory in lab02 and successive task-manager applications in lab03–lab05. The task-manager workflow covers account registration and sign-in, JWT-protected user/task operations, and SQLite persistence; lab04 and lab05 also include browser pages. The sampled code supports these flows, but the HTML excerpts and README are unavailable, so browser-to-API links are not asserted. The later task-manager versions are shown separately because their source files are distinct.

Main entry points: [`lab03/main.py`](https://github.com/marian2022/twaaos/blob/main/lab03/main.py) (Task operations), [`lab04/main.py`](https://github.com/marian2022/twaaos/blob/main/lab04/main.py) (Task operations), [`lab05/main.py`](https://github.com/marian2022/twaaos/blob/main/lab05/main.py) (Task operations), [`lab02/main.py`](https://github.com/marian2022/twaaos/blob/main/lab02/main.py) (Product endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inventory["Inventory API"]
  node_inventory_api["Product endpoints<br/>[main.py]"]
  node_inventory_state["In-memory inventory<br/>[main.py]"]
end

subgraph group_taskapis["Task manager APIs"]
  node_lab03_auth["Auth and profile<br/>[main.py]"]
  node_lab03_tasks["Task operations<br/>[main.py]"]
  node_lab03_db[("SQLite data<br/>[sarcini.db]")]
  node_lab04_auth["Auth and profile<br/>[main.py]"]
  node_lab04_tasks["Task operations<br/>[main.py]"]
  node_lab04_db[("SQLite data<br/>[sarcini.db]")]
  node_lab05_auth["Auth and profile<br/>[main.py]"]
  node_lab05_tasks["Task operations<br/>[main.py]"]
  node_lab05_db[("SQLite data<br/>[main.py]")]
end

subgraph group_clients["Browser clients"]
  node_lab04_page["Browser page<br/>[index.html]"]
  node_lab05_page["Browser page<br/>[index.html]"]
end

node_user(("API user"))

node_user -->|"manages products"| node_inventory_api
node_inventory_api -->|"reads and updates"| node_inventory_state
node_user -->|"registers and signs in"| node_lab03_auth
node_user -->|"manages tasks"| node_lab03_tasks
node_lab03_tasks -->|"requires identity"| node_lab03_auth
node_lab03_auth -->|"reads and writes"| node_lab03_db
node_lab03_tasks -->|"reads and writes"| node_lab03_db
node_user -->|"registers and signs in"| node_lab04_auth
node_user -->|"manages tasks"| node_lab04_tasks
node_lab04_tasks -->|"requires identity"| node_lab04_auth
node_lab04_auth -->|"reads and writes"| node_lab04_db
node_lab04_tasks -->|"reads and writes"| node_lab04_db
node_user -->|"registers and signs in"| node_lab05_auth
node_user -->|"manages tasks"| node_lab05_tasks
node_lab05_tasks -->|"requires identity"| node_lab05_auth
node_lab05_auth -->|"reads and writes"| node_lab05_db
node_lab05_tasks -->|"reads and writes"| node_lab05_db

click node_inventory_api "https://github.com/marian2022/twaaos/blob/main/lab02/main.py"
click node_inventory_state "https://github.com/marian2022/twaaos/blob/main/lab02/main.py"
click node_lab03_auth "https://github.com/marian2022/twaaos/blob/main/lab03/main.py"
click node_lab03_tasks "https://github.com/marian2022/twaaos/blob/main/lab03/main.py"
click node_lab03_db "https://github.com/marian2022/twaaos/blob/main/lab03/sarcini.db"
click node_lab04_auth "https://github.com/marian2022/twaaos/blob/main/lab04/main.py"
click node_lab04_tasks "https://github.com/marian2022/twaaos/blob/main/lab04/main.py"
click node_lab04_db "https://github.com/marian2022/twaaos/blob/main/lab04/sarcini.db"
click node_lab04_page "https://github.com/marian2022/twaaos/blob/main/lab04/index.html"
click node_lab05_auth "https://github.com/marian2022/twaaos/blob/main/lab05/main.py"
click node_lab05_tasks "https://github.com/marian2022/twaaos/blob/main/lab05/main.py"
click node_lab05_db "https://github.com/marian2022/twaaos/blob/main/lab05/main.py"
click node_lab05_page "https://github.com/marian2022/twaaos/blob/main/lab05/static/index.html"

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_inventory_api,node_inventory_state,node_user toneBlue
class node_lab03_auth,node_lab03_tasks,node_lab03_db,node_lab04_auth,node_lab04_tasks,node_lab04_db,node_lab05_auth,node_lab05_tasks,node_lab05_db toneAmber
class node_lab04_page,node_lab05_page toneMint
```

## Components

### Inventory API

- [Product endpoints](https://github.com/marian2022/twaaos/blob/main/lab02/main.py): `lab02/main.py`
- [In-memory inventory](https://github.com/marian2022/twaaos/blob/main/lab02/main.py): `lab02/main.py`

### Task manager APIs

- [Auth and profile](https://github.com/marian2022/twaaos/blob/main/lab03/main.py): `lab03/main.py`
- [Task operations](https://github.com/marian2022/twaaos/blob/main/lab03/main.py): `lab03/main.py`
- [SQLite data](https://github.com/marian2022/twaaos/blob/main/lab03/sarcini.db): `lab03/sarcini.db`
- [Auth and profile](https://github.com/marian2022/twaaos/blob/main/lab04/main.py): `lab04/main.py`
- [Task operations](https://github.com/marian2022/twaaos/blob/main/lab04/main.py): `lab04/main.py`
- [SQLite data](https://github.com/marian2022/twaaos/blob/main/lab04/sarcini.db): `lab04/sarcini.db`
- [Auth and profile](https://github.com/marian2022/twaaos/blob/main/lab05/main.py): `lab05/main.py`
- [Task operations](https://github.com/marian2022/twaaos/blob/main/lab05/main.py): `lab05/main.py`
- [SQLite data](https://github.com/marian2022/twaaos/blob/main/lab05/main.py): `lab05/main.py`

### Browser clients

- [Browser page](https://github.com/marian2022/twaaos/blob/main/lab04/index.html): `lab04/index.html`
- [Browser page](https://github.com/marian2022/twaaos/blob/main/lab05/static/index.html): `lab05/static/index.html`

### Other components

- **API user**

## Connections

- API user → Product endpoints: manages products (evidence: `lab02/main.py`)
- Product endpoints → In-memory inventory: reads and updates (evidence: `lab02/main.py`)
- API user → Auth and profile: registers and signs in (evidence: `lab03/main.py`)
- API user → Task operations: manages tasks (evidence: `lab03/main.py`)
- Task operations → Auth and profile: requires identity (evidence: `lab03/main.py`)
- Auth and profile → SQLite data: reads and writes (evidence: `lab03/main.py`)
- Task operations → SQLite data: reads and writes (evidence: `lab03/main.py`)
- API user → Auth and profile: registers and signs in (evidence: `lab04/main.py`)
- API user → Task operations: manages tasks (evidence: `lab04/main.py`)
- Task operations → Auth and profile: requires identity (evidence: `lab04/main.py`)
- Auth and profile → SQLite data: reads and writes (evidence: `lab04/main.py`)
- Task operations → SQLite data: reads and writes (evidence: `lab04/main.py`)
- API user → Auth and profile: registers and signs in (evidence: `lab05/main.py`)
- API user → Task operations: manages tasks (evidence: `lab05/main.py`)
- Task operations → Auth and profile: requires identity (evidence: `lab05/main.py`)
- Auth and profile → SQLite data: reads and writes (evidence: `lab05/main.py`)
- Task operations → SQLite data: reads and writes (evidence: `lab05/main.py`)
