# amanev2005/smartparkingsystem architecture

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

- Interactive diagram: https://gitdiagram.com/amanev2005/smartparkingsystem
- Repository: https://github.com/amanev2005/smartparkingsystem

## Overview

Smart Parking System combines camera-based Indian license-plate recognition with parking-slot allocation, vehicle entry/exit tracking, charge calculation, and a Flask web interface. A camera-capture process recognizes plates and sends detections to the backend; the backend manages parking transactions and slot state in SQLite, while users can also submit plates through the web UI. The UI includes transaction details and locally generated PIN-based payment slips. The README describes charging, but the supplied excerpts do not show the full payment implementation or establish how the QR helper is used.

Main entry points: [`templates/index.html`](https://github.com/amanev2005/smartparkingsystem/blob/main/templates/index.html) (Web interface), [`camera_capture.py`](https://github.com/amanev2005/smartparkingsystem/blob/main/camera_capture.py) (Camera capture), [`static/js/main.js`](https://github.com/amanev2005/smartparkingsystem/blob/main/static/js/main.js) (Forms & dashboard), [`slot.py`](https://github.com/amanev2005/smartparkingsystem/blob/main/slot.py) (Parking API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Plate Capture"]
  node_camera["Camera capture<br/>[camera_capture.py]"]
  node_recognition["Plate recognition"]
end

subgraph group_parking["Parking Backend"]
  node_web_api["Parking API<br/>[slot.py]"]
  node_parking_rules["Slot &amp; transaction handling<br/>[slot.py]"]
end

subgraph group_persistence["Parking State"]
  node_orm["Database models<br/>[models.py]"]
  node_sqlite[("Parking database<br/>[parking.db]")]
end

subgraph group_interface["User Interface"]
  node_browser["Web interface<br/>[index.html]"]
  node_frontend["Forms &amp; dashboard<br/>[main.js]"]
  node_entry_page["Entry page<br/>[entry.html]"]
  node_exit_page["Exit page<br/>[exit.html]"]
  node_payment_slip["Payment slip &amp; PIN<br/>[main.js]"]
  node_qr_helper["QR payment helper<br/>[qr_payment.py]"]
end

node_operator(("Driver / operator"))

node_operator -.->|"provides vehicle view"| node_camera
node_camera -->|"recognizes frames"| node_recognition
node_camera -->|"posts detections"| node_web_api
node_web_api -->|"handles parking requests"| node_parking_rules
node_parking_rules -->|"queries and updates"| node_orm
node_orm -->|"persists state"| node_sqlite
node_operator -.->|"uses"| node_browser
node_browser -.->|"loads"| node_frontend
node_frontend -->|"submits entry and exit"| node_web_api
node_browser -.->|"presents entry"| node_entry_page
node_browser -.->|"presents exit"| node_exit_page
node_frontend -->|"generates slip and PIN"| node_payment_slip

click node_camera "https://github.com/amanev2005/smartparkingsystem/blob/main/camera_capture.py"
click node_recognition "https://github.com/amanev2005/smartparkingsystem/blob/main/anpr_yolo_easyocr.py"
click node_web_api "https://github.com/amanev2005/smartparkingsystem/blob/main/slot.py"
click node_parking_rules "https://github.com/amanev2005/smartparkingsystem/blob/main/slot.py"
click node_orm "https://github.com/amanev2005/smartparkingsystem/blob/main/models.py"
click node_sqlite "https://github.com/amanev2005/smartparkingsystem/blob/main/parking.db"
click node_browser "https://github.com/amanev2005/smartparkingsystem/blob/main/templates/index.html"
click node_frontend "https://github.com/amanev2005/smartparkingsystem/blob/main/static/js/main.js"
click node_entry_page "https://github.com/amanev2005/smartparkingsystem/blob/main/templates/entry.html"
click node_exit_page "https://github.com/amanev2005/smartparkingsystem/blob/main/templates/exit.html"
click node_payment_slip "https://github.com/amanev2005/smartparkingsystem/blob/main/static/js/main.js"
click node_qr_helper "https://github.com/amanev2005/smartparkingsystem/blob/main/static/qr/qr_payment.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_camera,node_recognition toneBlue
class node_web_api,node_parking_rules toneAmber
class node_orm,node_sqlite toneMint
class node_browser,node_frontend,node_entry_page,node_exit_page,node_payment_slip,node_qr_helper toneRose
class node_operator toneIndigo
```

## Components

### Plate Capture

- [Camera capture](https://github.com/amanev2005/smartparkingsystem/blob/main/camera_capture.py): `camera_capture.py`
- [Plate recognition](https://github.com/amanev2005/smartparkingsystem/blob/main/anpr_yolo_easyocr.py): `anpr_yolo_easyocr.py`

### Parking Backend

- [Parking API](https://github.com/amanev2005/smartparkingsystem/blob/main/slot.py): `slot.py`
- [Slot & transaction handling](https://github.com/amanev2005/smartparkingsystem/blob/main/slot.py): `slot.py`

### Parking State

- [Database models](https://github.com/amanev2005/smartparkingsystem/blob/main/models.py): `models.py`
- [Parking database](https://github.com/amanev2005/smartparkingsystem/blob/main/parking.db): `parking.db`

### User Interface

- [Web interface](https://github.com/amanev2005/smartparkingsystem/blob/main/templates/index.html): `templates/index.html`
- [Forms & dashboard](https://github.com/amanev2005/smartparkingsystem/blob/main/static/js/main.js): `static/js/main.js`
- [Entry page](https://github.com/amanev2005/smartparkingsystem/blob/main/templates/entry.html): `templates/entry.html`
- [Exit page](https://github.com/amanev2005/smartparkingsystem/blob/main/templates/exit.html): `templates/exit.html`
- [Payment slip & PIN](https://github.com/amanev2005/smartparkingsystem/blob/main/static/js/main.js): `static/js/main.js`
- [QR payment helper](https://github.com/amanev2005/smartparkingsystem/blob/main/static/qr/qr_payment.py): `static/qr/qr_payment.py`

### Other components

- **Driver / operator**

## Connections

- Driver / operator → Camera capture: provides vehicle view
- Camera capture → Plate recognition: recognizes frames (evidence: `camera_capture.py`)
- Camera capture → Parking API: posts detections (evidence: `camera_capture.py`)
- Parking API → Slot & transaction handling: handles parking requests (evidence: `slot.py`)
- Slot & transaction handling → Database models: queries and updates (evidence: `slot.py`)
- Database models → Parking database: persists state (evidence: `models.py`)
- Driver / operator → Web interface: uses
- Web interface → Forms & dashboard: loads
- Forms & dashboard → Parking API: submits entry and exit (evidence: `static/js/main.js`)
- Web interface → Entry page: presents entry
- Web interface → Exit page: presents exit
- Forms & dashboard → Payment slip & PIN: generates slip and PIN (evidence: `static/js/main.js`)
