# hp7690/border_surveillance_alert_dashboard_v2_fixed--1- architecture

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

- Interactive diagram: https://gitdiagram.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-
- Repository: https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-

## Overview

IBVAP processes CCTV, video, or webcam frames into detections and alerts, then presents live surveillance and alert history to authenticated operators. Its principal workflow is documented as a per-camera VideoProcessor running detection and behavior analysis, followed by centralized alerting, event/evidence recording, and dashboard delivery. The README also describes signed chain-of-custody records and offline bundle verification. Edges reflect the README and shown source/index references; unsampled internals are not inferred beyond those references.

Main entry points: [`app.py`](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/app.py) (Video processor), [`core/alert_manager.py`](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/alert_manager.py) (Alert manager), [`core/suspicious_activity.py`](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/suspicious_activity.py) (Suspicious activity), [`core/webhooks.py`](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/webhooks.py) (Alert webhooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_surveillance["Video surveillance"]
  node_processor["Video processor<br/>[app.py]"]
end

subgraph group_analysis["Detection and analysis"]
  node_person_vehicle["Person and vehicle tracking<br/>[detector.py]"]
  node_fence["Fence and loitering<br/>[virtual_fence.py]"]
  node_suspicious["Suspicious activity"]
  node_pose["Pose analysis<br/>[pose_detector.py]"]
  node_night["Night motion<br/>[night_detector.py]"]
  node_weapon["Weapon detection<br/>[weapon_detector.py]"]
  node_face_detection["Face detection<br/>[face_detector.py]"]
  node_face_recognition["Known-face matching<br/>[face_recognizer.py]"]
  node_anpr["Plate recognition<br/>[anpr.py]"]
end

subgraph group_operations["Alerts and operations"]
  node_alert_manager["Alert manager<br/>[alert_manager.py]"]
  node_threat["Threat scoring<br/>[threat_score.py]"]
  node_event_log[("Event log and snapshots<br/>[event_log.py]")]
  node_auth["Dashboard authentication<br/>[auth.py]"]
  node_dashboard["Operator dashboard<br/>[dashboard.html]"]
  node_webhooks["Alert webhooks<br/>[webhooks.py]"]
end

subgraph group_evidence["Evidence custody"]
  node_ledger[("Signed evidence ledger<br/>[ledger.py]")]
  node_bundle["Offline bundle verifier<br/>[verify_bundle.py]"]
end

node_camera(("Camera or video"))
node_operator(("Logged-in operator"))
node_webhook_service(("External alert subscribers"))

node_camera -->|"supplies frames"| node_processor
node_processor -->|"detects and tracks"| node_person_vehicle
node_processor -->|"checks zones"| node_fence
node_processor -->|"checks weapons"| node_weapon
node_processor -->|"analyzes activity"| node_suspicious
node_suspicious -->|"uses pose"| node_pose
node_processor -->|"detects faces"| node_face_detection
node_processor -->|"checks known faces"| node_face_recognition
node_processor -->|"reads plates"| node_anpr
node_processor -->|"checks night motion"| node_night
node_processor -->|"raises alerts"| node_alert_manager
node_alert_manager -->|"scores threats"| node_threat
node_alert_manager -->|"logs events"| node_event_log
node_alert_manager -->|"records evidence"| node_ledger
node_alert_manager -->|"notifies subscribers"| node_webhooks
node_webhooks -->|"posts alerts"| node_webhook_service
node_alert_manager -->|"pushes alerts"| node_dashboard
node_operator -->|"views alerts"| node_dashboard
node_operator -->|"authenticates"| node_auth
node_ledger -->|"exports custody data"| node_bundle

click node_processor "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/app.py"
click node_person_vehicle "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/detector.py"
click node_fence "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/virtual_fence.py"
click node_suspicious "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/suspicious_activity.py"
click node_pose "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/pose_detector.py"
click node_night "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/night_detector.py"
click node_weapon "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/weapon_detector.py"
click node_face_detection "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/face_detector.py"
click node_face_recognition "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/face_recognizer.py"
click node_anpr "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/anpr.py"
click node_alert_manager "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/alert_manager.py"
click node_threat "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/threat_score.py"
click node_event_log "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/event_log.py"
click node_auth "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/auth.py"
click node_dashboard "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/templates/dashboard.html"
click node_webhooks "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/webhooks.py"
click node_ledger "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/ledger.py"
click node_bundle "https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/verify_bundle.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_processor toneBlue
class node_person_vehicle,node_fence,node_suspicious,node_pose,node_night,node_weapon,node_face_detection,node_face_recognition,node_anpr toneAmber
class node_alert_manager,node_threat,node_event_log,node_auth,node_dashboard,node_webhooks toneMint
class node_ledger,node_bundle toneRose
class node_camera,node_operator,node_webhook_service toneIndigo
```

## Components

### Video surveillance

- [Video processor](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/app.py): `app.py`

### Detection and analysis

- [Person and vehicle tracking](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/detector.py): `core/detector.py`
- [Fence and loitering](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/virtual_fence.py): `core/virtual_fence.py`
- [Suspicious activity](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/suspicious_activity.py): `core/suspicious_activity.py`
- [Pose analysis](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/pose_detector.py): `core/pose_detector.py`
- [Night motion](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/night_detector.py): `core/night_detector.py`
- [Weapon detection](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/weapon_detector.py): `core/weapon_detector.py`
- [Face detection](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/face_detector.py): `core/face_detector.py`
- [Known-face matching](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/face_recognizer.py): `core/face_recognizer.py`
- [Plate recognition](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/anpr.py): `core/anpr.py`

### Alerts and operations

- [Alert manager](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/alert_manager.py): `core/alert_manager.py`
- [Threat scoring](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/threat_score.py): `core/threat_score.py`
- [Event log and snapshots](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/event_log.py): `core/event_log.py`
- [Dashboard authentication](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/auth.py): `core/auth.py`
- [Operator dashboard](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Alert webhooks](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/webhooks.py): `core/webhooks.py`

### Evidence custody

- [Signed evidence ledger](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/core/ledger.py): `core/ledger.py`
- [Offline bundle verifier](https://github.com/hp7690/border_surveillance_alert_dashboard_v2_fixed--1-/blob/main/verify_bundle.py): `verify_bundle.py`

### Other components

- **Camera or video**
- **Logged-in operator**
- **External alert subscribers**

## Connections

- Camera or video → Video processor: supplies frames (evidence: `README.md`)
- Video processor → Person and vehicle tracking: detects and tracks (evidence: `README.md`)
- Video processor → Fence and loitering: checks zones (evidence: `README.md`)
- Video processor → Weapon detection: checks weapons (evidence: `README.md`)
- Video processor → Suspicious activity: analyzes activity (evidence: `README.md`)
- Suspicious activity → Pose analysis: uses pose (evidence: `core/suspicious_activity.py`)
- Video processor → Face detection: detects faces (evidence: `README.md`)
- Video processor → Known-face matching: checks known faces (evidence: `app.py`)
- Video processor → Plate recognition: reads plates (evidence: `app.py`)
- Video processor → Night motion: checks night motion (evidence: `README.md`)
- Video processor → Alert manager: raises alerts (evidence: `README.md`)
- Alert manager → Threat scoring: scores threats (evidence: `core/alert_manager.py`)
- Alert manager → Event log and snapshots: logs events (evidence: `core/alert_manager.py`)
- Alert manager → Signed evidence ledger: records evidence (evidence: `core/alert_manager.py`)
- Alert manager → Alert webhooks: notifies subscribers (evidence: `README.md`)
- Alert webhooks → External alert subscribers: posts alerts (evidence: `core/webhooks.py`)
- Alert manager → Operator dashboard: pushes alerts (evidence: `README.md`)
- Logged-in operator → Operator dashboard: views alerts (evidence: `README.md`)
- Logged-in operator → Dashboard authentication: authenticates
- Signed evidence ledger → Offline bundle verifier: exports custody data (evidence: `README.md`)
