# dyaus2/dashboard-warning-light-detector architecture

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

- Interactive diagram: https://gitdiagram.com/dyaus2/dashboard-warning-light-detector
- Repository: https://github.com/dyaus2/dashboard-warning-light-detector

## Overview

Telltale is a local two-page dashboard-warning detector: users inspect model metrics or upload a dashboard photo, which the app decodes and sends through a CPU YOLO detector before showing detections in an interactive overlay. The metrics page presents model comparisons, training stages, per-class outcomes, size results, and limitations from JSON data; the demo also supports optional sample photos. The graph separates routes, inference, shared page utilities, and the two page experiences. Relationships are based on the README and shown source; templates and data-file contents were not sampled.

Main entry points: [`app/static/js/demo.js`](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/demo.js) (Upload workflow), [`app/main.py`](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/main.py) (FastAPI routes), [`app/static/js/metrics.js`](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/metrics.js) (Metrics dashboard), [`app/static/js/common.js`](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/common.js) (Shared UI helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web service"]
  node_fastapi["FastAPI routes<br/>[main.py]"]
  node_page_templates["Page templates"]
  node_static_assets["Static assets"]
end

subgraph group_inference["Detection runtime"]
  node_prediction["Image prediction<br/>[main.py]"]
  node_image_decode["Image validation<br/>[main.py]"]
  node_yolo["YOLO detector<br/>[main.py]"]
  node_weights["Model weights<br/>[best_R4.pt]"]
end

subgraph group_demo["Photo demo"]
  node_upload["Upload workflow<br/>[demo.js]"]
  node_overlay["Detection overlay<br/>[demo.js]"]
  node_shared_ui["Shared UI helpers<br/>[common.js]"]
  node_class_symbols["Class symbols<br/>[icons.js]"]
  node_class_data["Warning classes<br/>[classes.json]"]
  node_sample_photos["Optional samples"]
end

subgraph group_metrics["Model metrics"]
  node_metrics_ui["Metrics dashboard<br/>[metrics.js]"]
  node_metrics_data["Metrics source data<br/>[metrics.json]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens pages"| node_fastapi
node_fastapi -->|"serves pages"| node_page_templates
node_fastapi -->|"mounts assets"| node_static_assets
node_visitor -->|"chooses photo"| node_upload
node_upload -->|"posts image"| node_fastapi
node_fastapi -->|"dispatches request"| node_prediction
node_prediction -->|"decodes image"| node_image_decode
node_prediction -->|"runs inference"| node_yolo
node_yolo -->|"loads weights"| node_weights
node_prediction -->|"returns detections"| node_upload
node_upload -->|"renders results"| node_overlay
node_upload -->|"uses helpers"| node_shared_ui
node_metrics_ui -->|"uses helpers"| node_shared_ui
node_upload -->|"uses symbols"| node_class_symbols
node_metrics_ui -->|"uses symbols"| node_class_symbols
node_shared_ui -->|"loads classes"| node_class_data
node_upload -->|"loads optional samples"| node_sample_photos
node_metrics_ui -->|"loads metrics"| node_metrics_data
node_visitor -->|"views results"| node_metrics_ui

click node_fastapi "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/main.py"
click node_page_templates "https://github.com/dyaus2/dashboard-warning-light-detector/tree/main/app/templates"
click node_static_assets "https://github.com/dyaus2/dashboard-warning-light-detector/tree/main/app/static"
click node_upload "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/demo.js"
click node_prediction "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/main.py"
click node_image_decode "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/main.py"
click node_yolo "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/main.py"
click node_weights "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/best_R4.pt"
click node_overlay "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/demo.js"
click node_shared_ui "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/common.js"
click node_class_symbols "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/icons.js"
click node_class_data "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/data/classes.json"
click node_sample_photos "https://github.com/dyaus2/dashboard-warning-light-detector/tree/main/app/static/samples"
click node_metrics_ui "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/metrics.js"
click node_metrics_data "https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/data/metrics.json"

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_fastapi,node_page_templates,node_static_assets toneBlue
class node_prediction,node_image_decode,node_yolo,node_weights toneAmber
class node_upload,node_overlay,node_shared_ui,node_class_symbols,node_class_data,node_sample_photos toneMint
class node_metrics_ui,node_metrics_data toneRose
class node_visitor toneIndigo
```

## Components

### Web service

- [FastAPI routes](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/main.py): `app/main.py`
- [Page templates](https://github.com/dyaus2/dashboard-warning-light-detector/tree/main/app/templates): `app/templates`
- [Static assets](https://github.com/dyaus2/dashboard-warning-light-detector/tree/main/app/static): `app/static`

### Detection runtime

- [Image prediction](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/main.py): `app/main.py`
- [Image validation](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/main.py): `app/main.py`
- [YOLO detector](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/main.py): `app/main.py`
- [Model weights](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/best_R4.pt): `best_R4.pt`

### Photo demo

- [Upload workflow](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/demo.js): `app/static/js/demo.js`
- [Detection overlay](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/demo.js): `app/static/js/demo.js`
- [Shared UI helpers](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/common.js): `app/static/js/common.js`
- [Class symbols](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/icons.js): `app/static/js/icons.js`
- [Warning classes](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/data/classes.json): `app/static/data/classes.json`
- [Optional samples](https://github.com/dyaus2/dashboard-warning-light-detector/tree/main/app/static/samples): `app/static/samples`

### Model metrics

- [Metrics dashboard](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/js/metrics.js): `app/static/js/metrics.js`
- [Metrics source data](https://github.com/dyaus2/dashboard-warning-light-detector/blob/main/app/static/data/metrics.json): `app/static/data/metrics.json`

### Other components

- **Visitor**

## Connections

- Visitor → FastAPI routes: opens pages (evidence: `README.md`)
- FastAPI routes → Page templates: serves pages (evidence: `app/main.py`)
- FastAPI routes → Static assets: mounts assets (evidence: `app/main.py`)
- Visitor → Upload workflow: chooses photo (evidence: `README.md`)
- Upload workflow → FastAPI routes: posts image (evidence: `README.md`)
- FastAPI routes → Image prediction: dispatches request (evidence: `app/main.py`)
- Image prediction → Image validation: decodes image (evidence: `app/main.py`)
- Image prediction → YOLO detector: runs inference (evidence: `app/main.py`)
- YOLO detector → Model weights: loads weights (evidence: `app/main.py`)
- Image prediction → Upload workflow: returns detections (evidence: `README.md`)
- Upload workflow → Detection overlay: renders results (evidence: `app/static/js/demo.js`)
- Upload workflow → Shared UI helpers: uses helpers (evidence: `app/static/js/demo.js`)
- Metrics dashboard → Shared UI helpers: uses helpers (evidence: `app/static/js/metrics.js`)
- Upload workflow → Class symbols: uses symbols (evidence: `app/static/js/demo.js`)
- Metrics dashboard → Class symbols: uses symbols (evidence: `app/static/js/metrics.js`)
- Shared UI helpers → Warning classes: loads classes (evidence: `app/static/js/common.js`)
- Upload workflow → Optional samples: loads optional samples (evidence: `app/static/js/demo.js`)
- Metrics dashboard → Metrics source data: loads metrics (evidence: `app/static/js/metrics.js`)
- Visitor → Metrics dashboard: views results (evidence: `README.md`)
