# manisharavindh/raven architecture

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

- Interactive diagram: https://gitdiagram.com/manisharavindh/raven
- Repository: https://github.com/manisharavindh/raven

## Overview

RAVEN assesses road video or live-camera footage, turning visual defects into tracked events with location and image evidence, then saving survey data and reports for review in a dashboard. The CLI and API each assemble or control the processing pipeline; the processor coordinates frame analysis and event enrichment. The dashboard presents detections, maps, evidence, and video. The README gives only the product name, so several subsystem details and browser-to-API connections are supported by source-index references or remain unverified; dashed edges indicate the latter.

Main entry points: [`src/raven/main.py`](https://github.com/manisharavindh/raven/blob/main/src/raven/main.py) (CLI runner), [`src/raven/video/processor.py`](https://github.com/manisharavindh/raven/blob/main/src/raven/video/processor.py) (Video processor), [`src/raven/api/server.py`](https://github.com/manisharavindh/raven/blob/main/src/raven/api/server.py) (API server), [`dashboard/src/App.jsx`](https://github.com/manisharavindh/raven/blob/main/dashboard/src/App.jsx) (Dashboard app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Pipeline control"]
  node_cli["CLI runner<br/>[main.py]"]
  node_api["API server<br/>[server.py]"]
  node_config["Configuration<br/>[config.py]"]
  node_reader["Frame reader<br/>[reader.py]"]
  node_processor["Video processor<br/>[processor.py]"]
  node_buffer["Frame buffer<br/>[frame_buffer.py]"]
end

subgraph group_perception["Visual analysis"]
  node_detector["YOLO detection<br/>[yolo_detector.py]"]
  node_segmenter["Road segmentation<br/>[segmenter.py]"]
end

subgraph group_events["Event enrichment"]
  node_tracker["Event tracking<br/>[tracker.py]"]
  node_gps["GPS simulation<br/>[simulator.py]"]
  node_roadnet["Road network<br/>[road_network.py]"]
  node_matcher["Map matching<br/>[map_matcher.py]"]
  node_evidence["Evidence capture<br/>[capture.py]"]
end

subgraph group_persistence["Survey records"]
  node_jsonstore["JSON export<br/>[json_store.py]"]
  node_database[("SQLite database<br/>[database.py]")]
  node_reports["Report generation<br/>[generator.py]"]
end

subgraph group_review["Dashboard"]
  node_app["Dashboard app<br/>[App.jsx]"]
  node_defects["Defect table<br/>[DefectTable.jsx]"]
  node_mapview["Map viewer<br/>[MapViewer.jsx]"]
  node_evidenceview["Evidence viewer<br/>[EvidenceViewer.jsx]"]
  node_videoview["Video feed<br/>[VideoFeed.jsx]"]
  node_telemetry["Telemetry socket"]
  node_videosocket["Video socket<br/>[useVideoSocket.js]"]
end

node_operator(("Operator"))

node_operator -->|"runs survey"| node_cli
node_operator -->|"controls pipeline"| node_api
node_cli -->|"loads settings"| node_config
node_cli -->|"opens source"| node_reader
node_cli -->|"configures pipeline"| node_processor
node_cli -->|"configures detection"| node_detector
node_cli -->|"configures segmentation"| node_segmenter
node_cli -->|"configures tracking"| node_tracker
node_cli -->|"configures location"| node_gps
node_cli -->|"configures capture"| node_evidence
node_cli -->|"configures export"| node_jsonstore
node_cli -->|"configures reports"| node_reports
node_processor -->|"reads frames"| node_reader
node_processor -->|"detects defects"| node_detector
node_processor -->|"filters road"| node_segmenter
node_processor -->|"updates events"| node_tracker
node_processor -->|"adds positions"| node_gps
node_processor -->|"captures images"| node_evidence
node_processor -->|"streams frames"| node_buffer
node_processor -->|"saves events"| node_jsonstore
node_processor -->|"generates report"| node_reports
node_gps -->|"uses road data"| node_roadnet
node_gps -.->|"uses map matching"| node_matcher
node_jsonstore -->|"writes detections"| node_database
node_reports -->|"finalizes session"| node_database
node_api -->|"loads settings"| node_config
node_api -->|"controls pipeline"| node_processor
node_api -->|"queries records"| node_database
node_api -->|"streams frames"| node_buffer
node_api -->|"serves exports"| node_jsonstore
node_api -->|"serves reports"| node_reports
node_app -->|"renders defects"| node_defects
node_app -->|"renders map"| node_mapview
node_app -->|"renders evidence"| node_evidenceview
node_app -->|"renders video"| node_videoview
node_app -->|"uses telemetry"| node_telemetry
node_videoview -->|"uses video socket"| node_videosocket
node_app -.->|"requests survey data"| node_api
node_telemetry -.->|"receives updates"| node_api
node_videosocket -.->|"receives stream"| node_api

click node_cli "https://github.com/manisharavindh/raven/blob/main/src/raven/main.py"
click node_api "https://github.com/manisharavindh/raven/blob/main/src/raven/api/server.py"
click node_config "https://github.com/manisharavindh/raven/blob/main/src/raven/config.py"
click node_reader "https://github.com/manisharavindh/raven/blob/main/src/raven/video/reader.py"
click node_processor "https://github.com/manisharavindh/raven/blob/main/src/raven/video/processor.py"
click node_buffer "https://github.com/manisharavindh/raven/blob/main/src/raven/video/frame_buffer.py"
click node_detector "https://github.com/manisharavindh/raven/blob/main/src/raven/detection/yolo_detector.py"
click node_segmenter "https://github.com/manisharavindh/raven/blob/main/src/raven/detection/segmenter.py"
click node_tracker "https://github.com/manisharavindh/raven/blob/main/src/raven/tracking/tracker.py"
click node_gps "https://github.com/manisharavindh/raven/blob/main/src/raven/geolocation/simulator.py"
click node_roadnet "https://github.com/manisharavindh/raven/blob/main/src/raven/geolocation/road_network.py"
click node_matcher "https://github.com/manisharavindh/raven/blob/main/src/raven/geolocation/map_matcher.py"
click node_evidence "https://github.com/manisharavindh/raven/blob/main/src/raven/evidence/capture.py"
click node_jsonstore "https://github.com/manisharavindh/raven/blob/main/src/raven/storage/json_store.py"
click node_database "https://github.com/manisharavindh/raven/blob/main/src/raven/storage/database.py"
click node_reports "https://github.com/manisharavindh/raven/blob/main/src/raven/reports/generator.py"
click node_app "https://github.com/manisharavindh/raven/blob/main/dashboard/src/App.jsx"
click node_defects "https://github.com/manisharavindh/raven/blob/main/dashboard/src/components/DefectTable.jsx"
click node_mapview "https://github.com/manisharavindh/raven/blob/main/dashboard/src/components/MapViewer.jsx"
click node_evidenceview "https://github.com/manisharavindh/raven/blob/main/dashboard/src/components/EvidenceViewer.jsx"
click node_videoview "https://github.com/manisharavindh/raven/blob/main/dashboard/src/components/VideoFeed.jsx"
click node_telemetry "https://github.com/manisharavindh/raven/blob/main/dashboard/src/hooks/useTelemetrySocket.js"
click node_videosocket "https://github.com/manisharavindh/raven/blob/main/dashboard/src/hooks/useVideoSocket.js"

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_cli,node_api,node_config,node_reader,node_processor,node_buffer toneBlue
class node_detector,node_segmenter toneAmber
class node_tracker,node_gps,node_roadnet,node_matcher,node_evidence toneMint
class node_jsonstore,node_database,node_reports toneRose
class node_app,node_defects,node_mapview,node_evidenceview,node_videoview,node_telemetry,node_videosocket,node_operator toneIndigo
```

## Components

### Pipeline control

- [CLI runner](https://github.com/manisharavindh/raven/blob/main/src/raven/main.py): `src/raven/main.py`
- [API server](https://github.com/manisharavindh/raven/blob/main/src/raven/api/server.py): `src/raven/api/server.py`
- [Configuration](https://github.com/manisharavindh/raven/blob/main/src/raven/config.py): `src/raven/config.py`
- [Frame reader](https://github.com/manisharavindh/raven/blob/main/src/raven/video/reader.py): `src/raven/video/reader.py`
- [Video processor](https://github.com/manisharavindh/raven/blob/main/src/raven/video/processor.py): `src/raven/video/processor.py`
- [Frame buffer](https://github.com/manisharavindh/raven/blob/main/src/raven/video/frame_buffer.py): `src/raven/video/frame_buffer.py`

### Visual analysis

- [YOLO detection](https://github.com/manisharavindh/raven/blob/main/src/raven/detection/yolo_detector.py): `src/raven/detection/yolo_detector.py`
- [Road segmentation](https://github.com/manisharavindh/raven/blob/main/src/raven/detection/segmenter.py): `src/raven/detection/segmenter.py`

### Event enrichment

- [Event tracking](https://github.com/manisharavindh/raven/blob/main/src/raven/tracking/tracker.py): `src/raven/tracking/tracker.py`
- [GPS simulation](https://github.com/manisharavindh/raven/blob/main/src/raven/geolocation/simulator.py): `src/raven/geolocation/simulator.py`
- [Road network](https://github.com/manisharavindh/raven/blob/main/src/raven/geolocation/road_network.py): `src/raven/geolocation/road_network.py`
- [Map matching](https://github.com/manisharavindh/raven/blob/main/src/raven/geolocation/map_matcher.py): `src/raven/geolocation/map_matcher.py`
- [Evidence capture](https://github.com/manisharavindh/raven/blob/main/src/raven/evidence/capture.py): `src/raven/evidence/capture.py`

### Survey records

- [JSON export](https://github.com/manisharavindh/raven/blob/main/src/raven/storage/json_store.py): `src/raven/storage/json_store.py`
- [SQLite database](https://github.com/manisharavindh/raven/blob/main/src/raven/storage/database.py): `src/raven/storage/database.py`
- [Report generation](https://github.com/manisharavindh/raven/blob/main/src/raven/reports/generator.py): `src/raven/reports/generator.py`

### Dashboard

- [Dashboard app](https://github.com/manisharavindh/raven/blob/main/dashboard/src/App.jsx): `dashboard/src/App.jsx`
- [Defect table](https://github.com/manisharavindh/raven/blob/main/dashboard/src/components/DefectTable.jsx): `dashboard/src/components/DefectTable.jsx`
- [Map viewer](https://github.com/manisharavindh/raven/blob/main/dashboard/src/components/MapViewer.jsx): `dashboard/src/components/MapViewer.jsx`
- [Evidence viewer](https://github.com/manisharavindh/raven/blob/main/dashboard/src/components/EvidenceViewer.jsx): `dashboard/src/components/EvidenceViewer.jsx`
- [Video feed](https://github.com/manisharavindh/raven/blob/main/dashboard/src/components/VideoFeed.jsx): `dashboard/src/components/VideoFeed.jsx`
- [Telemetry socket](https://github.com/manisharavindh/raven/blob/main/dashboard/src/hooks/useTelemetrySocket.js): `dashboard/src/hooks/useTelemetrySocket.js`
- [Video socket](https://github.com/manisharavindh/raven/blob/main/dashboard/src/hooks/useVideoSocket.js): `dashboard/src/hooks/useVideoSocket.js`

### Other components

- **Operator**

## Connections

- Operator → CLI runner: runs survey (evidence: `src/raven/main.py`)
- Operator → API server: controls pipeline (evidence: `src/raven/api/server.py`)
- CLI runner → Configuration: loads settings (evidence: `src/raven/main.py`)
- CLI runner → Frame reader: opens source (evidence: `src/raven/main.py`)
- CLI runner → Video processor: configures pipeline (evidence: `src/raven/main.py`)
- CLI runner → YOLO detection: configures detection (evidence: `src/raven/main.py`)
- CLI runner → Road segmentation: configures segmentation (evidence: `src/raven/main.py`)
- CLI runner → Event tracking: configures tracking (evidence: `src/raven/main.py`)
- CLI runner → GPS simulation: configures location (evidence: `src/raven/main.py`)
- CLI runner → Evidence capture: configures capture (evidence: `src/raven/main.py`)
- CLI runner → JSON export: configures export (evidence: `src/raven/main.py`)
- CLI runner → Report generation: configures reports (evidence: `src/raven/main.py`)
- Video processor → Frame reader: reads frames (evidence: `src/raven/video/processor.py`)
- Video processor → YOLO detection: detects defects (evidence: `src/raven/video/processor.py`)
- Video processor → Road segmentation: filters road (evidence: `src/raven/video/processor.py`)
- Video processor → Event tracking: updates events (evidence: `src/raven/video/processor.py`)
- Video processor → GPS simulation: adds positions (evidence: `src/raven/video/processor.py`)
- Video processor → Evidence capture: captures images (evidence: `src/raven/video/processor.py`)
- Video processor → Frame buffer: streams frames (evidence: `src/raven/video/processor.py`)
- Video processor → JSON export: saves events (evidence: `src/raven/video/processor.py`)
- Video processor → Report generation: generates report (evidence: `src/raven/video/processor.py`)
- GPS simulation → Road network: uses road data (evidence: `src/raven/geolocation/simulator.py`)
- GPS simulation → Map matching: uses map matching
- JSON export → SQLite database: writes detections (evidence: `src/raven/storage/json_store.py`)
- Report generation → SQLite database: finalizes session (evidence: `src/raven/reports/generator.py`)
- API server → Configuration: loads settings (evidence: `src/raven/api/server.py`)
- API server → Video processor: controls pipeline (evidence: `src/raven/api/server.py`)
- API server → SQLite database: queries records (evidence: `src/raven/api/server.py`)
- API server → Frame buffer: streams frames (evidence: `src/raven/api/server.py`)
- API server → JSON export: serves exports (evidence: `src/raven/api/server.py`)
- API server → Report generation: serves reports (evidence: `src/raven/api/server.py`)
- Dashboard app → Defect table: renders defects (evidence: `dashboard/src/App.jsx`)
- Dashboard app → Map viewer: renders map (evidence: `dashboard/src/App.jsx`)
- Dashboard app → Evidence viewer: renders evidence (evidence: `dashboard/src/App.jsx`)
- Dashboard app → Video feed: renders video (evidence: `dashboard/src/App.jsx`)
- Dashboard app → Telemetry socket: uses telemetry (evidence: `dashboard/src/App.jsx`)
- Video feed → Video socket: uses video socket (evidence: `dashboard/src/components/VideoFeed.jsx`)
- Dashboard app → API server: requests survey data
- Telemetry socket → API server: receives updates
- Video socket → API server: receives stream
