# sumukh73/ai-smart-parking-system architecture

> Architecture diagram of the GitHub repository sumukh73/ai-smart-parking-system, 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/sumukh73/ai-smart-parking-system
- Repository: https://github.com/sumukh73/ai-smart-parking-system

## Overview

This is a Flask-based smart-parking demo with a separate video-detection process. The main implemented workflow reads video, detects and counts vehicle classes with YOLO, and stores aggregate occupancy in MySQL; the Flask app reads the latest records for an admin dashboard and live-data API. Parking-location data and detailed detection history are simulated. The README describes recommendations, but the available source does not show an allocation or recommendation engine; frontend templates are also absent from the tree.

Main entry points: [`app.py`](https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py) (Flask routes), [`detect.py`](https://github.com/sumukh73/ai-smart-parking-system/blob/main/detect.py) (Detection process), [`video.mp4`](https://github.com/sumukh73/ai-smart-parking-system/blob/main/video.mp4) (Video input), [`yolov8n.pt`](https://github.com/sumukh73/ai-smart-parking-system/blob/main/yolov8n.pt) (YOLO weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Detection"]
  node_video["Video input<br/>[video.mp4]"]
  node_detector["Detection process<br/>[detect.py]"]
  node_yolo["YOLO weights<br/>[yolov8n.pt]"]
end

subgraph group_web["Web application"]
  node_flask["Flask routes<br/>[app.py]"]
  node_dashboard["Dashboard view<br/>[app.py]"]
  node_live["Live data API<br/>[app.py]"]
  node_history["History API<br/>[app.py]"]
  node_locations["Locations API<br/>[app.py]"]
end

subgraph group_state["Parking data"]
  node_mysql[("MySQL parking_data")]
end

node_operator(("Operator / user"))

node_operator -->|"submits login"| node_flask
node_flask -->|"renders"| node_dashboard
node_flask -->|"dispatches"| node_live
node_flask -->|"dispatches"| node_history
node_flask -->|"dispatches"| node_locations
node_video -->|"supplies frames"| node_detector
node_detector -->|"runs inference"| node_yolo
node_detector -->|"writes counts"| node_mysql
node_dashboard -->|"reads latest"| node_mysql
node_live -->|"reads latest"| node_mysql
node_history -->|"reads records"| node_mysql
node_dashboard -->|"shows occupancy"| node_operator
node_live -->|"returns counts"| node_operator
node_history -->|"returns simulated history"| node_operator
node_locations -->|"returns demo locations"| node_operator

click node_video "https://github.com/sumukh73/ai-smart-parking-system/blob/main/video.mp4"
click node_detector "https://github.com/sumukh73/ai-smart-parking-system/blob/main/detect.py"
click node_yolo "https://github.com/sumukh73/ai-smart-parking-system/blob/main/yolov8n.pt"
click node_flask "https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py"
click node_dashboard "https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py"
click node_live "https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py"
click node_history "https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py"
click node_locations "https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.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_video,node_detector,node_yolo,node_operator toneBlue
class node_flask,node_dashboard,node_live,node_history,node_locations toneAmber
class node_mysql toneMint
```

## Components

### Detection

- [Video input](https://github.com/sumukh73/ai-smart-parking-system/blob/main/video.mp4): `video.mp4`
- [Detection process](https://github.com/sumukh73/ai-smart-parking-system/blob/main/detect.py): `detect.py`
- [YOLO weights](https://github.com/sumukh73/ai-smart-parking-system/blob/main/yolov8n.pt): `yolov8n.pt`

### Web application

- [Flask routes](https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py): `app.py`
- [Dashboard view](https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py): `app.py`
- [Live data API](https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py): `app.py`
- [History API](https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py): `app.py`
- [Locations API](https://github.com/sumukh73/ai-smart-parking-system/blob/main/app.py): `app.py`

### Parking data

- **MySQL parking_data**

### Other components

- **Operator / user**

## Connections

- Operator / user → Flask routes: submits login
- Flask routes → Dashboard view: renders
- Flask routes → Live data API: dispatches
- Flask routes → History API: dispatches
- Flask routes → Locations API: dispatches
- Video input → Detection process: supplies frames
- Detection process → YOLO weights: runs inference
- Detection process → MySQL parking_data: writes counts
- Dashboard view → MySQL parking_data: reads latest
- Live data API → MySQL parking_data: reads latest
- History API → MySQL parking_data: reads records
- Dashboard view → Operator / user: shows occupancy
- Live data API → Operator / user: returns counts
- History API → Operator / user: returns simulated history
- Locations API → Operator / user: returns demo locations
