# yasaswivenkat/sentinel_vision architecture

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

- Interactive diagram: https://gitdiagram.com/yasaswivenkat/sentinel_vision
- Repository: https://github.com/yasaswivenkat/sentinel_vision

## Overview

SentinelVision is a surveillance operations console: camera/video analysis produces incidents, which operators review, acknowledge, search, and turn into forensic reports. The backend also exposes zone configuration, analytics, live MJPEG feeds, video upload, and WebSocket telemetry; the React dashboard presents these workflows. The source index confirms the principal API, vision, persistence, and UI modules. Some endpoint internals were not excerpted, so their documented capabilities are represented without speculative implementation links.

Main entry points: [`frontend/src/App.tsx`](https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/App.tsx) (Operations dashboard), [`frontend/src/store/useStore.ts`](https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/store/useStore.ts) (Console state), [`backend/app/db/models.py`](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/db/models.py) (Application database), [`backend/app/api/endpoints/incidents.py`](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/incidents.py) (Incident API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["SOC Console"]
  node_dashboard["Operations dashboard<br/>[App.tsx]"]
  node_state["Console state<br/>[useStore.ts]"]
  node_video_ui["Camera viewer<br/>[VideoPlayer.tsx]"]
  node_incidents_ui["Incident list<br/>[IncidentList.tsx]"]
  node_analytics_ui["Analytics charts<br/>[AnalyticsChart.tsx]"]
  node_zones_ui["Zone manager<br/>[ZoneManager.tsx]"]
  node_forensic_ui["Forensic viewer<br/>[ForensicModal.tsx]"]
end

subgraph group_api["Backend API"]
  node_camera_api["Camera &amp; stream API<br/>[cameras.py]"]
  node_incident_api["Incident API<br/>[incidents.py]"]
  node_zone_api["Zone API<br/>[zones.py]"]
  node_upload_api["Video upload API<br/>[video_upload.py]"]
  node_analytics_api["Analytics API<br/>[analytics.py]"]
  node_ws_api["Live event socket<br/>[websockets.py]"]
end

subgraph group_vision["Video Intelligence"]
  node_vision_engine["Vision engine<br/>[engine.py]"]
  node_spatial["Spatial rules<br/>[spatial.py]"]
end

subgraph group_data["Persistence &amp; Reports"]
  node_database[("Application database<br/>[models.py]")]
  node_db_session["Database sessions<br/>[session.py]"]
  node_incident_schema["API data schemas<br/>[incident.py]"]
  node_gemini["Forensic AI &amp; search<br/>[gemini_service.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

node_operator(("SOC operator"))

node_operator -->|"uses"| node_dashboard
node_dashboard -->|"initializes"| node_state
node_dashboard -->|"renders"| node_video_ui
node_dashboard -->|"renders"| node_incidents_ui
node_dashboard -->|"renders"| node_analytics_ui
node_dashboard -->|"renders"| node_zones_ui
node_dashboard -->|"renders"| node_forensic_ui
node_video_ui -->|"reads"| node_state
node_incidents_ui -->|"reads"| node_state
node_analytics_ui -->|"reads"| node_state
node_zones_ui -->|"reads"| node_state
node_forensic_ui -->|"reads"| node_state
node_state -->|"fetches cameras"| node_camera_api
node_state -->|"fetches incidents"| node_incident_api
node_zones_ui -->|"saves zones"| node_zone_api
node_dashboard -->|"receives events"| node_ws_api
node_camera_api -->|"uses"| node_vision_engine
node_upload_api -->|"analyzes video"| node_vision_engine
node_vision_engine -->|"uses rules"| node_spatial
node_ws_api -->|"processes camera frames"| node_vision_engine
node_ws_api -->|"stores incidents"| node_database
node_incident_api -->|"reads and updates"| node_database
node_incident_api -->|"requests reports and search"| node_gemini
node_incident_api -->|"broadcasts resolutions"| node_ws_api
node_camera_api -->|"uses camera records"| node_database
node_zone_api -->|"manages zones"| node_database
node_analytics_api -->|"queries metrics"| node_database
node_db_session -->|"reads database settings"| node_config
node_db_session -->|"creates sessions"| node_database
node_incident_api -->|"validates responses"| node_incident_schema
node_gemini -->|"reads AI settings"| node_config

click node_dashboard "https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/App.tsx"
click node_state "https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/store/useStore.ts"
click node_video_ui "https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/VideoPlayer.tsx"
click node_incidents_ui "https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/IncidentList.tsx"
click node_analytics_ui "https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/AnalyticsChart.tsx"
click node_zones_ui "https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/ZoneManager.tsx"
click node_forensic_ui "https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/ForensicModal.tsx"
click node_camera_api "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/cameras.py"
click node_incident_api "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/incidents.py"
click node_zone_api "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/zones.py"
click node_upload_api "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/video_upload.py"
click node_analytics_api "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/analytics.py"
click node_ws_api "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/websockets.py"
click node_vision_engine "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/cv/engine.py"
click node_spatial "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/cv/spatial.py"
click node_database "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/db/models.py"
click node_db_session "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/db/session.py"
click node_incident_schema "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/schemas/incident.py"
click node_gemini "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/services/gemini_service.py"
click node_config "https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/core/config.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_dashboard,node_state,node_video_ui,node_incidents_ui,node_analytics_ui,node_zones_ui,node_forensic_ui toneBlue
class node_camera_api,node_incident_api,node_zone_api,node_upload_api,node_analytics_api,node_ws_api toneAmber
class node_vision_engine,node_spatial toneMint
class node_database,node_db_session,node_incident_schema,node_gemini,node_config toneRose
class node_operator toneIndigo
```

## Components

### SOC Console

- [Operations dashboard](https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Console state](https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/store/useStore.ts): `frontend/src/store/useStore.ts`
- [Camera viewer](https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/VideoPlayer.tsx): `frontend/src/components/VideoPlayer.tsx`
- [Incident list](https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/IncidentList.tsx): `frontend/src/components/IncidentList.tsx`
- [Analytics charts](https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/AnalyticsChart.tsx): `frontend/src/components/AnalyticsChart.tsx`
- [Zone manager](https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/ZoneManager.tsx): `frontend/src/components/ZoneManager.tsx`
- [Forensic viewer](https://github.com/yasaswivenkat/sentinel_vision/blob/main/frontend/src/components/ForensicModal.tsx): `frontend/src/components/ForensicModal.tsx`

### Backend API

- [Camera & stream API](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/cameras.py): `backend/app/api/endpoints/cameras.py`
- [Incident API](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/incidents.py): `backend/app/api/endpoints/incidents.py`
- [Zone API](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/zones.py): `backend/app/api/endpoints/zones.py`
- [Video upload API](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/video_upload.py): `backend/app/api/endpoints/video_upload.py`
- [Analytics API](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/endpoints/analytics.py): `backend/app/api/endpoints/analytics.py`
- [Live event socket](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/api/websockets.py): `backend/app/api/websockets.py`

### Video Intelligence

- [Vision engine](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/cv/engine.py): `backend/app/cv/engine.py`
- [Spatial rules](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/cv/spatial.py): `backend/app/cv/spatial.py`

### Persistence & Reports

- [Application database](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/db/models.py): `backend/app/db/models.py`
- [Database sessions](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [API data schemas](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/schemas/incident.py): `backend/app/schemas/incident.py`
- [Forensic AI & search](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/services/gemini_service.py): `backend/app/services/gemini_service.py`
- [Runtime settings](https://github.com/yasaswivenkat/sentinel_vision/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Other components

- **SOC operator**

## Connections

- SOC operator → Operations dashboard: uses (evidence: `README.md`)
- Operations dashboard → Console state: initializes (evidence: `frontend/src/App.tsx`)
- Operations dashboard → Camera viewer: renders (evidence: `frontend/src/App.tsx`)
- Operations dashboard → Incident list: renders (evidence: `frontend/src/App.tsx`)
- Operations dashboard → Analytics charts: renders (evidence: `frontend/src/App.tsx`)
- Operations dashboard → Zone manager: renders (evidence: `frontend/src/App.tsx`)
- Operations dashboard → Forensic viewer: renders (evidence: `frontend/src/App.tsx`)
- Camera viewer → Console state: reads (evidence: `frontend/src/components/VideoPlayer.tsx`)
- Incident list → Console state: reads (evidence: `frontend/src/components/IncidentList.tsx`)
- Analytics charts → Console state: reads (evidence: `frontend/src/components/AnalyticsChart.tsx`)
- Zone manager → Console state: reads (evidence: `frontend/src/components/ZoneManager.tsx`)
- Forensic viewer → Console state: reads (evidence: `frontend/src/components/ForensicModal.tsx`)
- Console state → Camera & stream API: fetches cameras (evidence: `frontend/src/store/useStore.ts`)
- Console state → Incident API: fetches incidents (evidence: `frontend/src/store/useStore.ts`)
- Zone manager → Zone API: saves zones (evidence: `frontend/src/components/ZoneManager.tsx`)
- Operations dashboard → Live event socket: receives events (evidence: `frontend/src/App.tsx`)
- Camera & stream API → Vision engine: uses (evidence: `backend/app/api/endpoints/cameras.py`)
- Video upload API → Vision engine: analyzes video (evidence: `backend/app/api/endpoints/video_upload.py`)
- Vision engine → Spatial rules: uses rules (evidence: `backend/app/cv/engine.py`)
- Live event socket → Vision engine: processes camera frames (evidence: `backend/app/api/websockets.py`)
- Live event socket → Application database: stores incidents (evidence: `backend/app/api/websockets.py`)
- Incident API → Application database: reads and updates (evidence: `backend/app/api/endpoints/incidents.py`)
- Incident API → Forensic AI & search: requests reports and search (evidence: `backend/app/api/endpoints/incidents.py`)
- Incident API → Live event socket: broadcasts resolutions (evidence: `backend/app/api/endpoints/incidents.py`)
- Camera & stream API → Application database: uses camera records (evidence: `backend/app/api/endpoints/cameras.py`)
- Zone API → Application database: manages zones (evidence: `backend/app/api/endpoints/zones.py`)
- Analytics API → Application database: queries metrics (evidence: `backend/app/api/endpoints/analytics.py`)
- Database sessions → Runtime settings: reads database settings (evidence: `backend/app/db/session.py`)
- Database sessions → Application database: creates sessions (evidence: `backend/app/db/session.py`)
- Incident API → API data schemas: validates responses (evidence: `backend/app/api/endpoints/incidents.py`)
- Forensic AI & search → Runtime settings: reads AI settings (evidence: `backend/app/services/gemini_service.py`)
