# lishasolanki/smart-surveillance-system architecture

> Architecture diagram of the GitHub repository lishasolanki/smart-surveillance-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lishasolanki/smart-surveillance-system
- Repository: https://github.com/lishasolanki/smart-surveillance-system

## Overview

SENTINEL is a browser-based public-safety surveillance dashboard. Its principal workflow is camera-frame processing: detect and track people and objects, evaluate safety conditions, update alert state, and send frames and alerts to connected clients. The excerpts also show manual test alerts and PDF alert-history reporting. Source excerpts are partial and the README is empty, so unsampled routes and their wiring are omitted; optional model inference is shown only where explicitly called.

Main entry points: [`app.py`](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py) (Detection engine), [`index.html`](https://github.com/lishasolanki/smart-surveillance-system/blob/main/index.html) (Web dashboard), [`yolov8n.pt`](https://github.com/lishasolanki/smart-surveillance-system/blob/main/yolov8n.pt) (YOLO weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_browser["Web dashboard<br/>[index.html]"]
  node_service["FastAPI service<br/>[app.py]"]
  node_clients["Connected clients<br/>[app.py]"]
end

subgraph group_processing["Video Processing"]
  node_capture["Frame capture<br/>[app.py]"]
  node_detector["Detection engine<br/>[app.py]"]
  node_yolo["YOLO inference<br/>[app.py]"]
  node_weights["YOLO weights<br/>[yolov8n.pt]"]
  node_tracker["Person tracker<br/>[app.py]"]
end

subgraph group_safety["Safety Analysis"]
  node_zone["Zone intrusion<br/>[app.py]"]
  node_crowd["Crowd analysis<br/>[app.py]"]
  node_loiter["Loitering analysis<br/>[app.py]"]
  node_fight["Fight analysis<br/>[app.py]"]
  node_weapons["Weapon detection<br/>[app.py]"]
end

subgraph group_alerts["Alerts and Reporting"]
  node_state["Surveillance state<br/>[app.py]"]
  node_snapshot["Alert snapshots<br/>[app.py]"]
  node_report["PDF report<br/>[app.py]"]
end

node_user(("Dashboard user"))
node_camera(("Camera feed"))

node_user -->|"uses"| node_browser
node_browser -->|"sends controls"| node_service
node_camera -->|"supplies frames"| node_capture
node_service -->|"starts capture"| node_capture
node_capture -->|"submits frames"| node_detector
node_detector -.->|"requests inference"| node_yolo
node_yolo -.->|"loads"| node_weights
node_detector -->|"tracks detections"| node_tracker
node_detector -->|"evaluates"| node_zone
node_detector -->|"evaluates"| node_crowd
node_detector -->|"evaluates"| node_loiter
node_detector -->|"evaluates"| node_fight
node_detector -->|"detects objects"| node_weapons
node_capture -->|"records alerts"| node_state
node_service -->|"adds test alerts"| node_state
node_detector -->|"saves alert frame"| node_snapshot
node_report -->|"reads alert history"| node_state
node_service -->|"builds report"| node_report
node_capture -->|"broadcasts frames"| node_clients
node_service -->|"broadcasts alerts"| node_clients
node_clients -->|"streams updates"| node_browser

click node_browser "https://github.com/lishasolanki/smart-surveillance-system/blob/main/index.html"
click node_service "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_capture "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_detector "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_yolo "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_weights "https://github.com/lishasolanki/smart-surveillance-system/blob/main/yolov8n.pt"
click node_tracker "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_zone "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_crowd "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_loiter "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_fight "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_weapons "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_state "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_snapshot "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_report "https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py"
click node_clients "https://github.com/lishasolanki/smart-surveillance-system/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_browser,node_service,node_clients,node_user toneBlue
class node_capture,node_detector,node_yolo,node_weights,node_tracker toneAmber
class node_zone,node_crowd,node_loiter,node_fight,node_weapons toneMint
class node_state,node_snapshot,node_report toneRose
class node_camera toneIndigo
```

## Components

### Dashboard

- [Web dashboard](https://github.com/lishasolanki/smart-surveillance-system/blob/main/index.html): `index.html`
- [FastAPI service](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [Connected clients](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`

### Video Processing

- [Frame capture](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [Detection engine](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [YOLO inference](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [YOLO weights](https://github.com/lishasolanki/smart-surveillance-system/blob/main/yolov8n.pt): `yolov8n.pt`
- [Person tracker](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`

### Safety Analysis

- [Zone intrusion](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [Crowd analysis](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [Loitering analysis](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [Fight analysis](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [Weapon detection](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`

### Alerts and Reporting

- [Surveillance state](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [Alert snapshots](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`
- [PDF report](https://github.com/lishasolanki/smart-surveillance-system/blob/main/app.py): `app.py`

### Other components

- **Dashboard user**
- **Camera feed**

## Connections

- Dashboard user → Web dashboard: uses
- Web dashboard → FastAPI service: sends controls
- Camera feed → Frame capture: supplies frames
- FastAPI service → Frame capture: starts capture
- Frame capture → Detection engine: submits frames
- Detection engine → YOLO inference: requests inference
- YOLO inference → YOLO weights: loads
- Detection engine → Person tracker: tracks detections
- Detection engine → Zone intrusion: evaluates
- Detection engine → Crowd analysis: evaluates
- Detection engine → Loitering analysis: evaluates
- Detection engine → Fight analysis: evaluates
- Detection engine → Weapon detection: detects objects
- Frame capture → Surveillance state: records alerts
- FastAPI service → Surveillance state: adds test alerts
- Detection engine → Alert snapshots: saves alert frame
- PDF report → Surveillance state: reads alert history
- FastAPI service → PDF report: builds report
- Frame capture → Connected clients: broadcasts frames
- FastAPI service → Connected clients: broadcasts alerts
- Connected clients → Web dashboard: streams updates
