# kanvishah1619/smart-parking-system architecture

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

- Interactive diagram: https://gitdiagram.com/kanvishah1619/smart-parking-system
- Repository: https://github.com/kanvishah1619/smart-parking-system

## Overview

This is an ESP32 smart-parking system. Its main workflow detects vehicles in three slots, assigns a six-digit code and records entry time, then accepts that code at exit, calculates the fee, and releases the slot after departure is sensed. Browser dashboards expose availability, billing, and watchman controls; the firmware also drives the gate from web commands or a physical button. The README documents these connections, but no source excerpts were available, so implementation details and internal wiring beyond those documented are not asserted.

Main entry points: [`Code/Code.ino`](https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino) (HTTP web server), [`Dashboard`](https://github.com/kanvishah1619/smart-parking-system/tree/main/Dashboard) (User dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["ESP32 Firmware"]
  node_firmware["ESP32 controller<br/>[Code.ino]"]
  node_webserver["HTTP web server<br/>[Code.ino]"]
  node_occupancy["Slot monitoring<br/>[Code.ino]"]
  node_session["Parking session<br/>[Code.ino]"]
  node_code["Parking code<br/>[Code.ino]"]
  node_billing["Fee calculation<br/>[Code.ino]"]
end

subgraph group_web["Web Dashboards"]
  node_userdash["User dashboard"]
  node_watchman["Watchman dashboard"]
end

subgraph group_hardware["Parking Hardware"]
  node_sensors["Ultrasonic sensors"]
  node_servo["Gate servo"]
  node_button["Manual push button"]
end

node_browser(("User or watchman"))

node_browser -->|"HTTP requests"| node_webserver
node_webserver -->|"serves page"| node_userdash
node_webserver -->|"serves page"| node_watchman
node_webserver -->|"reads availability"| node_occupancy
node_webserver -->|"accepts exit code"| node_code
node_webserver -->|"requests fee"| node_billing
node_webserver -->|"controls gate"| node_servo
node_occupancy -->|"measures slots"| node_sensors
node_occupancy -->|"detects entry"| node_session
node_session -->|"assigns code"| node_code
node_session -->|"provides duration"| node_billing
node_session -->|"releases slot"| node_occupancy
node_occupancy -->|"opens gate"| node_servo
node_button -->|"manual control"| node_firmware
node_firmware -->|"drives gate"| node_servo

click node_firmware "https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino"
click node_webserver "https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino"
click node_occupancy "https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino"
click node_session "https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino"
click node_code "https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino"
click node_billing "https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino"
click node_userdash "https://github.com/kanvishah1619/smart-parking-system/tree/main/Dashboard"
click node_watchman "https://github.com/kanvishah1619/smart-parking-system/tree/main/Dashboard"

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_firmware,node_webserver,node_occupancy,node_session,node_code,node_billing,node_browser toneBlue
class node_userdash,node_watchman toneAmber
class node_sensors,node_servo,node_button toneMint
```

## Components

### ESP32 Firmware

- [ESP32 controller](https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino): `Code/Code.ino`
- [HTTP web server](https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino): `Code/Code.ino`
- [Slot monitoring](https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino): `Code/Code.ino`
- [Parking session](https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino): `Code/Code.ino`
- [Parking code](https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino): `Code/Code.ino`
- [Fee calculation](https://github.com/kanvishah1619/smart-parking-system/blob/main/Code/Code.ino): `Code/Code.ino`

### Web Dashboards

- [User dashboard](https://github.com/kanvishah1619/smart-parking-system/tree/main/Dashboard): `Dashboard`
- [Watchman dashboard](https://github.com/kanvishah1619/smart-parking-system/tree/main/Dashboard): `Dashboard`

### Parking Hardware

- **Ultrasonic sensors**
- **Gate servo**
- **Manual push button**

### Other components

- **User or watchman**

## Connections

- User or watchman → HTTP web server: HTTP requests
- HTTP web server → User dashboard: serves page
- HTTP web server → Watchman dashboard: serves page
- HTTP web server → Slot monitoring: reads availability
- HTTP web server → Parking code: accepts exit code
- HTTP web server → Fee calculation: requests fee
- HTTP web server → Gate servo: controls gate
- Slot monitoring → Ultrasonic sensors: measures slots
- Slot monitoring → Parking session: detects entry
- Parking session → Parking code: assigns code
- Parking session → Fee calculation: provides duration
- Parking session → Slot monitoring: releases slot
- Slot monitoring → Gate servo: opens gate
- Manual push button → ESP32 controller: manual control
- ESP32 controller → Gate servo: drives gate
