# rahulgulabaji/sentinel-x architecture

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

## Overview

SENTINEL-X turns surveillance video into anomaly and object-tracking results, then supports operator-led incident response. The primary workflow runs from video submission through asynchronous analysis to incident review; dispatch remains an explicit operator action. The graph also preserves responder/GPS sharing, AI summaries, notifications, and audit capabilities. Some route and storage wiring is not excerpted, so uncertain links are omitted; README-documented relationships are cited there.

Main entry points: [`backend/app/main.py`](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/services/analysis_service.py`](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/analysis_service.py) (Analysis orchestration), [`frontend/src/components/terminal/SingleCameraView.tsx`](https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/components/terminal/SingleCameraView.tsx) (Video analysis view), [`backend/app/api/routes/responders.py`](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/responders.py) (Responder and duty APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Operator workspace"]
  node_workspace["Application workspace<br/>[App.jsx]"]
  node_camera["Video analysis view"]
  node_polling["Job polling<br/>[useJobPolling.ts]"]
  node_api_client["HTTP client<br/>[client.ts]"]
  node_copilot["AI Copilot<br/>[AiCopilotPanel.jsx]"]
  node_timeline["Evidence timeline"]
end

subgraph group_analysis["Video intelligence"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_analysis_route["Analysis API<br/>[analysis.py]"]
  node_analysis_service["Analysis orchestration"]
  node_inference["Anomaly pipeline"]
  node_i3d["I3D backbone<br/>[pytorch_i3d.py]"]
  node_yolo_route["YOLO API<br/>[yolo.py]"]
  node_yolo_jobs["YOLO job service"]
  node_yolo_inference["YOLO detection and tracking<br/>[yolo26_service.py]"]
end

subgraph group_response["Incident response"]
  node_incidents["Incident management<br/>[incidents.py]"]
  node_dispatch["Dispatch and preview<br/>[dispatch.py]"]
  node_sms["SMS gateway<br/>[sms_gateway.py]"]
  node_responders["Responder and duty APIs<br/>[responders.py]"]
  node_duty["Duty sessions"]
  node_sharing["Secure share links<br/>[share.py]"]
  node_summary["Incident summaries"]
  node_notifications["SMS configuration<br/>[notifications.py]"]
  node_audit_route["Audit API<br/>[audit.py]"]
end

subgraph group_persistence["Application persistence"]
  node_jobs_store[("Job persistence")]
  node_share_store[("Share sessions")]
  node_responders_store[("Responder records")]
  node_audit_store[("Audit log")]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_workspace
node_workspace -.->|"renders"| node_camera
node_camera -->|"submits jobs"| node_api_client
node_camera -->|"polls status"| node_polling
node_camera -.->|"shows evidence"| node_timeline
node_api_client -.->|"requests analysis"| node_analysis_route
node_api_client -.->|"requests tracking"| node_yolo_route
node_backend -->|"registers"| node_analysis_route
node_backend -->|"registers"| node_yolo_route
node_backend -->|"registers"| node_incidents
node_backend -->|"registers"| node_dispatch
node_backend -->|"registers"| node_responders
node_backend -->|"registers"| node_sharing
node_backend -->|"registers"| node_notifications
node_backend -->|"registers"| node_audit_route
node_analysis_route -.->|"runs jobs"| node_analysis_service
node_analysis_service -->|"runs inference"| node_inference
node_inference -->|"extracts features"| node_i3d
node_analysis_service -.->|"stores job state"| node_jobs_store
node_analysis_service -->|"creates incidents"| node_incidents
node_yolo_route -.->|"runs jobs"| node_yolo_jobs
node_yolo_jobs -->|"runs detection"| node_yolo_inference
node_dispatch -->|"sends alerts"| node_sms
node_dispatch -->|"targets officer"| node_responders
node_responders -.->|"tracks duty"| node_duty
node_duty -->|"creates sessions"| node_share_store
node_sharing -.->|"uses sessions"| node_share_store
node_responders -.->|"persists roster"| node_responders_store
node_incidents -->|"offers summaries"| node_summary
node_copilot -->|"queries incidents"| node_summary
node_audit_route -.->|"queries log"| node_audit_store
node_analysis_service -->|"records completion"| node_audit_store

click node_workspace "https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/App.jsx"
click node_camera "https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/components/terminal/SingleCameraView.tsx"
click node_polling "https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/lib/useJobPolling.ts"
click node_api_client "https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/api/client.ts"
click node_copilot "https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/components/dashboard-panel/AiCopilotPanel.jsx"
click node_timeline "https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/components/terminal/TemporalEvidenceTimeline.tsx"
click node_backend "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/main.py"
click node_analysis_route "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/analysis.py"
click node_analysis_service "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/analysis_service.py"
click node_inference "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/inference/final_demo_inference.py"
click node_i3d "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/inference/pytorch_i3d.py"
click node_yolo_route "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/yolo.py"
click node_yolo_jobs "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/yolo_job_service.py"
click node_yolo_inference "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/inference/yolo26_service.py"
click node_incidents "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/incidents.py"
click node_dispatch "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/dispatch.py"
click node_sms "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/sms_gateway.py"
click node_responders "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/responders.py"
click node_duty "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/duty_session_service.py"
click node_sharing "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/share.py"
click node_summary "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/grok_summary_service.py"
click node_notifications "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/notifications.py"
click node_audit_route "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/audit.py"
click node_jobs_store "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/repositories/mongo_job_repository.py"
click node_share_store "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/repositories/share_session_repository.py"
click node_responders_store "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/repositories/responder_repository.py"
click node_audit_store "https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/repositories/audit_repository.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_workspace,node_camera,node_polling,node_api_client,node_copilot,node_timeline toneBlue
class node_backend,node_analysis_route,node_analysis_service,node_inference,node_i3d,node_yolo_route,node_yolo_jobs,node_yolo_inference toneAmber
class node_incidents,node_dispatch,node_sms,node_responders,node_duty,node_sharing,node_summary,node_notifications,node_audit_route toneMint
class node_jobs_store,node_share_store,node_responders_store,node_audit_store toneRose
class node_operator toneIndigo
```

## Components

### Operator workspace

- [Application workspace](https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Video analysis view](https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/components/terminal/SingleCameraView.tsx): `frontend/src/components/terminal/SingleCameraView.tsx`
- [Job polling](https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/lib/useJobPolling.ts): `frontend/src/lib/useJobPolling.ts`
- [HTTP client](https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [AI Copilot](https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/components/dashboard-panel/AiCopilotPanel.jsx): `frontend/src/components/dashboard-panel/AiCopilotPanel.jsx`
- [Evidence timeline](https://github.com/rahulgulabaji/sentinel-x/blob/main/frontend/src/components/terminal/TemporalEvidenceTimeline.tsx): `frontend/src/components/terminal/TemporalEvidenceTimeline.tsx`

### Video intelligence

- [FastAPI application](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/main.py): `backend/app/main.py`
- [Analysis API](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/analysis.py): `backend/app/api/routes/analysis.py`
- [Analysis orchestration](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/analysis_service.py): `backend/app/services/analysis_service.py`
- [Anomaly pipeline](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/inference/final_demo_inference.py): `backend/app/inference/final_demo_inference.py`
- [I3D backbone](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/inference/pytorch_i3d.py): `backend/app/inference/pytorch_i3d.py`
- [YOLO API](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/yolo.py): `backend/app/api/routes/yolo.py`
- [YOLO job service](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/yolo_job_service.py): `backend/app/services/yolo_job_service.py`
- [YOLO detection and tracking](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/inference/yolo26_service.py): `backend/app/inference/yolo26_service.py`

### Incident response

- [Incident management](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/incidents.py): `backend/app/api/routes/incidents.py`
- [Dispatch and preview](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/dispatch.py): `backend/app/api/routes/dispatch.py`
- [SMS gateway](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/sms_gateway.py): `backend/app/services/sms_gateway.py`
- [Responder and duty APIs](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/responders.py): `backend/app/api/routes/responders.py`
- [Duty sessions](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/duty_session_service.py): `backend/app/services/duty_session_service.py`
- [Secure share links](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/share.py): `backend/app/api/routes/share.py`
- [Incident summaries](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/services/grok_summary_service.py): `backend/app/services/grok_summary_service.py`
- [SMS configuration](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/notifications.py): `backend/app/api/routes/notifications.py`
- [Audit API](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/api/routes/audit.py): `backend/app/api/routes/audit.py`

### Application persistence

- [Job persistence](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/repositories/mongo_job_repository.py): `backend/app/repositories/mongo_job_repository.py`
- [Share sessions](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/repositories/share_session_repository.py): `backend/app/repositories/share_session_repository.py`
- [Responder records](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/repositories/responder_repository.py): `backend/app/repositories/responder_repository.py`
- [Audit log](https://github.com/rahulgulabaji/sentinel-x/blob/main/backend/app/repositories/audit_repository.py): `backend/app/repositories/audit_repository.py`

### Other components

- **Operator**

## Connections

- Operator → Application workspace: uses (evidence: `README.md`)
- Application workspace → Video analysis view: renders
- Video analysis view → HTTP client: submits jobs (evidence: `frontend/src/components/terminal/SingleCameraView.tsx`)
- Video analysis view → Job polling: polls status (evidence: `frontend/src/components/terminal/SingleCameraView.tsx`)
- Video analysis view → Evidence timeline: shows evidence (evidence: `frontend/src/components/terminal/SingleCameraView.tsx`)
- HTTP client → Analysis API: requests analysis
- HTTP client → YOLO API: requests tracking
- FastAPI application → Analysis API: registers (evidence: `backend/app/main.py`)
- FastAPI application → YOLO API: registers (evidence: `backend/app/main.py`)
- FastAPI application → Incident management: registers (evidence: `backend/app/main.py`)
- FastAPI application → Dispatch and preview: registers (evidence: `backend/app/main.py`)
- FastAPI application → Responder and duty APIs: registers (evidence: `backend/app/main.py`)
- FastAPI application → Secure share links: registers (evidence: `backend/app/main.py`)
- FastAPI application → SMS configuration: registers (evidence: `backend/app/main.py`)
- FastAPI application → Audit API: registers (evidence: `backend/app/main.py`)
- Analysis API → Analysis orchestration: runs jobs
- Analysis orchestration → Anomaly pipeline: runs inference (evidence: `backend/app/services/analysis_service.py`)
- Anomaly pipeline → I3D backbone: extracts features (evidence: `backend/app/inference/final_demo_inference.py`)
- Analysis orchestration → Job persistence: stores job state
- Analysis orchestration → Incident management: creates incidents (evidence: `README.md`)
- YOLO API → YOLO job service: runs jobs
- YOLO job service → YOLO detection and tracking: runs detection (evidence: `backend/app/services/yolo_job_service.py`)
- Dispatch and preview → SMS gateway: sends alerts (evidence: `README.md`)
- Dispatch and preview → Responder and duty APIs: targets officer (evidence: `README.md`)
- Responder and duty APIs → Duty sessions: tracks duty
- Duty sessions → Share sessions: creates sessions (evidence: `backend/app/services/duty_session_service.py`)
- Secure share links → Share sessions: uses sessions
- Responder and duty APIs → Responder records: persists roster
- Incident management → Incident summaries: offers summaries (evidence: `README.md`)
- AI Copilot → Incident summaries: queries incidents (evidence: `README.md`)
- Audit API → Audit log: queries log
- Analysis orchestration → Audit log: records completion (evidence: `backend/app/services/analysis_service.py`)
