# rajeshprasanth/tsp-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/rajeshprasanth/tsp-dashboard
- Repository: https://github.com/rajeshprasanth/tsp-dashboard

## Overview

tsp-dashboard is a Flask web dashboard for the Task Spooler queue. A user opens the single-page dashboard, signs in through the REST API, and views job and server state or—if an admin—controls jobs and the server. The API applies session and role checks, then delegates Task Spooler operations to a CLI wrapper that communicates with the daemon. The README documents dashboard charts, themes, and controls; frontend-to-API wiring is not shown in the sampled source, so that relationship is marked unverified.

Main entry points: [`app/__init__.py`](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/__init__.py) (Flask app factory), [`app/api.py`](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/api.py) (REST API), [`static/index.html`](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/static/index.html) (Single-page dashboard), [`app/auth.py`](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/auth.py) (Login and role checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Dashboard"]
  node_frontend["Single-page dashboard<br/>[index.html]"]
  node_web["Static web routes<br/>[web.py]"]
end

subgraph group_application["Flask application"]
  node_app["Flask app factory<br/>[__init__.py]"]
  node_api["REST API<br/>[api.py]"]
end

subgraph group_identity["Identity and configuration"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_auth["Login and role checks<br/>[auth.py]"]
  node_users[("User JSON file<br/>[users.json]")]
  node_user_admin["User management CLI<br/>[manage.py]"]
end

subgraph group_queue["Task Spooler"]
  node_tsp_client["Task Spooler client<br/>[tsp.py]"]
  node_tsp_cli["tsp command"]
  node_daemon[("Task Spooler daemon")]
end

node_user(("Dashboard user"))

node_user -->|"opens dashboard"| node_frontend
node_frontend -.->|"uses API"| node_api
node_app -->|"loads settings"| node_config
node_app -->|"creates user store"| node_auth
node_app -->|"registers routes"| node_api
node_app -->|"registers routes"| node_web
node_web -->|"serves page"| node_frontend
node_api -->|"checks access"| node_auth
node_api -->|"invokes operations"| node_tsp_client
node_auth -->|"reads credentials"| node_users
node_user_admin -->|"writes user data"| node_users
node_tsp_client -->|"runs commands"| node_tsp_cli
node_tsp_cli -->|"communicates over socket"| node_daemon

click node_frontend "https://github.com/rajeshprasanth/tsp-dashboard/blob/master/static/index.html"
click node_web "https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/web.py"
click node_app "https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/__init__.py"
click node_api "https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/api.py"
click node_config "https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/config.py"
click node_auth "https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/auth.py"
click node_users "https://github.com/rajeshprasanth/tsp-dashboard/blob/master/users.json"
click node_user_admin "https://github.com/rajeshprasanth/tsp-dashboard/blob/master/manage.py"
click node_tsp_client "https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/tsp.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_web,node_user toneBlue
class node_app,node_api toneAmber
class node_config,node_auth,node_users,node_user_admin toneMint
class node_tsp_client,node_tsp_cli,node_daemon toneRose
```

## Components

### Dashboard

- [Single-page dashboard](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/static/index.html): `static/index.html`
- [Static web routes](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/web.py): `app/web.py`

### Flask application

- [Flask app factory](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/__init__.py): `app/__init__.py`
- [REST API](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/api.py): `app/api.py`

### Identity and configuration

- [Runtime configuration](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/config.py): `app/config.py`
- [Login and role checks](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/auth.py): `app/auth.py`
- [User JSON file](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/users.json): `users.json`
- [User management CLI](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/manage.py): `manage.py`

### Task Spooler

- [Task Spooler client](https://github.com/rajeshprasanth/tsp-dashboard/blob/master/app/tsp.py): `app/tsp.py`
- **tsp command**
- **Task Spooler daemon**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Single-page dashboard: opens dashboard (evidence: `README.md`)
- Single-page dashboard → REST API: uses API
- Flask app factory → Runtime configuration: loads settings (evidence: `app/__init__.py`)
- Flask app factory → Login and role checks: creates user store (evidence: `app/__init__.py`)
- Flask app factory → REST API: registers routes (evidence: `app/__init__.py`)
- Flask app factory → Static web routes: registers routes (evidence: `app/__init__.py`)
- Static web routes → Single-page dashboard: serves page (evidence: `app/web.py`)
- REST API → Login and role checks: checks access (evidence: `app/api.py`)
- REST API → Task Spooler client: invokes operations (evidence: `app/api.py`)
- Login and role checks → User JSON file: reads credentials (evidence: `app/auth.py`)
- User management CLI → User JSON file: writes user data (evidence: `README.md`)
- Task Spooler client → tsp command: runs commands (evidence: `app/tsp.py`)
- tsp command → Task Spooler daemon: communicates over socket
