# aaradhya1998/anrp--vehicle-trajactory architecture

> Architecture diagram of the GitHub repository aaradhya1998/anrp--vehicle-trajactory, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aaradhya1998/anrp--vehicle-trajactory
- Repository: https://github.com/aaradhya1998/anrp--vehicle-trajactory

## Overview

ANPR Trajectory Tracker processes video for plate text, exposes detection and alert data through an API, and presents it in either a browser dashboard or a Streamlit dashboard. The README describes cross-camera trajectories and blacklist, cloned-plate, and loop alerts. Sampled detector.py currently performs video reading and OCR/format validation but does not call logger.py or alerts.py; those runtime links are therefore not inferred. Alert detection helpers and camera-registry use are not fully evidenced in the sampled source.

Main entry points: [`api.py`](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/api.py) (FastAPI service), [`detector.py`](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/detector.py) (Video detector), [`dashboard/app.js`](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/dashboard/app.js) (Web dashboard), [`dashboard.py`](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/dashboard.py) (Streamlit dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Plate capture"]
  node_detector["Video detector<br/>[detector.py]"]
end

subgraph group_records["Records and alerts"]
  node_logger["Detection logger<br/>[logger.py]"]
  node_detections[("Detection CSV")]
  node_alerts["Alert rules<br/>[alerts.py]"]
  node_blacklist[("Plate blacklist<br/>[blacklist.txt]")]
  node_alertcsv[("Alert CSV")]
  node_cameras["Camera registry<br/>[cameras.json]"]
end

subgraph group_backend["API backend"]
  node_api["FastAPI service<br/>[api.py]"]
end

subgraph group_ui["Dashboards"]
  node_webui["Web dashboard<br/>[app.js]"]
  node_streamlit["Streamlit dashboard<br/>[dashboard.py]"]
end

node_operator(("Operator"))
node_video["Video feed"]
node_ocr{{"EasyOCR"}}

node_operator -->|"starts processing"| node_detector
node_video -->|"video input"| node_detector
node_detector -->|"reads text"| node_ocr
node_operator -->|"views dashboard"| node_webui
node_operator -->|"views dashboard"| node_streamlit
node_webui -->|"requests data"| node_api
node_streamlit -->|"requests data"| node_api
node_api -->|"reads records"| node_detections
node_api -->|"reads and updates"| node_alertcsv
node_alerts -->|"loads entries"| node_blacklist
node_logger -->|"reads and appends"| node_detections

click node_detector "https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/detector.py"
click node_logger "https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/logger.py"
click node_alerts "https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/alerts.py"
click node_blacklist "https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/data/blacklist.txt"
click node_cameras "https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/cameras.json"
click node_api "https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/api.py"
click node_webui "https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/dashboard/app.js"
click node_streamlit "https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/dashboard.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_detector toneBlue
class node_logger,node_detections,node_alerts,node_blacklist,node_alertcsv,node_cameras toneAmber
class node_api toneMint
class node_webui,node_streamlit toneRose
class node_operator,node_video,node_ocr toneIndigo
```

## Components

### Plate capture

- [Video detector](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/detector.py): `detector.py`

### Records and alerts

- [Detection logger](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/logger.py): `logger.py`
- **Detection CSV**
- [Alert rules](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/alerts.py): `alerts.py`
- [Plate blacklist](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/data/blacklist.txt): `data/blacklist.txt`
- **Alert CSV**
- [Camera registry](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/cameras.json): `cameras.json`

### API backend

- [FastAPI service](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/api.py): `api.py`

### Dashboards

- [Web dashboard](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/dashboard/app.js): `dashboard/app.js`
- [Streamlit dashboard](https://github.com/aaradhya1998/anrp--vehicle-trajactory/blob/main/dashboard.py): `dashboard.py`

### Other components

- **Operator**
- **Video feed**
- **EasyOCR**

## Connections

- Operator → Video detector: starts processing
- Video feed → Video detector: video input
- Video detector → EasyOCR: reads text
- Operator → Web dashboard: views dashboard
- Operator → Streamlit dashboard: views dashboard
- Web dashboard → FastAPI service: requests data
- Streamlit dashboard → FastAPI service: requests data
- FastAPI service → Detection CSV: reads records
- FastAPI service → Alert CSV: reads and updates
- Alert rules → Plate blacklist: loads entries
- Detection logger → Detection CSV: reads and appends
