# ty2k04/multitenant-todo-task architecture

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

- Interactive diagram: https://gitdiagram.com/ty2k04/multitenant-todo-task
- Repository: https://github.com/ty2k04/multitenant-todo-task

## Overview

This repository is a Dockerized, multi-user todo application. The user workflow is browser UI → Nginx entry point → Flask API: users register or log in, then manage private todos and view statistics or notifications; MySQL persists application data. A separate worker polls todos and creates notifications. The README documents the service roles and product capabilities, while the sampled API and worker source confirms their database operations. Frontend-to-API routing details are not shown in the excerpts, so that relationship is marked unverified. CI/CD is omitted as delivery infrastructure.

Main entry points: [`db/init.sql`](https://github.com/ty2k04/multitenant-todo-task/blob/main/db/init.sql) (MySQL Data), [`frontend/index.html`](https://github.com/ty2k04/multitenant-todo-task/blob/main/frontend/index.html) (Web UI), [`proxy/nginx.conf`](https://github.com/ty2k04/multitenant-todo-task/blob/main/proxy/nginx.conf) (Nginx Proxy), [`api/app.py`](https://github.com/ty2k04/multitenant-todo-task/blob/main/api/app.py) (Registration & Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["User Access"]
  node_frontend["Web UI<br/>[index.html]"]
  node_proxy["Nginx Proxy<br/>[nginx.conf]"]
end

subgraph group_api["Todo API"]
  node_auth["Registration &amp; Login<br/>[app.py]"]
  node_todos["Todo Operations<br/>[app.py]"]
  node_stats["User Statistics<br/>[app.py]"]
  node_notifications["Notification API<br/>[app.py]"]
end

subgraph group_persistence["Persistence"]
  node_database[("MySQL Data<br/>[init.sql]")]
end

subgraph group_background["Background Activity"]
  node_worker["Activity Worker<br/>[worker.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_frontend
node_frontend -->|"enters via"| node_proxy
node_proxy -->|"serves UI"| node_frontend
node_proxy -.->|"routes requests"| node_auth
node_frontend -.->|"calls API"| node_auth
node_auth -->|"reads/writes"| node_database
node_todos -->|"reads/writes"| node_database
node_stats -->|"queries"| node_database
node_notifications -->|"queries"| node_database
node_worker -->|"reads/writes"| node_database

click node_frontend "https://github.com/ty2k04/multitenant-todo-task/blob/main/frontend/index.html"
click node_proxy "https://github.com/ty2k04/multitenant-todo-task/blob/main/proxy/nginx.conf"
click node_auth "https://github.com/ty2k04/multitenant-todo-task/blob/main/api/app.py"
click node_todos "https://github.com/ty2k04/multitenant-todo-task/blob/main/api/app.py"
click node_stats "https://github.com/ty2k04/multitenant-todo-task/blob/main/api/app.py"
click node_notifications "https://github.com/ty2k04/multitenant-todo-task/blob/main/api/app.py"
click node_database "https://github.com/ty2k04/multitenant-todo-task/blob/main/db/init.sql"
click node_worker "https://github.com/ty2k04/multitenant-todo-task/blob/main/worker/worker.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_frontend,node_proxy,node_user toneBlue
class node_auth,node_todos,node_stats,node_notifications toneAmber
class node_database toneMint
class node_worker toneRose
```

## Components

### User Access

- [Web UI](https://github.com/ty2k04/multitenant-todo-task/blob/main/frontend/index.html): `frontend/index.html`
- [Nginx Proxy](https://github.com/ty2k04/multitenant-todo-task/blob/main/proxy/nginx.conf): `proxy/nginx.conf`

### Todo API

- [Registration & Login](https://github.com/ty2k04/multitenant-todo-task/blob/main/api/app.py): `api/app.py`
- [Todo Operations](https://github.com/ty2k04/multitenant-todo-task/blob/main/api/app.py): `api/app.py`
- [User Statistics](https://github.com/ty2k04/multitenant-todo-task/blob/main/api/app.py): `api/app.py`
- [Notification API](https://github.com/ty2k04/multitenant-todo-task/blob/main/api/app.py): `api/app.py`

### Persistence

- [MySQL Data](https://github.com/ty2k04/multitenant-todo-task/blob/main/db/init.sql): `db/init.sql`

### Background Activity

- [Activity Worker](https://github.com/ty2k04/multitenant-todo-task/blob/main/worker/worker.py): `worker/worker.py`

### Other components

- **User**

## Connections

- User → Web UI: uses (evidence: `README.md`)
- Web UI → Nginx Proxy: enters via (evidence: `README.md`)
- Nginx Proxy → Web UI: serves UI (evidence: `README.md`)
- Nginx Proxy → Registration & Login: routes requests
- Web UI → Registration & Login: calls API
- Registration & Login → MySQL Data: reads/writes (evidence: `api/app.py`)
- Todo Operations → MySQL Data: reads/writes (evidence: `api/app.py`)
- User Statistics → MySQL Data: queries (evidence: `api/app.py`)
- Notification API → MySQL Data: queries (evidence: `api/app.py`)
- Activity Worker → MySQL Data: reads/writes (evidence: `worker/worker.py`)
