# ummadipravallika2115/sentinel-iot-backend architecture

> Architecture diagram of the GitHub repository ummadipravallika2115/sentinel-iot-backend, 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/ummadipravallika2115/sentinel-iot-backend
- Repository: https://github.com/ummadipravallika2115/sentinel-iot-backend

## Overview

Sentinel-IoT is an industrial machine-health monitoring web app. Its principal workflow is simulated or device telemetry reaching Flask ingestion, being classified and persisted, with emergency alerts; authenticated users view machine history and export audit reports. The README also documents CSV logging and live charts, which are not visible in the sampled backend excerpt, so those links are marked unverified. The simulator’s configured URL does not include the shown ingestion route, so its connection is documented but not confirmed.

Main entry points: [`app.py`](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py) (Telemetry Ingestion), [`sentinel_ultra.db`](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/sentinel_ultra.db) (Machine Log Store), [`templates/dashboard.html`](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/templates/dashboard.html) (Live Dashboard), [`device_simulator.py`](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/device_simulator.py) (Device Simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_telemetry["Telemetry Monitoring"]
  node_simulator["Device Simulator"]
  node_ingest["Telemetry Ingestion<br/>[app.py]"]
  node_classification["Health Classification<br/>[app.py]"]
  node_database[("Machine Log Store<br/>[sentinel_ultra.db]")]
  node_csv_audit["CSV Audit Trail<br/>[machine_logs.csv]"]
end

subgraph group_access["Access and Dashboard"]
  node_login["Login<br/>[login.html]"]
  node_otp["OTP Verification<br/>[verify_otp.html]"]
  node_auth_routes["Authentication Routes<br/>[app.py]"]
  node_dashboard_route["Dashboard Route<br/>[app.py]"]
  node_dashboard["Live Dashboard<br/>[dashboard.html]"]
end

subgraph group_reporting["History and Reports"]
  node_machine_list["Machine Listing<br/>[app.py]"]
  node_history["Telemetry History<br/>[app.py]"]
  node_report_export["Report Export<br/>[app.py]"]
  node_pdf["PDF Generation<br/>[app.py]"]
end

subgraph group_integrations["External Integrations"]
  node_telegram["Telegram Alerts"]
end

node_operator(("Operator"))

node_operator -->|"signs in"| node_auth_routes
node_auth_routes -->|"renders"| node_login
node_auth_routes -->|"renders"| node_otp
node_auth_routes -->|"redirects"| node_dashboard_route
node_operator -->|"requests"| node_dashboard_route
node_dashboard_route -->|"renders"| node_dashboard
node_simulator -.->|"sends telemetry"| node_ingest
node_ingest -->|"classifies readings"| node_classification
node_ingest -->|"sends emergency alert"| node_telegram
node_ingest -->|"writes log"| node_database
node_ingest -.->|"logs readings"| node_csv_audit
node_dashboard -->|"requests machines"| node_machine_list
node_dashboard -->|"requests trends"| node_history
node_machine_list -->|"queries"| node_database
node_history -->|"queries"| node_database
node_operator -->|"requests report"| node_report_export
node_report_export -->|"reads logs"| node_database
node_report_export -->|"generates report"| node_pdf

click node_simulator "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/device_simulator.py"
click node_ingest "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py"
click node_classification "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py"
click node_database "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/sentinel_ultra.db"
click node_csv_audit "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/machine_logs.csv"
click node_login "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/templates/login.html"
click node_otp "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/templates/verify_otp.html"
click node_auth_routes "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py"
click node_dashboard_route "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py"
click node_dashboard "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/templates/dashboard.html"
click node_machine_list "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py"
click node_history "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py"
click node_report_export "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py"
click node_pdf "https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.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_simulator,node_ingest,node_classification,node_database,node_csv_audit toneBlue
class node_login,node_otp,node_auth_routes,node_dashboard_route,node_dashboard toneAmber
class node_machine_list,node_history,node_report_export,node_pdf toneMint
class node_telegram toneRose
class node_operator toneIndigo
```

## Components

### Telemetry Monitoring

- [Device Simulator](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/device_simulator.py): `device_simulator.py`
- [Telemetry Ingestion](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py): `app.py`
- [Health Classification](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py): `app.py`
- [Machine Log Store](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/sentinel_ultra.db): `sentinel_ultra.db`
- [CSV Audit Trail](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/machine_logs.csv): `machine_logs.csv`

### Access and Dashboard

- [Login](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/templates/login.html): `templates/login.html`
- [OTP Verification](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/templates/verify_otp.html): `templates/verify_otp.html`
- [Authentication Routes](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py): `app.py`
- [Dashboard Route](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py): `app.py`
- [Live Dashboard](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/templates/dashboard.html): `templates/dashboard.html`

### History and Reports

- [Machine Listing](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py): `app.py`
- [Telemetry History](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py): `app.py`
- [Report Export](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py): `app.py`
- [PDF Generation](https://github.com/ummadipravallika2115/sentinel-iot-backend/blob/main/app.py): `app.py`

### External Integrations

- **Telegram Alerts**

### Other components

- **Operator**

## Connections

- Operator → Authentication Routes: signs in (evidence: `app.py`)
- Authentication Routes → Login: renders (evidence: `app.py`)
- Authentication Routes → OTP Verification: renders (evidence: `app.py`)
- Authentication Routes → Dashboard Route: redirects (evidence: `app.py`)
- Operator → Dashboard Route: requests (evidence: `app.py`)
- Dashboard Route → Live Dashboard: renders (evidence: `app.py`)
- Device Simulator → Telemetry Ingestion: sends telemetry (evidence: `README.md`)
- Telemetry Ingestion → Health Classification: classifies readings (evidence: `app.py`)
- Telemetry Ingestion → Telegram Alerts: sends emergency alert (evidence: `app.py`)
- Telemetry Ingestion → Machine Log Store: writes log (evidence: `app.py`)
- Telemetry Ingestion → CSV Audit Trail: logs readings (evidence: `README.md`)
- Live Dashboard → Machine Listing: requests machines (evidence: `README.md`)
- Live Dashboard → Telemetry History: requests trends (evidence: `README.md`)
- Machine Listing → Machine Log Store: queries (evidence: `app.py`)
- Telemetry History → Machine Log Store: queries (evidence: `app.py`)
- Operator → Report Export: requests report (evidence: `README.md`)
- Report Export → Machine Log Store: reads logs (evidence: `app.py`)
- Report Export → PDF Generation: generates report (evidence: `app.py`)
