# shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp architecture

> Architecture diagram of the GitHub repository shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp
- Repository: https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp

## Overview

GateWatch is a multi-lane ANPR control dashboard. Operators view passage and lane summaries, inspect a lane’s annotated feed or passage log, and can submit a frame for live inference. The backend runs vehicle/plate detection and OCR, exposes inference and Lane 4 streaming endpoints, and serves live passages; the frontend presents those results alongside demo-derived summaries. The excerpts establish the API and most frontend calls, but not every backend route-to-engine detail, so uncertain links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/App.tsx) (Dashboard Shell), [`src/services/inference.ts`](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/services/inference.ts) (Inference Client), [`src/components/Overview.tsx`](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/Overview.tsx) (Overview), [`src/components/LaneDetail.tsx`](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/LaneDetail.tsx) (Lane Detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard UI"]
  node_app["Dashboard Shell<br/>[App.tsx]"]
  node_overview["Overview<br/>[Overview.tsx]"]
  node_lane_detail["Lane Detail<br/>[LaneDetail.tsx]"]
  node_passage_log["Passage Log<br/>[PassageLog.tsx]"]
  node_live_infer["Frame Inference<br/>[LiveInfer.tsx]"]
  node_lane_live["Lane Live View<br/>[Lane4Live.tsx]"]
  node_sidebar["Navigation<br/>[Sidebar.tsx]"]
  node_feed["MJPEG Feed<br/>[LaneMjpegFeed.tsx]"]
  node_preview["Lane Preview Poller<br/>[useLane4Preview.ts]"]
  node_stats["Stat Cards<br/>[StatCard.tsx]"]
  node_client["Inference Client<br/>[inference.ts]"]
end

subgraph group_backend["Inference API"]
  node_api["FastAPI Routes<br/>[main.py]"]
  node_lane_dispatch["Lane Stream Adapter<br/>[lane_stream.py]"]
end

subgraph group_engine["Detection Engines"]
  node_config["Model Configuration<br/>[config.py]"]
  node_inference["Frame Detection<br/>[inference.py]"]
  node_lane_engine["Lane 4 Engine"]
  node_weights[("YOLO Weights<br/>[best.pt]")]
  node_plate_weights[("Plate Weights")]
end

subgraph group_domain["Passage Analytics"]
  node_passages[("Live Passage Records<br/>[main.py]")]
  node_demo_data["Summary Calculations<br/>[demoData.ts]"]
  node_format["Display Formatting<br/>[format.ts]"]
  node_types["Domain Types<br/>[types.ts]"]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_app
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_overview
node_app -->|"renders"| node_lane_detail
node_app -->|"renders"| node_passage_log
node_app -->|"polls passages"| node_client
node_app -->|"summarizes"| node_demo_data
node_overview -->|"calculates charts"| node_demo_data
node_overview -->|"requests preview"| node_preview
node_overview -->|"renders feeds"| node_feed
node_overview -->|"renders cards"| node_stats
node_lane_detail -->|"renders feed"| node_feed
node_lane_detail -->|"renders cards"| node_stats
node_lane_detail -->|"formats values"| node_format
node_passage_log -->|"formats values"| node_format
node_live_infer -->|"submits frames"| node_client
node_lane_live -->|"fetches inference"| node_client
node_preview -->|"uses API base"| node_client
node_client -->|"calls endpoints"| node_api
node_api -->|"runs frame inference"| node_inference
node_api -->|"controls stream"| node_lane_dispatch
node_lane_dispatch -->|"delegates"| node_lane_engine
node_inference -->|"loads configured weights"| node_config
node_lane_engine -->|"uses lane settings"| node_config
node_inference -->|"loads vehicle model"| node_weights
node_inference -->|"loads plate model"| node_plate_weights
node_api -->|"serves live records"| node_passages
node_app -->|"polls live records"| node_passages
node_demo_data -->|"uses domain types"| node_types
node_client -->|"returns typed data"| node_types

click node_app "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/App.tsx"
click node_overview "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/Overview.tsx"
click node_lane_detail "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/LaneDetail.tsx"
click node_passage_log "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/PassageLog.tsx"
click node_live_infer "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/LiveInfer.tsx"
click node_lane_live "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/Lane4Live.tsx"
click node_sidebar "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/Sidebar.tsx"
click node_feed "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/LaneMjpegFeed.tsx"
click node_preview "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/hooks/useLane4Preview.ts"
click node_stats "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/StatCard.tsx"
click node_client "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/services/inference.ts"
click node_api "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/main.py"
click node_config "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/config.py"
click node_inference "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/inference.py"
click node_lane_engine "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/vehicle_pipeline.py"
click node_lane_dispatch "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/lane_stream.py"
click node_weights "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/models/best.pt"
click node_plate_weights "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/models/number-plate-yolo26s.pt"
click node_passages "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/main.py"
click node_demo_data "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/data/demoData.ts"
click node_format "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/utils/format.ts"
click node_types "https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/types.ts"

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_app,node_overview,node_lane_detail,node_passage_log,node_live_infer,node_lane_live,node_sidebar,node_feed,node_preview,node_stats,node_client toneBlue
class node_api,node_lane_dispatch toneAmber
class node_config,node_inference,node_lane_engine,node_weights,node_plate_weights toneMint
class node_passages,node_demo_data,node_format,node_types toneRose
class node_operator toneIndigo
```

## Components

### Dashboard UI

- [Dashboard Shell](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/App.tsx): `src/App.tsx`
- [Overview](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/Overview.tsx): `src/components/Overview.tsx`
- [Lane Detail](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/LaneDetail.tsx): `src/components/LaneDetail.tsx`
- [Passage Log](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/PassageLog.tsx): `src/components/PassageLog.tsx`
- [Frame Inference](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/LiveInfer.tsx): `src/components/LiveInfer.tsx`
- [Lane Live View](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/Lane4Live.tsx): `src/components/Lane4Live.tsx`
- [Navigation](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`
- [MJPEG Feed](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/LaneMjpegFeed.tsx): `src/components/LaneMjpegFeed.tsx`
- [Lane Preview Poller](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/hooks/useLane4Preview.ts): `src/hooks/useLane4Preview.ts`
- [Stat Cards](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/components/StatCard.tsx): `src/components/StatCard.tsx`
- [Inference Client](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/services/inference.ts): `src/services/inference.ts`

### Inference API

- [FastAPI Routes](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/main.py): `backend/main.py`
- [Lane Stream Adapter](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/lane_stream.py): `backend/lane_stream.py`

### Detection Engines

- [Model Configuration](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/config.py): `backend/config.py`
- [Frame Detection](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/inference.py): `backend/inference.py`
- [Lane 4 Engine](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/vehicle_pipeline.py): `backend/vehicle_pipeline.py`
- [YOLO Weights](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/models/best.pt): `models/best.pt`
- [Plate Weights](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/models/number-plate-yolo26s.pt): `models/number-plate-yolo26s.pt`

### Passage Analytics

- [Live Passage Records](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/backend/main.py): `backend/main.py`
- [Summary Calculations](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/data/demoData.ts): `src/data/demoData.ts`
- [Display Formatting](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/utils/format.ts): `src/utils/format.ts`
- [Domain Types](https://github.com/shahzadhussain2005/gatewatch-cv-application-for-multi-lane-anrp/blob/main/src/types.ts): `src/types.ts`

### Other components

- **Operator**

## Connections

- Operator → Dashboard Shell: uses (evidence: `README.md`)
- Dashboard Shell → Navigation: renders (evidence: `src/App.tsx`)
- Dashboard Shell → Overview: renders (evidence: `src/App.tsx`)
- Dashboard Shell → Lane Detail: renders (evidence: `src/App.tsx`)
- Dashboard Shell → Passage Log: renders (evidence: `src/App.tsx`)
- Dashboard Shell → Inference Client: polls passages (evidence: `src/App.tsx`)
- Dashboard Shell → Summary Calculations: summarizes (evidence: `src/App.tsx`)
- Overview → Summary Calculations: calculates charts (evidence: `src/components/Overview.tsx`)
- Overview → Lane Preview Poller: requests preview (evidence: `src/components/Overview.tsx`)
- Overview → MJPEG Feed: renders feeds (evidence: `src/components/Overview.tsx`)
- Overview → Stat Cards: renders cards (evidence: `src/components/Overview.tsx`)
- Lane Detail → MJPEG Feed: renders feed (evidence: `src/components/LaneDetail.tsx`)
- Lane Detail → Stat Cards: renders cards (evidence: `src/components/LaneDetail.tsx`)
- Lane Detail → Display Formatting: formats values (evidence: `src/components/LaneDetail.tsx`)
- Passage Log → Display Formatting: formats values (evidence: `src/components/PassageLog.tsx`)
- Frame Inference → Inference Client: submits frames (evidence: `src/components/LiveInfer.tsx`)
- Lane Live View → Inference Client: fetches inference (evidence: `src/components/Lane4Live.tsx`)
- Lane Preview Poller → Inference Client: uses API base (evidence: `src/hooks/useLane4Preview.ts`)
- Inference Client → FastAPI Routes: calls endpoints (evidence: `src/services/inference.ts`)
- FastAPI Routes → Frame Detection: runs frame inference (evidence: `backend/main.py`)
- FastAPI Routes → Lane Stream Adapter: controls stream (evidence: `backend/main.py`)
- Lane Stream Adapter → Lane 4 Engine: delegates (evidence: `backend/lane_stream.py`)
- Frame Detection → Model Configuration: loads configured weights (evidence: `backend/config.py`)
- Lane 4 Engine → Model Configuration: uses lane settings (evidence: `backend/vehicle_pipeline.py`)
- Frame Detection → YOLO Weights: loads vehicle model
- Frame Detection → Plate Weights: loads plate model
- FastAPI Routes → Live Passage Records: serves live records (evidence: `README.md`)
- Dashboard Shell → Live Passage Records: polls live records (evidence: `src/App.tsx`)
- Summary Calculations → Domain Types: uses domain types (evidence: `src/data/demoData.ts`)
- Inference Client → Domain Types: returns typed data (evidence: `src/services/inference.ts`)
