# gamestar911/todocker architecture

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

- Interactive diagram: https://gitdiagram.com/gamestar911/todocker
- Repository: https://github.com/gamestar911/todocker

## Overview

This Flask application supports account-based and API-driven CSV classification, plus analysis history, API-key management, password recovery, and a Grok-backed chatbot. The main workflow is upload, validate and train, then return accuracy and a confusion matrix for display. The sampled code shows the Flask routes and runner; some documented capabilities are represented at their supported enclosing path because their implementation details were not sampled.

Main entry points: [`app.py`](https://github.com/gamestar911/todocker/blob/main/app.py) (Flask routes), [`logistics_runner.py`](https://github.com/gamestar911/todocker/blob/main/logistics_runner.py) (Classification runner), [`static/js/dashboard.js`](https://github.com/gamestar911/todocker/blob/main/static/js/dashboard.js) (Analysis client), [`static/js/chatbot.js`](https://github.com/gamestar911/todocker/blob/main/static/js/chatbot.js) (Chat screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Browser UI<br/>[dashboard.html]"]
  node_dashboard["Analysis client<br/>[dashboard.js]"]
  node_flask["Flask routes<br/>[app.py]"]
  node_auth_ui["Account screens<br/>[form2.html]"]
end

subgraph group_analysis["Dataset analysis"]
  node_runner["Classification runner"]
end

subgraph group_accounts["Accounts and data"]
  node_api_auth["API-key validation<br/>[app.py]"]
  node_models["Account and analysis records<br/>[app.py]"]
  node_database[("SQL database")]
  node_recovery["Password recovery<br/>[app.py]"]
  node_mail["Email delivery<br/>[app.py]"]
  node_history["Analysis history"]
  node_keys_ui["API-key screens<br/>[api_keys.html]"]
end

subgraph group_assistant["AI assistant"]
  node_chat_ui["Chat screen<br/>[chatbot.js]"]
  node_chat_route["Chat endpoint<br/>[app.py]"]
  node_grok{{"Grok service"}}
end

node_user(("User"))
node_api_client(("API client"))

node_user -->|"uses"| node_browser
node_browser -->|"loads"| node_dashboard
node_dashboard -->|"posts dataset"| node_flask
node_flask -->|"runs experiment"| node_runner
node_runner -->|"returns metrics"| node_flask
node_flask -->|"returns results"| node_dashboard
node_api_client -->|"submits dataset"| node_api_auth
node_api_auth -->|"validates key"| node_models
node_api_auth -->|"runs experiment"| node_runner
node_runner -->|"returns metrics"| node_api_auth
node_user -->|"uses"| node_auth_ui
node_auth_ui -->|"submits credentials"| node_flask
node_flask -->|"reads and writes"| node_models
node_flask -->|"handles reset"| node_recovery
node_recovery -->|"sends reset message"| node_mail
node_mail -.->|"delivers email"| node_user
node_user -->|"views records"| node_history
node_history -->|"requests history"| node_flask
node_flask -->|"loads history"| node_models
node_user -->|"manages keys"| node_keys_ui
node_keys_ui -->|"requests key actions"| node_flask
node_flask -->|"stores key records"| node_models
node_models -->|"reads and writes"| node_database
node_user -->|"asks question"| node_chat_ui
node_chat_ui -->|"posts message"| node_chat_route
node_chat_route -->|"sends prompt"| node_grok
node_grok -->|"returns response"| node_chat_route
node_chat_route -->|"returns answer"| node_chat_ui

click node_browser "https://github.com/gamestar911/todocker/blob/main/templates/dashboard.html"
click node_dashboard "https://github.com/gamestar911/todocker/blob/main/static/js/dashboard.js"
click node_flask "https://github.com/gamestar911/todocker/blob/main/app.py"
click node_runner "https://github.com/gamestar911/todocker/blob/main/logistics_runner.py"
click node_api_auth "https://github.com/gamestar911/todocker/blob/main/app.py"
click node_models "https://github.com/gamestar911/todocker/blob/main/app.py"
click node_auth_ui "https://github.com/gamestar911/todocker/blob/main/templates/form2.html"
click node_recovery "https://github.com/gamestar911/todocker/blob/main/app.py"
click node_mail "https://github.com/gamestar911/todocker/blob/main/app.py"
click node_history "https://github.com/gamestar911/todocker/blob/main/templates/analysis_history.html"
click node_keys_ui "https://github.com/gamestar911/todocker/blob/main/templates/api_keys.html"
click node_chat_ui "https://github.com/gamestar911/todocker/blob/main/static/js/chatbot.js"
click node_chat_route "https://github.com/gamestar911/todocker/blob/main/app.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_browser,node_dashboard,node_flask,node_auth_ui,node_user,node_api_client toneBlue
class node_runner toneAmber
class node_api_auth,node_models,node_database,node_recovery,node_mail,node_history,node_keys_ui toneMint
class node_chat_ui,node_chat_route,node_grok toneRose
```

## Components

### Web experience

- [Browser UI](https://github.com/gamestar911/todocker/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Analysis client](https://github.com/gamestar911/todocker/blob/main/static/js/dashboard.js): `static/js/dashboard.js`
- [Flask routes](https://github.com/gamestar911/todocker/blob/main/app.py): `app.py`
- [Account screens](https://github.com/gamestar911/todocker/blob/main/templates/form2.html): `templates/form2.html`

### Dataset analysis

- [Classification runner](https://github.com/gamestar911/todocker/blob/main/logistics_runner.py): `logistics_runner.py`

### Accounts and data

- [API-key validation](https://github.com/gamestar911/todocker/blob/main/app.py): `app.py`
- [Account and analysis records](https://github.com/gamestar911/todocker/blob/main/app.py): `app.py`
- **SQL database**
- [Password recovery](https://github.com/gamestar911/todocker/blob/main/app.py): `app.py`
- [Email delivery](https://github.com/gamestar911/todocker/blob/main/app.py): `app.py`
- [Analysis history](https://github.com/gamestar911/todocker/blob/main/templates/analysis_history.html): `templates/analysis_history.html`
- [API-key screens](https://github.com/gamestar911/todocker/blob/main/templates/api_keys.html): `templates/api_keys.html`

### AI assistant

- [Chat screen](https://github.com/gamestar911/todocker/blob/main/static/js/chatbot.js): `static/js/chatbot.js`
- [Chat endpoint](https://github.com/gamestar911/todocker/blob/main/app.py): `app.py`
- **Grok service**

### Other components

- **User**
- **API client**

## Connections

- User → Browser UI: uses
- Browser UI → Analysis client: loads
- Analysis client → Flask routes: posts dataset
- Flask routes → Classification runner: runs experiment
- Classification runner → Flask routes: returns metrics
- Flask routes → Analysis client: returns results
- API client → API-key validation: submits dataset
- API-key validation → Account and analysis records: validates key
- API-key validation → Classification runner: runs experiment
- Classification runner → API-key validation: returns metrics
- User → Account screens: uses
- Account screens → Flask routes: submits credentials
- Flask routes → Account and analysis records: reads and writes
- Flask routes → Password recovery: handles reset
- Password recovery → Email delivery: sends reset message
- Email delivery → User: delivers email
- User → Analysis history: views records
- Analysis history → Flask routes: requests history
- Flask routes → Account and analysis records: loads history
- User → API-key screens: manages keys
- API-key screens → Flask routes: requests key actions
- Flask routes → Account and analysis records: stores key records
- Account and analysis records → SQL database: reads and writes
- User → Chat screen: asks question
- Chat screen → Chat endpoint: posts message
- Chat endpoint → Grok service: sends prompt
- Grok service → Chat endpoint: returns response
- Chat endpoint → Chat screen: returns answer
