ParkySpot: IoT-Based Smart Parking Dashboard
ParkySpot is an IoT-based smart parking management system that provides real-time parking spot availability using ESP32 sensors. The system features a web dashboard for monitoring parking areas, booking slots, and receiving live sensor updates via WebSocket.
Real-time Sensor Monitoring - ESP32 microcontrollers detect vehicle presence and push updates instantly
Interactive Map - Leaflet.js-powered map showing parking locations with live availability
Slot Booking System - Reserve parking spots with QR code confirmation
WebSocket Updates - Flask-SocketIO enables real-time dashboard updates
Admin Dashboard - Manage parking areas and spots through web interface
Component
Technology
Backend
Python, Flask, Flask-SQLAlchemy, Flask-SocketIO
Database
SQLite (dev) / PostgreSQL (production)
Frontend
HTML, Tailwind CSS, JavaScript, Leaflet.js
IoT Hardware
ESP32 with IR/Ultrasonic sensors
Real-time
Socket.IO for WebSocket communication
parky_spot/
├── app/
│ ├── __init__.py # Flask app initialization
│ ├── config.py # Configuration (env variables)
│ ├── models.py # SQLAlchemy database models
│ ├── routes.py # API endpoints and page routes
│ ├── sockets.py # WebSocket event handlers
│ ├── static/
│ │ └── Images/ # Static assets
│ └── templates/ # Jinja2 HTML templates
│ ├── home.html # Main dashboard
│ ├── login.html # User login
│ ├── signup.html # User registration
│ ├── slotbooking.html # Slot booking page
│ └── ...
├── espcode/
│ └── running.ino/ # ESP32 Arduino code
├── instance/ # SQLite database (auto-generated)
├── run.py # Application entry point
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
└── README.md
Python 3.8+
pip (Python package manager)
ESP32 development board (for IoT functionality)
git clone https://github.com/0xASR-dev/parky_spot.git
cd parky_spot
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\S cripts\a ctivate
# Linux/macOS:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Copy example environment file
cp .env.example .env
# Edit .env with your settings (optional for development)
The application will be available at http://localhost:5000
ESP32 development board
IR sensors or Ultrasonic sensors (one per parking spot)
WiFi network
ESP32 Pin
Sensor
GPIO 5
Sensor 1
GPIO 19
Sensor 2
GPIO 18
Sensor 3
GPIO 23
Sensor 4
Open espcode/running.ino/running.ino.ino in Arduino IDE
Update WiFi credentials:
const char * ssid = " YOUR_WIFI_SSID" ;
const char * password = " YOUR_WIFI_PASSWORD" ;
Update Flask server IP:
const char * serverURL = " http://YOUR_SERVER_IP:5000/update-sensor-data" ;
Upload to ESP32
ESP32 Sensors → HTTP POST → Flask /update-sensor-data → Database + SocketIO → Dashboard
Method
Endpoint
Description
GET
/
Main dashboard
GET
/login
Login page
POST
/login
Authenticate user
GET
/signup
Registration page
POST
/signup
Register user
GET
/api/parking-areas
Get all parking areas
GET
/api/parking-area/<id>
Get parking area details
GET
/api/parking-spots/<area_id>
Get spots for area
POST
/update-sensor-data
Receive sensor data (ESP32)
GET
/add-parking-area
Add parking area form
GET
/add-parking-spot
Add parking spot form
Production (Gunicorn + Eventlet)
gunicorn --worker-class eventlet -w 1 --bind 0.0.0.0:5000 run:app
Variable
Description
Default
SECRET_KEY
Flask secret key
Random
DATABASE_URL
Database connection string
sqlite:///parkyspot.db
FLASK_ENV
Environment mode
development
Fork the repository
Create a feature branch: git checkout -b feature/new-feature
Commit changes: git commit -m 'Add new feature'
Push to branch: git push origin feature/new-feature
Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.