# ganesh4060/enhanced-parking-system architecture

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

- Interactive diagram: https://gitdiagram.com/ganesh4060/enhanced-parking-system
- Repository: https://github.com/ganesh4060/enhanced-parking-system

## Overview

Enhanced Parking System combines a Flask parking dashboard and account flow with camera-based vehicle/spot detection, plate-text recognition, and live parking-state updates. The main runtime path captures video, detects occupancy, associates OCR text, updates in-memory spot state, and serves status and video to browser views. Registration also persists users in SQLite. The README is empty; the map follows the sampled runtime code and tree, and omits uncertain wiring such as the separate your_project prototype.

Main entry points: [`Enhanced-Parking-System/dp_21/app/routes.py`](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/routes.py) (Web routes), [`Enhanced-Parking-System/dp_21/run.py`](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/run.py) (Detection runner), [`Enhanced-Parking-System/dp_21/app/models.py`](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/models.py) (User model), [`Enhanced-Parking-System/dp_21/app/static/js/dashboard.js`](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/static/js/dashboard.js) (Dashboard UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_appfactory["Flask app factory<br/>[__init__.py]"]
  node_routes["Web routes<br/>[routes.py]"]
  node_dashboard["Dashboard UI<br/>[dashboard.js]"]
  node_parkingui["Parking display<br/>[parking.js]"]
  node_templates["Page templates"]
end

subgraph group_vision["Vision processing"]
  node_runner["Detection runner<br/>[run.py]"]
  node_stream["Video stream<br/>[video_stream.py]"]
  node_detector["Parking detector<br/>[model.py]"]
  node_plates["Plate OCR<br/>[plate_detector.py]"]
  node_modelweights["YOLO weights<br/>[best.pt]"]
end

subgraph group_state["Parking state"]
  node_state["Parking state<br/>[parking_state.py]"]
end

subgraph group_accounts["Accounts"]
  node_database[("SQLite database<br/>[parking.db]")]
  node_models["User model<br/>[models.py]"]
end

node_user(("Browser user"))
node_camera(("Video source"))

node_user -->|"requests pages"| node_routes
node_routes -->|"renders"| node_templates
node_routes -->|"reads and updates"| node_state
node_routes -->|"queries users"| node_models
node_models -->|"persists users"| node_database
node_appfactory -->|"initializes schema"| node_models
node_dashboard -->|"polls status"| node_routes
node_parkingui -->|"polls status"| node_routes
node_runner -->|"starts stream"| node_stream
node_camera -->|"supplies frames"| node_stream
node_runner -->|"detects vehicles"| node_detector
node_detector -->|"loads model"| node_modelweights
node_runner -->|"reads detected text"| node_plates
node_runner -->|"updates detections"| node_state
node_routes -->|"serves latest frame"| node_runner
node_user -->|"views status"| node_dashboard

click node_appfactory "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/__init__.py"
click node_routes "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/routes.py"
click node_dashboard "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/static/js/dashboard.js"
click node_parkingui "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/static/js/parking.js"
click node_templates "https://github.com/ganesh4060/enhanced-parking-system/tree/main/Enhanced-Parking-System/dp_21/app/templates"
click node_runner "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/run.py"
click node_stream "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/detection/video_stream.py"
click node_detector "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/detection/model.py"
click node_plates "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/detection/plate_detector.py"
click node_modelweights "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/smart_parking/weights/best.pt"
click node_state "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/parking_state.py"
click node_database "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/instance/parking.db"
click node_models "https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/models.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_appfactory,node_routes,node_dashboard,node_parkingui,node_templates,node_user toneBlue
class node_runner,node_stream,node_detector,node_plates,node_modelweights toneAmber
class node_state toneMint
class node_database,node_models toneRose
class node_camera toneIndigo
```

## Components

### Web interface

- [Flask app factory](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/__init__.py): `Enhanced-Parking-System/dp_21/app/__init__.py`
- [Web routes](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/routes.py): `Enhanced-Parking-System/dp_21/app/routes.py`
- [Dashboard UI](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/static/js/dashboard.js): `Enhanced-Parking-System/dp_21/app/static/js/dashboard.js`
- [Parking display](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/static/js/parking.js): `Enhanced-Parking-System/dp_21/app/static/js/parking.js`
- [Page templates](https://github.com/ganesh4060/enhanced-parking-system/tree/main/Enhanced-Parking-System/dp_21/app/templates): `Enhanced-Parking-System/dp_21/app/templates`

### Vision processing

- [Detection runner](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/run.py): `Enhanced-Parking-System/dp_21/run.py`
- [Video stream](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/detection/video_stream.py): `Enhanced-Parking-System/dp_21/detection/video_stream.py`
- [Parking detector](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/detection/model.py): `Enhanced-Parking-System/dp_21/detection/model.py`
- [Plate OCR](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/detection/plate_detector.py): `Enhanced-Parking-System/dp_21/detection/plate_detector.py`
- [YOLO weights](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/smart_parking/weights/best.pt): `Enhanced-Parking-System/dp_21/smart_parking/weights/best.pt`

### Parking state

- [Parking state](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/parking_state.py): `Enhanced-Parking-System/dp_21/app/parking_state.py`

### Accounts

- [SQLite database](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/instance/parking.db): `Enhanced-Parking-System/dp_21/instance/parking.db`
- [User model](https://github.com/ganesh4060/enhanced-parking-system/blob/main/Enhanced-Parking-System/dp_21/app/models.py): `Enhanced-Parking-System/dp_21/app/models.py`

### Other components

- **Browser user**
- **Video source**

## Connections

- Browser user → Web routes: requests pages
- Web routes → Page templates: renders
- Web routes → Parking state: reads and updates
- Web routes → User model: queries users
- User model → SQLite database: persists users
- Flask app factory → User model: initializes schema
- Dashboard UI → Web routes: polls status
- Parking display → Web routes: polls status
- Detection runner → Video stream: starts stream
- Video source → Video stream: supplies frames
- Detection runner → Parking detector: detects vehicles
- Parking detector → YOLO weights: loads model
- Detection runner → Plate OCR: reads detected text
- Detection runner → Parking state: updates detections
- Web routes → Detection runner: serves latest frame
- Browser user → Dashboard UI: views status
