# deeprasarkar007-glitch/dristi architecture

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

- Interactive diagram: https://gitdiagram.com/deeprasarkar007-glitch/dristi
- Repository: https://github.com/deeprasarkar007-glitch/dristi

## Overview

DRISTI combines an optical vehicle-detection service, ESP32 telemetry, and mission-control dashboards. The operator workflow is to view camera predictions and sensor readings, correlate them into safety status, and use the GIS mine-corridor view for context. The repository contains two dashboard implementations: the Vite glass HUD and a separate Next.js control panel. The README documents the API and product capabilities; source excerpts confirm selected calls and UI composition, but do not expose every telemetry or GIS implementation detail.

Main entry points: [`backend/app/main.py`](https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/app/main.py) (FastAPI Service), [`mainframe/src/App.tsx`](https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/App.tsx) (Glass HUD App), [`mainframe/src/components/GlassCommandCenter.tsx`](https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/GlassCommandCenter.tsx) (Glass Command Center), [`frontend/components/UnifiedCommandCenter.tsx`](https://github.com/deeprasarkar007-glitch/dristi/blob/main/frontend/components/UnifiedCommandCenter.tsx) (Next.js Command Center)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Mission Control UIs"]
  node_vite_entry["Glass HUD App<br/>[App.tsx]"]
  node_glass_center["Glass Command Center"]
  node_glass_nav["Glass Navigation<br/>[GlassNavbar.tsx]"]
  node_background["Video Backdrop"]
  node_next_center["Next.js Command Center"]
  node_gis["Mine GIS View<br/>[index.html]"]
end

subgraph group_vision["Optical Detection"]
  node_glass_camera["Glass Webcam Detector"]
  node_next_camera["Webcam Detector<br/>[WebcamDetector.tsx]"]
  node_backend_api["FastAPI Service<br/>[main.py]"]
  node_model["Frame Inference<br/>[model_service.py]"]
  node_response_schema["API Schemas<br/>[schemas.py]"]
end

subgraph group_telemetry["Sensor Telemetry"]
  node_glass_telemetry["Glass Telemetry HUD"]
  node_next_telemetry["Telemetry Dashboard"]
  node_esp32["ESP32 Sensor Node<br/>[sender_esp.ino]"]
  node_receiver["ESP32 Receiver<br/>[receiver_esp.ino]"]
  node_telemetry_store[("Latest Telemetry<br/>[main.py]")]
end

subgraph group_data["Model and GIS Data"]
  node_training["Classifier Training"]
  node_model_files["Saved Model Artifacts<br/>[class_names.json]"]
end

node_operator(("Mine Operator"))

node_operator -->|"uses"| node_vite_entry
node_vite_entry -->|"renders"| node_glass_center
node_vite_entry -->|"renders"| node_glass_nav
node_vite_entry -->|"renders"| node_background
node_glass_center -->|"renders"| node_glass_camera
node_glass_center -->|"renders"| node_glass_telemetry
node_glass_nav -->|"checks health"| node_backend_api
node_glass_camera -->|"posts frames"| node_backend_api
node_backend_api -->|"runs inference"| node_model
node_backend_api -->|"formats responses"| node_response_schema
node_training -->|"produces artifacts"| node_model_files
node_model -.->|"loads artifacts"| node_model_files
node_operator -->|"uses"| node_next_center
node_next_center -->|"renders"| node_next_camera
node_next_center -->|"renders"| node_next_telemetry
node_next_camera -->|"posts frames"| node_backend_api
node_esp32 -.->|"sends telemetry"| node_receiver
node_receiver -->|"updates telemetry"| node_backend_api
node_backend_api -->|"reads and writes"| node_telemetry_store
node_glass_telemetry -.->|"uses telemetry API"| node_backend_api
node_next_telemetry -.->|"uses telemetry API"| node_backend_api
node_operator -->|"views mine corridors"| node_gis

click node_vite_entry "https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/App.tsx"
click node_glass_center "https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/GlassCommandCenter.tsx"
click node_glass_nav "https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/GlassNavbar.tsx"
click node_background "https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/BackgroundVideo.tsx"
click node_next_center "https://github.com/deeprasarkar007-glitch/dristi/blob/main/frontend/components/UnifiedCommandCenter.tsx"
click node_gis "https://github.com/deeprasarkar007-glitch/dristi/blob/main/vantage/index.html"
click node_glass_camera "https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/GlassWebcamDetector.tsx"
click node_next_camera "https://github.com/deeprasarkar007-glitch/dristi/blob/main/frontend/components/WebcamDetector.tsx"
click node_backend_api "https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/app/main.py"
click node_model "https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/app/model_service.py"
click node_response_schema "https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/app/schemas.py"
click node_glass_telemetry "https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/GlassTelemetryDashboard.tsx"
click node_next_telemetry "https://github.com/deeprasarkar007-glitch/dristi/blob/main/frontend/components/TelemetryDashboard.tsx"
click node_esp32 "https://github.com/deeprasarkar007-glitch/dristi/blob/main/sender_esp.ino"
click node_receiver "https://github.com/deeprasarkar007-glitch/dristi/blob/main/receiver_esp.ino"
click node_telemetry_store "https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/app/main.py"
click node_training "https://github.com/deeprasarkar007-glitch/dristi/blob/main/model_training/train_dumper_truck_classifier.ipynb"
click node_model_files "https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/saved_model/class_names.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_vite_entry,node_glass_center,node_glass_nav,node_background,node_next_center,node_gis toneBlue
class node_glass_camera,node_next_camera,node_backend_api,node_model,node_response_schema toneAmber
class node_glass_telemetry,node_next_telemetry,node_esp32,node_receiver,node_telemetry_store toneMint
class node_training,node_model_files toneRose
class node_operator toneIndigo
```

## Components

### Mission Control UIs

- [Glass HUD App](https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/App.tsx): `mainframe/src/App.tsx`
- [Glass Command Center](https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/GlassCommandCenter.tsx): `mainframe/src/components/GlassCommandCenter.tsx`
- [Glass Navigation](https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/GlassNavbar.tsx): `mainframe/src/components/GlassNavbar.tsx`
- [Video Backdrop](https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/BackgroundVideo.tsx): `mainframe/src/components/BackgroundVideo.tsx`
- [Next.js Command Center](https://github.com/deeprasarkar007-glitch/dristi/blob/main/frontend/components/UnifiedCommandCenter.tsx): `frontend/components/UnifiedCommandCenter.tsx`
- [Mine GIS View](https://github.com/deeprasarkar007-glitch/dristi/blob/main/vantage/index.html): `vantage/index.html`

### Optical Detection

- [Glass Webcam Detector](https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/GlassWebcamDetector.tsx): `mainframe/src/components/GlassWebcamDetector.tsx`
- [Webcam Detector](https://github.com/deeprasarkar007-glitch/dristi/blob/main/frontend/components/WebcamDetector.tsx): `frontend/components/WebcamDetector.tsx`
- [FastAPI Service](https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/app/main.py): `backend/app/main.py`
- [Frame Inference](https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/app/model_service.py): `backend/app/model_service.py`
- [API Schemas](https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Sensor Telemetry

- [Glass Telemetry HUD](https://github.com/deeprasarkar007-glitch/dristi/blob/main/mainframe/src/components/GlassTelemetryDashboard.tsx): `mainframe/src/components/GlassTelemetryDashboard.tsx`
- [Telemetry Dashboard](https://github.com/deeprasarkar007-glitch/dristi/blob/main/frontend/components/TelemetryDashboard.tsx): `frontend/components/TelemetryDashboard.tsx`
- [ESP32 Sensor Node](https://github.com/deeprasarkar007-glitch/dristi/blob/main/sender_esp.ino): `sender_esp.ino`
- [ESP32 Receiver](https://github.com/deeprasarkar007-glitch/dristi/blob/main/receiver_esp.ino): `receiver_esp.ino`
- [Latest Telemetry](https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/app/main.py): `backend/app/main.py`

### Model and GIS Data

- [Classifier Training](https://github.com/deeprasarkar007-glitch/dristi/blob/main/model_training/train_dumper_truck_classifier.ipynb): `model_training/train_dumper_truck_classifier.ipynb`
- [Saved Model Artifacts](https://github.com/deeprasarkar007-glitch/dristi/blob/main/backend/saved_model/class_names.json): `backend/saved_model/class_names.json`

### Other components

- **Mine Operator**

## Connections

- Mine Operator → Glass HUD App: uses (evidence: `README.md`)
- Glass HUD App → Glass Command Center: renders (evidence: `mainframe/src/App.tsx`)
- Glass HUD App → Glass Navigation: renders (evidence: `mainframe/src/App.tsx`)
- Glass HUD App → Video Backdrop: renders (evidence: `mainframe/src/App.tsx`)
- Glass Command Center → Glass Webcam Detector: renders (evidence: `mainframe/src/components/GlassCommandCenter.tsx`)
- Glass Command Center → Glass Telemetry HUD: renders (evidence: `mainframe/src/components/GlassCommandCenter.tsx`)
- Glass Navigation → FastAPI Service: checks health (evidence: `mainframe/src/components/GlassNavbar.tsx`)
- Glass Webcam Detector → FastAPI Service: posts frames (evidence: `mainframe/src/components/GlassWebcamDetector.tsx`)
- FastAPI Service → Frame Inference: runs inference (evidence: `backend/app/main.py`)
- FastAPI Service → API Schemas: formats responses (evidence: `backend/app/main.py`)
- Classifier Training → Saved Model Artifacts: produces artifacts (evidence: `README.md`)
- Frame Inference → Saved Model Artifacts: loads artifacts
- Mine Operator → Next.js Command Center: uses (evidence: `README.md`)
- Next.js Command Center → Webcam Detector: renders (evidence: `frontend/components/UnifiedCommandCenter.tsx`)
- Next.js Command Center → Telemetry Dashboard: renders (evidence: `frontend/components/UnifiedCommandCenter.tsx`)
- Webcam Detector → FastAPI Service: posts frames (evidence: `frontend/components/WebcamDetector.tsx`)
- ESP32 Sensor Node → ESP32 Receiver: sends telemetry
- ESP32 Receiver → FastAPI Service: updates telemetry (evidence: `README.md`)
- FastAPI Service → Latest Telemetry: reads and writes (evidence: `backend/app/main.py`)
- Glass Telemetry HUD → FastAPI Service: uses telemetry API (evidence: `README.md`)
- Telemetry Dashboard → FastAPI Service: uses telemetry API (evidence: `README.md`)
- Mine Operator → Mine GIS View: views mine corridors (evidence: `README.md`)
