# kennypark-167/reddot-python-desktop architecture

> Architecture diagram of the GitHub repository kennypark-167/reddot-python-desktop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kennypark-167/reddot-python-desktop
- Repository: https://github.com/kennypark-167/reddot-python-desktop

## Overview

REDDOT is a desktop, single-room chat client backed by a FastAPI service and SQL database. Users register or sign in, then send messages and receive updates through five-second polling; administrators can inspect and delete users and messages. The README also describes JWT authentication, timestamped history, and a dark-mode interface. The sampled client and server code supports the main HTTP, chat, and administration flows; database schema details and some client behavior are not shown, so those links rely on documented relationships.

Main entry points: [`server/main.py`](https://github.com/kennypark-167/reddot-python-desktop/blob/main/server/main.py) (HTTP API and routes), [`db/schema.sql`](https://github.com/kennypark-167/reddot-python-desktop/blob/main/db/schema.sql) (SQL database), [`client/app.py`](https://github.com/kennypark-167/reddot-python-desktop/blob/main/client/app.py) (Sign-in and registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop client"]
  node_auth_ui["Sign-in and registration<br/>[app.py]"]
  node_chat_ui["Chat room and polling<br/>[app.py]"]
  node_admin_ui["Admin console<br/>[app.py]"]
end

subgraph group_service["Chat service"]
  node_api["HTTP API and routes<br/>[main.py]"]
  node_auth["JWT and access control<br/>[main.py]"]
  node_chat["Message handling<br/>[main.py]"]
  node_admin["Admin operations<br/>[main.py]"]
end

subgraph group_storage["SQL storage"]
  node_db[("SQL database<br/>[schema.sql]")]
end

node_user(("Chat user"))

node_user -->|"registers or signs in"| node_auth_ui
node_user -->|"chats"| node_chat_ui
node_user -->|"administers"| node_admin_ui
node_auth_ui -->|"sends auth requests"| node_api
node_chat_ui -->|"sends and polls"| node_api
node_admin_ui -->|"requests admin data"| node_api
node_api -->|"validates protected routes"| node_auth
node_api -->|"handles message routes"| node_chat
node_api -->|"handles admin routes"| node_admin
node_auth -->|"reads users"| node_db
node_chat -->|"stores and reads messages"| node_db
node_admin -->|"manages records"| node_db

click node_auth_ui "https://github.com/kennypark-167/reddot-python-desktop/blob/main/client/app.py"
click node_chat_ui "https://github.com/kennypark-167/reddot-python-desktop/blob/main/client/app.py"
click node_admin_ui "https://github.com/kennypark-167/reddot-python-desktop/blob/main/client/app.py"
click node_api "https://github.com/kennypark-167/reddot-python-desktop/blob/main/server/main.py"
click node_auth "https://github.com/kennypark-167/reddot-python-desktop/blob/main/server/main.py"
click node_chat "https://github.com/kennypark-167/reddot-python-desktop/blob/main/server/main.py"
click node_admin "https://github.com/kennypark-167/reddot-python-desktop/blob/main/server/main.py"
click node_db "https://github.com/kennypark-167/reddot-python-desktop/blob/main/db/schema.sql"

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_auth_ui,node_chat_ui,node_admin_ui,node_user toneBlue
class node_api,node_auth,node_chat,node_admin toneAmber
class node_db toneMint
```

## Components

### Desktop client

- [Sign-in and registration](https://github.com/kennypark-167/reddot-python-desktop/blob/main/client/app.py): `client/app.py`
- [Chat room and polling](https://github.com/kennypark-167/reddot-python-desktop/blob/main/client/app.py): `client/app.py`
- [Admin console](https://github.com/kennypark-167/reddot-python-desktop/blob/main/client/app.py): `client/app.py`

### Chat service

- [HTTP API and routes](https://github.com/kennypark-167/reddot-python-desktop/blob/main/server/main.py): `server/main.py`
- [JWT and access control](https://github.com/kennypark-167/reddot-python-desktop/blob/main/server/main.py): `server/main.py`
- [Message handling](https://github.com/kennypark-167/reddot-python-desktop/blob/main/server/main.py): `server/main.py`
- [Admin operations](https://github.com/kennypark-167/reddot-python-desktop/blob/main/server/main.py): `server/main.py`

### SQL storage

- [SQL database](https://github.com/kennypark-167/reddot-python-desktop/blob/main/db/schema.sql): `db/schema.sql`

### Other components

- **Chat user**

## Connections

- Chat user → Sign-in and registration: registers or signs in (evidence: `README.md`)
- Chat user → Chat room and polling: chats (evidence: `README.md`)
- Chat user → Admin console: administers (evidence: `README.md`)
- Sign-in and registration → HTTP API and routes: sends auth requests (evidence: `client/app.py`)
- Chat room and polling → HTTP API and routes: sends and polls (evidence: `client/app.py`)
- Admin console → HTTP API and routes: requests admin data (evidence: `client/app.py`)
- HTTP API and routes → JWT and access control: validates protected routes (evidence: `server/main.py`)
- HTTP API and routes → Message handling: handles message routes (evidence: `server/main.py`)
- HTTP API and routes → Admin operations: handles admin routes (evidence: `server/main.py`)
- JWT and access control → SQL database: reads users (evidence: `server/main.py`)
- Message handling → SQL database: stores and reads messages (evidence: `server/main.py`)
- Admin operations → SQL database: manages records (evidence: `server/main.py`)
