# techadii-ux/smart_boarder_eye architecture

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

- Interactive diagram: https://gitdiagram.com/techadii-ux/smart_boarder_eye
- Repository: https://github.com/techadii-ux/smart_boarder_eye

## Overview

Smart Border Eye processes a video source for object detection and face recognition, tracks detections, evaluates zone/loitering and line-crossing events, and displays annotated frames. Alerts can be posted to a configured webhook; the Flask dashboard accepts alerts, retains recent records and serves snapshots. The main loop owns calls into the processing components. Source evidence is limited to the sampled files and index; the README is empty.

Main entry points: [`main.py`](https://github.com/techadii-ux/smart_boarder_eye/blob/main/main.py) (Frame orchestrator), [`anomaly.py`](https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py) (Flask dashboard), [`detector.py`](https://github.com/techadii-ux/smart_boarder_eye/blob/main/detector.py) (YOLO detector), [`config.py`](https://github.com/techadii-ux/smart_boarder_eye/blob/main/config.py) (Detection and alert settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Video analysis"]
  node_main["Frame orchestrator<br/>[main.py]"]
  node_detector["YOLO detector<br/>[detector.py]"]
  node_face["Face recognition"]
end

subgraph group_rules["Tracking and alerts"]
  node_tracker["Object tracker<br/>[tracker.py]"]
  node_anomaly["Zone and loitering rules<br/>[anomaly.py]"]
  node_line["Line-crossing rules<br/>[line_cross.py]"]
  node_sender["Alert sender<br/>[anomaly.py]"]
end

subgraph group_dashboard["Alert dashboard"]
  node_dashboard["Flask dashboard<br/>[anomaly.py]"]
  node_alert_api["Alert intake route<br/>[anomaly.py]"]
  node_alert_store[("Alert records and snapshots<br/>[anomaly.py]")]
end

subgraph group_config["Runtime configuration"]
  node_config["Detection and alert settings<br/>[config.py]"]
end

node_camera(("Video source"))
node_operator(("Operator"))
node_viewer(("Dashboard viewer"))
node_webhook(("Configured webhook"))

node_camera -->|"supplies frames"| node_main
node_main -->|"reads settings"| node_config
node_main -->|"runs detection"| node_detector
node_main -->|"recognizes faces"| node_face
node_main -->|"updates tracks"| node_tracker
node_main -->|"checks tracks"| node_anomaly
node_main -->|"checks crossings"| node_line
node_main -->|"sends alerts"| node_sender
node_main -->|"starts server"| node_dashboard
node_detector -->|"reads defaults"| node_config
node_sender -->|"posts alert"| node_webhook
node_sender -->|"posts alert"| node_alert_api
node_dashboard -->|"serves route"| node_alert_api
node_alert_api -->|"stores records"| node_alert_store
node_dashboard -->|"reads records"| node_alert_store
node_viewer -.->|"views alerts"| node_dashboard
node_main -->|"shows frames"| node_operator

click node_main "https://github.com/techadii-ux/smart_boarder_eye/blob/main/main.py"
click node_config "https://github.com/techadii-ux/smart_boarder_eye/blob/main/config.py"
click node_detector "https://github.com/techadii-ux/smart_boarder_eye/blob/main/detector.py"
click node_face "https://github.com/techadii-ux/smart_boarder_eye/blob/main/face_recognition.py"
click node_tracker "https://github.com/techadii-ux/smart_boarder_eye/blob/main/tracker.py"
click node_anomaly "https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py"
click node_line "https://github.com/techadii-ux/smart_boarder_eye/blob/main/line_cross.py"
click node_sender "https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py"
click node_dashboard "https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py"
click node_alert_api "https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py"
click node_alert_store "https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.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_main,node_detector,node_face,node_viewer toneBlue
class node_tracker,node_anomaly,node_line,node_sender toneAmber
class node_dashboard,node_alert_api,node_alert_store,node_webhook toneMint
class node_config toneRose
class node_camera,node_operator toneIndigo
```

## Components

### Video analysis

- [Frame orchestrator](https://github.com/techadii-ux/smart_boarder_eye/blob/main/main.py): `main.py`
- [YOLO detector](https://github.com/techadii-ux/smart_boarder_eye/blob/main/detector.py): `detector.py`
- [Face recognition](https://github.com/techadii-ux/smart_boarder_eye/blob/main/face_recognition.py): `face_recognition.py`

### Tracking and alerts

- [Object tracker](https://github.com/techadii-ux/smart_boarder_eye/blob/main/tracker.py): `tracker.py`
- [Zone and loitering rules](https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py): `anomaly.py`
- [Line-crossing rules](https://github.com/techadii-ux/smart_boarder_eye/blob/main/line_cross.py): `line_cross.py`
- [Alert sender](https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py): `anomaly.py`

### Alert dashboard

- [Flask dashboard](https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py): `anomaly.py`
- [Alert intake route](https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py): `anomaly.py`
- [Alert records and snapshots](https://github.com/techadii-ux/smart_boarder_eye/blob/main/anomaly.py): `anomaly.py`

### Runtime configuration

- [Detection and alert settings](https://github.com/techadii-ux/smart_boarder_eye/blob/main/config.py): `config.py`

### Other components

- **Video source**
- **Operator**
- **Dashboard viewer**
- **Configured webhook**

## Connections

- Video source → Frame orchestrator: supplies frames (evidence: `main.py`)
- Frame orchestrator → Detection and alert settings: reads settings (evidence: `main.py`)
- Frame orchestrator → YOLO detector: runs detection (evidence: `main.py`)
- Frame orchestrator → Face recognition: recognizes faces (evidence: `main.py`)
- Frame orchestrator → Object tracker: updates tracks (evidence: `main.py`)
- Frame orchestrator → Zone and loitering rules: checks tracks (evidence: `main.py`)
- Frame orchestrator → Line-crossing rules: checks crossings (evidence: `main.py`)
- Frame orchestrator → Alert sender: sends alerts (evidence: `main.py`)
- Frame orchestrator → Flask dashboard: starts server (evidence: `main.py`)
- YOLO detector → Detection and alert settings: reads defaults (evidence: `detector.py`)
- Alert sender → Configured webhook: posts alert (evidence: `anomaly.py`)
- Alert sender → Alert intake route: posts alert (evidence: `anomaly.py`)
- Flask dashboard → Alert intake route: serves route (evidence: `anomaly.py`)
- Alert intake route → Alert records and snapshots: stores records (evidence: `anomaly.py`)
- Flask dashboard → Alert records and snapshots: reads records (evidence: `anomaly.py`)
- Dashboard viewer → Flask dashboard: views alerts
- Frame orchestrator → Operator: shows frames (evidence: `main.py`)
