# shakhboz06/ai-powered-video-analytics-security-pipeline architecture

> Architecture diagram of the GitHub repository shakhboz06/ai-powered-video-analytics-security-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shakhboz06/ai-powered-video-analytics-security-pipeline
- Repository: https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline

## Overview

This is a prototype video-security analytics pipeline. Camera frames or uploaded clips are ingested, analyzed by Python inference workers, and passed to a Go aggregator for alert rules and persistence; the Go API and Nuxt dashboard expose detections, alerts, zones, live views, and upload results. Evidence-frame handling and notification are additional product branches. Dashed edges mark relationships documented only at a high level; unsampled source is not treated as verified.

Main entry points: [`dashboard/main.go`](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/dashboard/main.go) (Dashboard API), [`aggregator/main.go`](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/aggregator/main.go) (Alert aggregator), [`nuxt-dashboard/app/composables/useApi.ts`](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/nuxt-dashboard/app/composables/useApi.ts) (Frontend API client), [`db/redis/cache/storage.go`](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/db/redis/cache/storage.go) (Redis cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Video ingestion"]
  node_upload_ingest["Upload ingestor<br/>[upload_ingestor.py]"]
  node_live_ingest["Camera ingestor<br/>[ingestor.py]"]
end

subgraph group_inference["AI inference"]
  node_worker["Inference worker<br/>[worker.py]"]
  node_worker_legacy["Worker variant<br/>[worker-1.py]"]
end

subgraph group_aggregation["Alert processing"]
  node_aggregator["Alert aggregator<br/>[main.go]"]
  node_rule_detectors["Behavior detectors"]
  node_notifier["Alert notifier<br/>[main.go]"]
end

subgraph group_services["API and storage"]
  node_upload_api["Upload endpoint<br/>[upload.go]"]
  node_postgres[("TimescaleDB<br/>[db.go]")]
  node_redis[("Redis cache<br/>[storage.go]")]
  node_dashboard_api["Dashboard API<br/>[main.go]"]
  node_detection_store["Detection store<br/>[detections.go]"]
end

subgraph group_experience["Dashboard experience"]
  node_browser_api["Frontend API client<br/>[useApi.ts]"]
  node_dashboard_ui["Security dashboard<br/>[alerts.vue]"]
end

node_camera(("Camera feed"))
node_operator(("Operator / browser"))
node_kafka["Kafka topics"]
node_supabase[("Private evidence storage")]

node_camera -->|"provides frames"| node_live_ingest
node_live_ingest -->|"publishes frames"| node_kafka
node_operator -.->|"submits clip"| node_upload_api
node_upload_api -.->|"queues job"| node_upload_ingest
node_upload_ingest -->|"publishes frames"| node_kafka
node_kafka -.->|"dispatches frames"| node_worker
node_kafka -.->|"dispatches frames"| node_worker_legacy
node_worker -.->|"publishes results"| node_kafka
node_worker_legacy -->|"stores evidence"| node_supabase
node_kafka -.->|"delivers detections"| node_aggregator
node_aggregator -.->|"applies rules"| node_rule_detectors
node_aggregator -->|"writes alerts and detections"| node_postgres
node_aggregator -.->|"publishes notifications"| node_redis
node_redis -.->|"notifies subscribers"| node_notifier
node_operator -.->|"uses dashboard"| node_browser_api
node_browser_api -->|"requests API data"| node_dashboard_api
node_dashboard_api -->|"routes detection queries"| node_detection_store
node_detection_store -.->|"reads detections"| node_postgres
node_dashboard_api -->|"serves live streams"| node_redis
node_dashboard_api -.->|"returns API results"| node_browser_api
node_browser_api -.->|"feeds dashboard views"| node_dashboard_ui
node_supabase -.->|"serves signed URLs"| node_dashboard_api

click node_upload_api "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/dashboard/cmd/api/upload.go"
click node_upload_ingest "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/ingestor/upload_ingestor.py"
click node_live_ingest "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/ingestor/ingestor.py"
click node_worker "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/worker/worker.py"
click node_worker_legacy "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/worker-1.py"
click node_aggregator "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/aggregator/main.go"
click node_rule_detectors "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/tree/master/aggregator"
click node_postgres "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/db/postgres/db.go"
click node_redis "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/db/redis/cache/storage.go"
click node_notifier "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/notifier/main.go"
click node_dashboard_api "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/dashboard/main.go"
click node_detection_store "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/dashboard/internal/store/detections.go"
click node_browser_api "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/nuxt-dashboard/app/composables/useApi.ts"
click node_dashboard_ui "https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/nuxt-dashboard/app/pages/alerts.vue"

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_upload_ingest,node_live_ingest,node_operator toneBlue
class node_worker,node_worker_legacy,node_supabase toneAmber
class node_aggregator,node_rule_detectors,node_notifier toneMint
class node_upload_api,node_postgres,node_redis,node_dashboard_api,node_detection_store toneRose
class node_browser_api,node_dashboard_ui,node_camera,node_kafka toneIndigo
```

## Components

### Video ingestion

- [Upload ingestor](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/ingestor/upload_ingestor.py): `ingestor/upload_ingestor.py`
- [Camera ingestor](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/ingestor/ingestor.py): `ingestor/ingestor.py`

### AI inference

- [Inference worker](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/worker/worker.py): `worker/worker.py`
- [Worker variant](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/worker-1.py): `worker-1.py`

### Alert processing

- [Alert aggregator](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/aggregator/main.go): `aggregator/main.go`
- [Behavior detectors](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/tree/master/aggregator): `aggregator`
- [Alert notifier](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/notifier/main.go): `notifier/main.go`

### API and storage

- [Upload endpoint](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/dashboard/cmd/api/upload.go): `dashboard/cmd/api/upload.go`
- [TimescaleDB](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/db/postgres/db.go): `db/postgres/db.go`
- [Redis cache](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/db/redis/cache/storage.go): `db/redis/cache/storage.go`
- [Dashboard API](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/dashboard/main.go): `dashboard/main.go`
- [Detection store](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/dashboard/internal/store/detections.go): `dashboard/internal/store/detections.go`

### Dashboard experience

- [Frontend API client](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/nuxt-dashboard/app/composables/useApi.ts): `nuxt-dashboard/app/composables/useApi.ts`
- [Security dashboard](https://github.com/shakhboz06/ai-powered-video-analytics-security-pipeline/blob/master/nuxt-dashboard/app/pages/alerts.vue): `nuxt-dashboard/app/pages/alerts.vue`

### Other components

- **Camera feed**
- **Operator / browser**
- **Kafka topics**
- **Private evidence storage**

## Connections

- Camera feed → Camera ingestor: provides frames (evidence: `ingestor/ingestor.py`)
- Camera ingestor → Kafka topics: publishes frames (evidence: `ingestor/ingestor.py`)
- Operator / browser → Upload endpoint: submits clip
- Upload endpoint → Upload ingestor: queues job
- Upload ingestor → Kafka topics: publishes frames (evidence: `ingestor/upload_ingestor.py`)
- Kafka topics → Inference worker: dispatches frames
- Kafka topics → Worker variant: dispatches frames
- Inference worker → Kafka topics: publishes results
- Worker variant → Private evidence storage: stores evidence (evidence: `worker-1.py`)
- Kafka topics → Alert aggregator: delivers detections
- Alert aggregator → Behavior detectors: applies rules
- Alert aggregator → TimescaleDB: writes alerts and detections (evidence: `aggregator/main.go`)
- Alert aggregator → Redis cache: publishes notifications
- Redis cache → Alert notifier: notifies subscribers
- Operator / browser → Frontend API client: uses dashboard
- Frontend API client → Dashboard API: requests API data (evidence: `nuxt-dashboard/app/composables/useApi.ts`)
- Dashboard API → Detection store: routes detection queries (evidence: `dashboard/main.go`)
- Detection store → TimescaleDB: reads detections
- Dashboard API → Redis cache: serves live streams (evidence: `dashboard/main.go`)
- Dashboard API → Frontend API client: returns API results
- Frontend API client → Security dashboard: feeds dashboard views
- Private evidence storage → Dashboard API: serves signed URLs
