Skip to content

VivekJariwala50/SpotOn-Smart-Parking-Management-System

Repository files navigation

SpotOn Logo

SpotOn Smart Parking Management System

Find, reserve, and manage your perfect parking spot instantly.

Python Flask PostgreSQL Docker License: MIT


πŸ“– Overview

SpotOn is a comprehensive, full-stack Smart Parking Management System designed to eliminate the stress of urban parking. It connects drivers with real-time parking availability, allowing them to search, filter (e.g., for EV charging or accessible spots), and secure their space before arriving.

Simultaneously, SpotOn provides parking facility operators with a powerful suite of tools to manage inventory, adjust dynamic pricing, and monitor utilization in real time. Built for enterprise reliability, the platform features role-based access control, secure transaction handling, and robust data integrity checks.


✨ Key Features

For Drivers πŸš—

  • Real-Time Availability & Search: Instantly find spots across multiple lots and garages with dynamic, real-time status updates.
  • Advanced Filtering: Filter search results specifically for EV chargers, accessible bays, or vehicle size (Compact, Sedan, SUV, Truck).
  • Advance Reservations: Securely book your parking space ahead of time to save fuel and skip the endless circling.
  • Smart Dashboard: Manage active bookings, extend sessions, view transaction history, and download digital receipts.
  • Favorites & Vehicles: Save your frequently visited lots and manage multiple registered vehicles under one profile.

For Operators 🏒

  • Live Inventory Management: Toggle spot availability, mark spots as out of service for maintenance, and track live occupancy.
  • Dynamic Pricing Overrides: Set base rates for lots and configure specific pricing overrides based on slot type (e.g., premium pricing for EV slots) or vehicle size.
  • Analytics & Utilization: Gain insights into booking trends, peak hours, and revenue generation.

For Administrators πŸ›‘οΈ

  • System Oversight: Comprehensive dashboard to monitor platform health, active users, total revenue, and overarching system metrics.
  • Support Ticketing: Integrated customer support ticketing system to handle user queries and issues directly within the platform.

πŸ“Έ Screenshots

Homepage & Search Experience

Homepage Search Lots
Modern, responsive homepage with quick location search Detailed search interface with filters for vehicle and slot types

Dashboards

Driver Dashboard Operator Dashboard
Driver portal for managing active and past reservations Operator inventory control and dynamic pricing tools

πŸ› οΈ Technology Stack

  • Backend Framework: Flask (Python 3.11)
  • Database: PostgreSQL with psycopg2 and btree_gist for advanced exclusion constraints (preventing double bookings)
  • Frontend: Vanilla HTML5, CSS3 (Custom Design System), JavaScript
  • Authentication: werkzeug.security (PBKDF2-HMAC-SHA256) and secure Flask sessions
  • Containerization: Docker & Docker Compose
  • CI/CD: GitHub Actions & Jenkins

πŸš€ Getting Started (Local Development)

Prerequisites

  • Python 3.11+
  • PostgreSQL 15+ (or Docker)
  • Git

1. Clone the Repository

git clone https://github.com/VivekJariwala50/SpotOn-Smart-Parking-Management-System.git
cd SpotOn-Smart-Parking-Management-System

2. Set Up Virtual Environment & Dependencies

python -m venv .venv
source .venv/bin/activate  # On Windows use: .venv\Scripts\activate
pip install -r requirements.txt

3. Environment Variables

Copy the provided example environment file and update it with your database credentials and a strong secret key.

cp .env.example .env

Ensure you set a strong SECRET_KEY and define your DATABASE_URL (or the individual DB_HOST, DB_NAME, DB_USER, DB_PASSWORD variables).

4. Database Setup

Ensure your local PostgreSQL server is running. Create the database and run the provided schema and seed data dump:

# Create the database (if using individual env vars)
createdb -U postgres smart_parking

# Import schema and seed data
psql -U postgres -d smart_parking -f supabase_dump.sql

(Note: The database requires the btree_gist and uuid-ossp extensions, which the dump file will attempt to enable.)

5. Run the Application

Start the Flask development server:

python app.py

The application will be available at http://localhost:5055.


🐳 Running with Docker

SpotOn is fully containerized and production-ready.

Build and Run locally

# Build the image
docker build -t spoton-app:latest .

# Run the container (ensure your DB is accessible from the container network)
docker run -d -p 8000:8000 \
  -e DATABASE_URL=postgresql://user:pass@host:5432/db_name \
  -e SECRET_KEY=your_secure_key \
  --name spoton-web \
  spoton-app:latest

The Docker image uses gunicorn with multiple workers and includes a built-in health check endpoint (/health).


πŸ“Š Architecture & Database Diagrams

System Context Diagram

flowchart TD
    Driver([Driver]) -->|Searches & Books| WebApp
    Operator([Operator]) -->|Manages Inventory| WebApp
    Admin([Admin]) -->|Monitors System| WebApp
    
    subgraph SpotOn Platform
        WebApp[Flask Web Application]
        Auth[Werkzeug Security / RBAC]
        Booking[Reservation Engine]
        Billing[Mock Billing Module]
        
        WebApp --> Auth
        WebApp --> Booking
        WebApp --> Billing
    end
    
    Booking --> DB[(PostgreSQL Database)]
    Auth --> DB
    Billing --> DB
    
    subgraph Infrastructure
        Docker[Docker & Gunicorn]
        Docker --> WebApp
    end
Loading

Entity-Relationship (ER) Diagram

erDiagram
    USERS ||--o{ PROFILES : has
    USERS ||--o{ VEHICLES : owns
    USERS ||--o{ RESERVATIONS : makes
    USERS ||--o{ FAVORITE_LOCATIONS : saves
    USERS ||--o{ TRANSACTIONS : performs
    
    PARKING_LOTS ||--o{ PARKING_SLOTS : contains
    PARKING_LOTS ||--o{ PRICING_OVERRIDES : has
    PARKING_LOTS ||--o{ FAVORITE_LOCATIONS : is_favorited_by
    
    PARKING_SLOTS ||--o{ RESERVATIONS : booked_for
    RESERVATIONS ||--o| TRANSACTIONS : paid_via
    
    USERS {
        uuid id PK
        string email
        string role
        string full_name
        boolean is_active
    }
    
    PARKING_LOTS {
        uuid id PK
        string name
        string address
        numeric price_per_hour
        string parking_type
    }
    
    PARKING_SLOTS {
        uuid id PK
        uuid lot_id FK
        string label
        string slot_type
        string status
        boolean is_active
    }
    
    RESERVATIONS {
        uuid id PK
        uuid user_id FK
        uuid slot_id FK
        datetime start_time
        datetime end_time
        string status
    }
Loading

πŸ§ͺ Testing

The project includes a suite of smoke tests built with pytest to verify core application functionality and routing integrity.

To run the tests:

pytest tests/ -v

πŸ›‘οΈ Security

We take security seriously. SpotOn implements several best practices including:

  • Parameterized queries to prevent SQL Injection
  • Password hashing using werkzeug.security
  • Strict Role-Based Access Control (RBAC) via custom @login_required decorators
  • Protection against Open Redirect vulnerabilities

Please read our Security Policy for details on reporting vulnerabilities.

Note on Demo Credentials: The system includes a simulated checkout for demonstration purposes. Use the demo card 8111 1111 1111 1111 and CVV 007. Never use real payment information in the demo environment.


🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details on our branch strategy, commit message standards, and the pull request process.


πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❀️ by the SpotOn Team

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors