# starflicks/project_cs311 architecture

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

- Interactive diagram: https://gitdiagram.com/starflicks/project_cs311
- Repository: https://github.com/starflicks/project_cs311

## Overview

Project CS311 is a desktop COVID-19 information and account application. A user interacts with its Tkinter interface to register or log in, then view national and province-level case statistics; the same application includes password recovery and a rule-based chatbot. Account operations use a local SQLite database, recovery sends a verification code through Gmail SMTP, and case data comes from Thailand’s public health API. The single-file tree supports these feature areas, but omitted source limits certainty about some callback wiring.

Main entry points: [`ProjectCS311.py`](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py) (Account Handlers), [`projectcs311_database.db`](https://github.com/starflicks/project_cs311/blob/main/projectcs311_database.db) (Account Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts"]
  node_account_handlers["Account Handlers<br/>[ProjectCS311.py]"]
  node_registration["Registration<br/>[ProjectCS311.py]"]
  node_login["Login<br/>[ProjectCS311.py]"]
  node_password_recovery["Password Recovery<br/>[ProjectCS311.py]"]
  node_account_store[("Account Database")]
  node_smtp["Gmail SMTP"]
end

subgraph group_covid["COVID Information"]
  node_dashboard["Case Dashboard<br/>[ProjectCS311.py]"]
  node_national_cases["National Cases<br/>[ProjectCS311.py]"]
  node_province_cases["Province Cases<br/>[ProjectCS311.py]"]
  node_health_api["Thai Health API"]
end

subgraph group_support["User Support"]
  node_chatbot["COVID Chatbot<br/>[ProjectCS311.py]"]
end

node_user(("User"))
node_desktop_app["Desktop Interface<br/>[ProjectCS311.py]"]

node_user -->|"uses"| node_desktop_app
node_desktop_app -->|"dispatches actions"| node_account_handlers
node_account_handlers -->|"routes registration"| node_registration
node_account_handlers -->|"routes login"| node_login
node_account_handlers -->|"routes recovery"| node_password_recovery
node_registration -->|"checks and writes"| node_account_store
node_login -->|"checks credentials"| node_account_store
node_password_recovery -->|"checks account"| node_account_store
node_password_recovery -->|"sends code"| node_smtp
node_desktop_app -->|"opens dashboard"| node_dashboard
node_dashboard -->|"loads statistics"| node_national_cases
node_dashboard -->|"requests case data"| node_health_api
node_dashboard -->|"selects province"| node_province_cases
node_province_cases -->|"requests province data"| node_health_api
node_desktop_app -->|"dispatches messages"| node_chatbot
node_chatbot -->|"displays guidance"| node_user

click node_desktop_app "https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py"
click node_account_handlers "https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py"
click node_registration "https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py"
click node_login "https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py"
click node_password_recovery "https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py"
click node_account_store "https://github.com/starflicks/project_cs311/blob/main/projectcs311_database.db"
click node_dashboard "https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py"
click node_national_cases "https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py"
click node_province_cases "https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py"
click node_chatbot "https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.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_account_handlers,node_registration,node_login,node_password_recovery,node_account_store,node_smtp,node_user toneBlue
class node_dashboard,node_national_cases,node_province_cases,node_health_api toneAmber
class node_chatbot toneMint
class node_desktop_app toneTeal
```

## Components

### Accounts

- [Account Handlers](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py): `ProjectCS311.py`
- [Registration](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py): `ProjectCS311.py`
- [Login](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py): `ProjectCS311.py`
- [Password Recovery](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py): `ProjectCS311.py`
- [Account Database](https://github.com/starflicks/project_cs311/blob/main/projectcs311_database.db): `projectcs311_database.db`
- **Gmail SMTP**

### COVID Information

- [Case Dashboard](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py): `ProjectCS311.py`
- [National Cases](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py): `ProjectCS311.py`
- [Province Cases](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py): `ProjectCS311.py`
- **Thai Health API**

### User Support

- [COVID Chatbot](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py): `ProjectCS311.py`

### Other components

- **User**
- [Desktop Interface](https://github.com/starflicks/project_cs311/blob/main/ProjectCS311.py): `ProjectCS311.py`

## Connections

- User → Desktop Interface: uses
- Desktop Interface → Account Handlers: dispatches actions
- Account Handlers → Registration: routes registration
- Account Handlers → Login: routes login
- Account Handlers → Password Recovery: routes recovery
- Registration → Account Database: checks and writes
- Login → Account Database: checks credentials
- Password Recovery → Account Database: checks account
- Password Recovery → Gmail SMTP: sends code
- Desktop Interface → Case Dashboard: opens dashboard
- Case Dashboard → National Cases: loads statistics
- Case Dashboard → Thai Health API: requests case data
- Case Dashboard → Province Cases: selects province
- Province Cases → Thai Health API: requests province data
- Desktop Interface → COVID Chatbot: dispatches messages
- COVID Chatbot → User: displays guidance
