# naveen-prakash-sk/multi-camera-intelligence- architecture

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

- Interactive diagram: https://gitdiagram.com/naveen-prakash-sk/multi-camera-intelligence-
- Repository: https://github.com/naveen-prakash-sk/multi-camera-intelligence-

## Overview

This is a multi-camera CCTV intelligence MVP: users register cameras, process recorded videos into classified keyframe events, then search those events conversationally and inspect camera, timestamp, and visual evidence. The React dashboard also provides camera and event views, while clarification memory maps ambiguous place names to cameras. The graph follows the sampled API, processing, search, and UI calls; README-documented capabilities are included where implementation was not sampled. Evidence-file storage is documented, but its implementation was not shown.

Main entry points: [`backend/app/main.py`](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/main.py) (FastAPI), [`backend/app/services/indexer.py`](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/services/indexer.py) (Event Index and Search), [`frontend/src/App.jsx`](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/frontend/src/App.jsx) (App Router), [`backend/app/services/video_processor.py`](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/services/video_processor.py) (Video Processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_dashboard["Ask Cameras<br/>[Dashboard.jsx]"]
  node_camera_view["Camera View<br/>[Cameras.jsx]"]
  node_event_view["Event View<br/>[Events.jsx]"]
  node_app["App Router<br/>[App.jsx]"]
end

subgraph group_api["API orchestration"]
  node_api["FastAPI<br/>[main.py]"]
  node_schemas["API Schemas<br/>[schemas.py]"]
end

subgraph group_intelligence["Video intelligence"]
  node_processor["Video Processor<br/>[video_processor.py]"]
  node_indexer["Event Index and Search<br/>[indexer.py]"]
end

subgraph group_state["Persistence and evidence"]
  node_memory["Clarification Memory<br/>[memory.py]"]
  node_database[("SQLite Data<br/>[database.py]")]
  node_evidence["Evidence Files"]
end

node_user(("Operator"))
node_operator_video["Recorded CCTV Videos"]
node_browser(("Browser"))

node_user -->|"uses"| node_browser
node_browser -->|"renders"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_camera_view
node_app -->|"routes to"| node_event_view
node_dashboard -->|"requests search and memory"| node_api
node_camera_view -->|"fetches cameras"| node_api
node_event_view -->|"fetches events"| node_api
node_operator_video -.->|"submits processing request"| node_api
node_api -->|"schedules processing"| node_processor
node_processor -->|"saves events"| node_indexer
node_api -->|"searches events"| node_indexer
node_api -->|"lists events"| node_indexer
node_api -->|"reads and writes"| node_memory
node_indexer -->|"resolves mappings"| node_memory
node_memory -->|"reads and writes"| node_database
node_api -->|"initializes and reads cameras"| node_database
node_indexer -->|"stores and queries events"| node_database
node_processor -->|"writes keyframes"| node_evidence
node_api -->|"serves evidence files"| node_evidence
node_api -->|"validates API data"| node_schemas

click node_dashboard "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/frontend/src/pages/Dashboard.jsx"
click node_camera_view "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/frontend/src/pages/Cameras.jsx"
click node_event_view "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/frontend/src/pages/Events.jsx"
click node_app "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/frontend/src/App.jsx"
click node_api "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/main.py"
click node_schemas "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/models/schemas.py"
click node_processor "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/services/video_processor.py"
click node_indexer "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/services/indexer.py"
click node_memory "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/models/memory.py"
click node_database "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/models/database.py"
click node_evidence "https://github.com/naveen-prakash-sk/multi-camera-intelligence-/tree/master/backend/storage"

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_camera_view,node_event_view,node_app,node_browser toneBlue
class node_api,node_schemas toneAmber
class node_processor,node_indexer toneMint
class node_memory,node_database,node_evidence toneRose
class node_user,node_operator_video toneIndigo
```

## Components

### Web interface

- [Ask Cameras](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Camera View](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/frontend/src/pages/Cameras.jsx): `frontend/src/pages/Cameras.jsx`
- [Event View](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/frontend/src/pages/Events.jsx): `frontend/src/pages/Events.jsx`
- [App Router](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`

### API orchestration

- [FastAPI](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/main.py): `backend/app/main.py`
- [API Schemas](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/models/schemas.py): `backend/app/models/schemas.py`

### Video intelligence

- [Video Processor](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/services/video_processor.py): `backend/app/services/video_processor.py`
- [Event Index and Search](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/services/indexer.py): `backend/app/services/indexer.py`

### Persistence and evidence

- [Clarification Memory](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/models/memory.py): `backend/app/models/memory.py`
- [SQLite Data](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/blob/master/backend/app/models/database.py): `backend/app/models/database.py`
- [Evidence Files](https://github.com/naveen-prakash-sk/multi-camera-intelligence-/tree/master/backend/storage): `backend/storage`

### Other components

- **Operator**
- **Recorded CCTV Videos**
- **Browser**

## Connections

- Operator → Browser: uses (evidence: `README.md`)
- Browser → App Router: renders
- App Router → Ask Cameras: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Camera View: routes to (evidence: `frontend/src/App.jsx`)
- App Router → Event View: routes to (evidence: `frontend/src/App.jsx`)
- Ask Cameras → FastAPI: requests search and memory (evidence: `frontend/src/pages/Dashboard.jsx`)
- Camera View → FastAPI: fetches cameras (evidence: `frontend/src/pages/Cameras.jsx`)
- Event View → FastAPI: fetches events (evidence: `frontend/src/pages/Events.jsx`)
- Recorded CCTV Videos → FastAPI: submits processing request (evidence: `README.md`)
- FastAPI → Video Processor: schedules processing (evidence: `backend/app/main.py`)
- Video Processor → Event Index and Search: saves events (evidence: `backend/app/services/video_processor.py`)
- FastAPI → Event Index and Search: searches events (evidence: `backend/app/main.py`)
- FastAPI → Event Index and Search: lists events (evidence: `backend/app/main.py`)
- FastAPI → Clarification Memory: reads and writes (evidence: `backend/app/main.py`)
- Event Index and Search → Clarification Memory: resolves mappings (evidence: `backend/app/services/indexer.py`)
- Clarification Memory → SQLite Data: reads and writes (evidence: `backend/app/models/memory.py`)
- FastAPI → SQLite Data: initializes and reads cameras (evidence: `backend/app/main.py`)
- Event Index and Search → SQLite Data: stores and queries events (evidence: `backend/app/services/indexer.py`)
- Video Processor → Evidence Files: writes keyframes (evidence: `backend/app/services/video_processor.py`)
- FastAPI → Evidence Files: serves evidence files (evidence: `backend/app/main.py`)
- FastAPI → API Schemas: validates API data (evidence: `backend/app/main.py`)
