# ninaddeo11/gp---camera-control- architecture

> Architecture diagram of the GitHub repository ninaddeo11/gp---camera-control-, 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/ninaddeo11/gp---camera-control-
- Repository: https://github.com/ninaddeo11/gp---camera-control-

## Overview

Sentinel Grid federates heterogeneous CCTV sources into a unified, jurisdiction-scoped video analytics and operations platform. Its main workflow discovers camera streams, normalizes them for viewing and inference, detects and tracks vehicles, recognizes plates, then persists events for trace queries and watchlist alerts. Operators use dashboard views for live video, registry GIS, tracing, watchlists, audit, and evidentiary exports. The README documents these product capabilities; sampled excerpts substantiate key orchestration, event-consumer, auth-client, and audit behavior, while some subsystem wiring is documented rather than sampled.

Main entry points: [`apps/web/app/(dashboard)/layout.tsx`](https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/layout.tsx) (Operations Dashboard), [`services/api/main.py`](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/main.py) (API And Consumers), [`services/api/database.py`](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/database.py) (PostGIS Database), [`services/inference/pipeline.py`](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/inference/pipeline.py) (Camera Worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Camera Ingestion"]
  node_adapter["Gateway Adapter<br/>[app.py]"]
  node_stream_manager["Stream Manager<br/>[stream_manager.py]"]
  node_go2rtc["Stream Relay"]
end

subgraph group_vision["Video Analytics"]
  node_inference_main["Inference Coordinator<br/>[main.py]"]
  node_camera_worker["Camera Worker<br/>[pipeline.py]"]
  node_ocr["Plate OCR<br/>[ocr_engine.py]"]
end

subgraph group_backend["API And Data"]
  node_redis_events["Event Streams"]
  node_api_main["API And Consumers<br/>[main.py]"]
  node_tracking_api["Vehicle Tracking<br/>[tracking.py]"]
  node_watchlist_engine["Watchlist Matching"]
  node_alert_api["Live Alerts<br/>[alerts.py]"]
  node_postgres[("PostGIS Database<br/>[database.py]")]
end

subgraph group_security["Access And Evidence"]
  node_rbac["Jurisdiction Access"]
  node_audit["Audit Chain<br/>[audit_service.py]"]
  node_evidence["Evidence Export<br/>[evidence_export.py]"]
end

subgraph group_frontend["Operator Dashboard"]
  node_web_api["Web API Client<br/>[api-client.ts]"]
  node_dashboard["Operations Dashboard<br/>[layout.tsx]"]
  node_video_wall["Video Wall<br/>[page.tsx]"]
  node_registry["Camera Registry<br/>[page.tsx]"]
  node_trace["Vehicle Trace<br/>[page.tsx]"]
  node_watchlist["Watchlist Console<br/>[page.tsx]"]
  node_audit_ui["Audit Log<br/>[page.tsx]"]
end

node_operator(("Police Operator"))
node_camera(("Camera Sources"))
node_gateway["Camera Gateway"]

node_operator -->|"uses"| node_dashboard
node_camera -->|"provides streams"| node_gateway
node_gateway -.->|"catalogue access"| node_adapter
node_adapter -->|"serves catalogue"| node_stream_manager
node_stream_manager -->|"configures streams"| node_go2rtc
node_inference_main -->|"polls catalogue"| node_stream_manager
node_inference_main -->|"starts workers"| node_camera_worker
node_camera_worker -->|"reads video"| node_go2rtc
node_camera_worker -->|"recognizes plates"| node_ocr
node_camera_worker -->|"publishes events"| node_redis_events
node_redis_events -->|"feeds consumers"| node_api_main
node_api_main -->|"mounts routes"| node_tracking_api
node_api_main -->|"starts consumer"| node_watchlist_engine
node_tracking_api -->|"queries events"| node_postgres
node_watchlist_engine -->|"stores matches"| node_postgres
node_watchlist_engine -->|"publishes matches"| node_redis_events
node_api_main -->|"authorizes requests"| node_rbac
node_rbac -->|"resolves scope"| node_postgres
node_audit -->|"appends hash chain"| node_postgres
node_evidence -->|"reads records"| node_postgres
node_dashboard -->|"requests data"| node_web_api
node_web_api -->|"calls API"| node_api_main
node_dashboard -->|"shows live video"| node_video_wall
node_dashboard -->|"shows GIS registry"| node_registry
node_dashboard -->|"shows routes"| node_trace
node_dashboard -->|"shows alerts"| node_watchlist
node_dashboard -->|"shows audit"| node_audit_ui
node_video_wall -->|"plays WHEP"| node_go2rtc
node_watchlist_engine -->|"broadcasts alerts"| node_alert_api
node_audit_ui -->|"loads audit"| node_web_api

click node_adapter "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/gateway-adapter/app.py"
click node_stream_manager "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/ingestion-config/stream_manager.py"
click node_inference_main "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/inference/main.py"
click node_camera_worker "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/inference/pipeline.py"
click node_ocr "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/inference/ocr_engine.py"
click node_api_main "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/main.py"
click node_tracking_api "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/api/tracking.py"
click node_watchlist_engine "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/services/watchlist_engine.py"
click node_alert_api "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/api/alerts.py"
click node_postgres "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/database.py"
click node_rbac "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/services/jurisdiction_service.py"
click node_audit "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/services/audit_service.py"
click node_evidence "https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/services/evidence_export.py"
click node_web_api "https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/lib/api-client.ts"
click node_dashboard "https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/layout.tsx"
click node_video_wall "https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/video-wall/page.tsx"
click node_registry "https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/registry/page.tsx"
click node_trace "https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/trace/page.tsx"
click node_watchlist "https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/watchlist/page.tsx"
click node_audit_ui "https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/audit/page.tsx"

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_adapter,node_stream_manager,node_go2rtc toneBlue
class node_inference_main,node_camera_worker,node_ocr toneAmber
class node_redis_events,node_api_main,node_tracking_api,node_watchlist_engine,node_alert_api,node_postgres toneMint
class node_rbac,node_audit,node_evidence toneRose
class node_web_api,node_dashboard,node_video_wall,node_registry,node_trace,node_watchlist,node_audit_ui,node_operator,node_camera,node_gateway toneIndigo
```

## Components

### Camera Ingestion

- [Gateway Adapter](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/gateway-adapter/app.py): `services/gateway-adapter/app.py`
- [Stream Manager](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/ingestion-config/stream_manager.py): `services/ingestion-config/stream_manager.py`
- **Stream Relay**

### Video Analytics

- [Inference Coordinator](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/inference/main.py): `services/inference/main.py`
- [Camera Worker](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/inference/pipeline.py): `services/inference/pipeline.py`
- [Plate OCR](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/inference/ocr_engine.py): `services/inference/ocr_engine.py`

### API And Data

- **Event Streams**
- [API And Consumers](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/main.py): `services/api/main.py`
- [Vehicle Tracking](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/api/tracking.py): `services/api/api/tracking.py`
- [Watchlist Matching](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/services/watchlist_engine.py): `services/api/services/watchlist_engine.py`
- [Live Alerts](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/api/alerts.py): `services/api/api/alerts.py`
- [PostGIS Database](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/database.py): `services/api/database.py`

### Access And Evidence

- [Jurisdiction Access](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/services/jurisdiction_service.py): `services/api/services/jurisdiction_service.py`
- [Audit Chain](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/services/audit_service.py): `services/api/services/audit_service.py`
- [Evidence Export](https://github.com/ninaddeo11/gp---camera-control-/blob/main/services/api/services/evidence_export.py): `services/api/services/evidence_export.py`

### Operator Dashboard

- [Web API Client](https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/lib/api-client.ts): `apps/web/lib/api-client.ts`
- [Operations Dashboard](https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/layout.tsx): `apps/web/app/(dashboard)/layout.tsx`
- [Video Wall](https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/video-wall/page.tsx): `apps/web/app/(dashboard)/video-wall/page.tsx`
- [Camera Registry](https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/registry/page.tsx): `apps/web/app/(dashboard)/registry/page.tsx`
- [Vehicle Trace](https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/trace/page.tsx): `apps/web/app/(dashboard)/trace/page.tsx`
- [Watchlist Console](https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/watchlist/page.tsx): `apps/web/app/(dashboard)/watchlist/page.tsx`
- [Audit Log](https://github.com/ninaddeo11/gp---camera-control-/blob/main/apps/web/app/(dashboard)/audit/page.tsx): `apps/web/app/(dashboard)/audit/page.tsx`

### Other components

- **Police Operator**
- **Camera Sources**
- **Camera Gateway**

## Connections

- Police Operator → Operations Dashboard: uses
- Camera Sources → Camera Gateway: provides streams
- Camera Gateway → Gateway Adapter: catalogue access
- Gateway Adapter → Stream Manager: serves catalogue
- Stream Manager → Stream Relay: configures streams
- Inference Coordinator → Stream Manager: polls catalogue
- Inference Coordinator → Camera Worker: starts workers
- Camera Worker → Stream Relay: reads video
- Camera Worker → Plate OCR: recognizes plates
- Camera Worker → Event Streams: publishes events
- Event Streams → API And Consumers: feeds consumers
- API And Consumers → Vehicle Tracking: mounts routes
- API And Consumers → Watchlist Matching: starts consumer
- Vehicle Tracking → PostGIS Database: queries events
- Watchlist Matching → PostGIS Database: stores matches
- Watchlist Matching → Event Streams: publishes matches
- API And Consumers → Jurisdiction Access: authorizes requests
- Jurisdiction Access → PostGIS Database: resolves scope
- Audit Chain → PostGIS Database: appends hash chain
- Evidence Export → PostGIS Database: reads records
- Operations Dashboard → Web API Client: requests data
- Web API Client → API And Consumers: calls API
- Operations Dashboard → Video Wall: shows live video
- Operations Dashboard → Camera Registry: shows GIS registry
- Operations Dashboard → Vehicle Trace: shows routes
- Operations Dashboard → Watchlist Console: shows alerts
- Operations Dashboard → Audit Log: shows audit
- Video Wall → Stream Relay: plays WHEP
- Watchlist Matching → Live Alerts: broadcasts alerts
- Audit Log → Web API Client: loads audit
