Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Parking Management System (SPMS)

SPMS is a role-based smart parking management system built with a Spring Boot backend and a JavaFX desktop frontend. It helps parking operators manage vehicle entry and exit, track live occupancy, generate receipts, monitor revenue, and administer parking lots, tariffs, and staff accounts.

Highlights

  • Role-based dashboards for Administrator, Supervisor, and Guard users
  • Spring Boot REST API with JavaFX desktop frontend
  • Parking entry, exit, receipts, unpaid dues, occupancy, and revenue workflows
  • MySQL persistence with Flyway database migrations
  • Backend unit tests, frontend Selenium tests, and Postman/Newman API coverage

The project is organized as a full-stack desktop application:

  • backend/ exposes REST APIs, business rules, persistence, reporting, and database migrations
  • spms-javafx/ provides the JavaFX desktop client for Admin, Guard, and Supervisor users
  • postman/ contains the Newman/Postman API collection used for automated API verification

Screenshots

Login

SPMS login screen

Guard Dashboard

SPMS guard dashboard

Supervisor Dashboard

SPMS supervisor dashboard

Administrator Dashboard

SPMS administrator dashboard

Documentation Set

The project now includes the documentation artifacts typically expected in a software-engineering submission:

Project Documentation

Analysis and Design Diagrams

User Documentation

Project Goals

This system is designed to solve common parking-management problems:

  • manual entry and exit handling
  • inconsistent parking-slot tracking
  • difficulty monitoring lot occupancy across locations
  • unpaid dues and weak receipt traceability
  • lack of role-based operational dashboards

SPMS centralizes these workflows and makes them available through separate role-based interfaces.

Core Features

Guard Features

  • Register vehicle entry with:
    • vehicle number
    • mobile number
    • vehicle type
    • selected parking lot
  • Generate entry tokens automatically
  • Process vehicle exit and generate receipts
  • Mark exits as paid or unpaid
  • Cancel active sessions when needed
  • View current lot status and active occupancy
  • Check vehicle summary and unpaid-dues history
  • Suggest nearest available alternative lots when a lot is full

Supervisor Features

  • View active sessions and occupancy for the assigned lot
  • Monitor available vs occupied slots
  • View revenue summaries for the assigned lot
  • Track unpaid dues
  • Search complete vehicle history by vehicle number
  • Export receipt data to CSV

Administrator Features

  • Update parking tariffs by vehicle type
  • Create, modify, and delete guard/supervisor accounts
  • Create, edit, and delete parking lots
  • View global reports across all lots
  • Persist monthly report summaries

User Roles

SPMS supports three operational roles:

  • ADMINISTRATOR
    • manages lots, tariffs, reports, and staff accounts
  • SUPERVISOR
    • monitors a specific assigned lot and reviews reports/history
  • GUARD
    • handles entry, exit, cancellation, and lot-floor operations

The JavaFX app routes users to the correct dashboard immediately after login based on the authenticated role.

Tech Stack

Backend

  • Java 17
  • Spring Boot 3.5
  • Spring Web
  • Spring Data JPA
  • Flyway
  • MySQL
  • H2 (test scope)
  • Lombok

Frontend

  • JavaFX 21
  • FXML
  • Jackson

Testing

  • JUnit 5
  • Mockito
  • Selenium WebDriver
  • Newman / Postman

Project Structure

SWE/
├── backend/          # Spring Boot REST API, services, entities, repositories, migrations
├── spms-javafx/      # JavaFX desktop client (Admin / Guard / Supervisor dashboards)
├── postman/          # Postman collection for API verification
└── README.md

Architecture Overview

Backend Layering

  • controller
    • exposes REST endpoints under /api/...
  • service
    • contains business logic for parking, users, tariffs, reports, and slot handling
  • repository
    • JPA repositories for persistence
  • model
    • entities such as ParkingLot, Token, ParkingSession, Receipt, User
  • config
    • application configuration and seed data
  • db/migration
    • Flyway SQL migrations

Frontend Layering

  • controller
    • JavaFX controllers for Login, Guard, Supervisor, and Admin dashboards
  • service
    • client-side API wrappers for backend communication
  • model
    • frontend session state
  • view
    • FXML screens
  • styles
    • shared stylesheet

Main Domain Objects

  • ParkingLot
    • lot name, location, capacity, available slots, coordinates
  • Vehicle
    • vehicle number, mobile number, vehicle type
  • Token
    • created when a vehicle enters a lot
  • ParkingSession
    • tracks active/completed/cancelled parking lifecycle
  • Receipt
    • generated on exit or cancellation
  • Tariff
    • rate-per-minute by vehicle type
  • User
    • inherited by Administrator, Guard, and Supervisor

Database and Persistence

The backend uses MySQL by default and Flyway for schema/version management.

Main migration files are in:

The application reads database configuration from environment variables:

export DB_URL=jdbc:mysql://localhost:3306/spms_db
export DB_USERNAME=root
export DB_PASSWORD='your_password'
export DB_DRIVER=com.mysql.cj.jdbc.Driver

Default backend config lives in application.properties.

Seeded Credentials

When seeding is enabled, the backend creates these default users:

  • Admin: admin / changeme
  • Supervisor Lot 1: sup_lot1 / sup1pass
  • Guard Lot 1: guard_lot1 / guard1pass

Additional supervisors and guards are created for the other lots using the same pattern:

  • Supervisor Lot N: sup_lotN / supNpass
  • Guard Lot N: guard_lotN / guardNpass

Seed logic is defined in DataInitializer.java.

How To Run

1. Start the backend

From backend:

mvn spring-boot:run

The backend starts on:

http://localhost:8080

2. Start the JavaFX frontend

From spms-javafx:

mvn javafx:run

This opens the desktop login screen. After authentication, the user is routed to the correct dashboard by role.

Important Workflows

Vehicle Entry Flow

  1. Guard enters vehicle number, mobile number, vehicle type, and lot
  2. Backend validates the vehicle and mobile number
  3. System checks for duplicate active sessions
  4. Token is generated
  5. Parking session is created
  6. Lot slot counts are synchronized automatically

Vehicle Exit Flow

  1. Guard enters the vehicle number
  2. Backend finds the active session
  3. Current fee and previous unpaid dues are calculated
  4. Receipt is generated
  5. Session is marked completed
  6. Available-slot count is synchronized

Admin User Management Flow

  1. Admin can create guard and supervisor users
  2. Admin can modify existing user details
  3. Admin can delete managed users
  4. User-role dashboards remain assignment-aware through lot mapping

Reporting

The reporting module supports:

  • revenue report
  • active session report
  • recent receipts
  • vehicle history lookup
  • vehicle summary/lookup
  • monthly report persistence

Reports can be scoped globally or by parking lot, depending on role and endpoint.

Validation and Business Rules

The system includes several operational safeguards:

  • vehicle number normalization, including BH-series support
  • Indian mobile number normalization
  • duplicate active-session prevention
  • assigned-lot enforcement for guards and supervisors
  • parking-lot-full handling with alternative-lot suggestions
  • unpaid-dues tracking across visits
  • slot-count synchronization based on active sessions

Testing

This project includes backend tests, frontend Selenium tests, and a Postman/Newman API test collection.

Backend tests

From backend:

./mvnw test

Frontend Selenium tests

Prerequisites:

  • backend running on http://localhost:8080
  • Chrome installed
  • ChromeDriver available on PATH

From spms-javafx:

mvn -Dspms.test.url=http://localhost:8080 test

API tests with Newman

Install Newman once:

npm install -g newman

Run from repo root:

newman run postman/SPMS_API_Collection.json

Verified Test Status

  • Backend test suite: 74/74 passing
  • Frontend Selenium suite: 28/28 passing
  • Postman collection: 105 assertions, 0 failed

Recommended Execution Order

For local verification:

  1. Start MySQL
  2. Start the backend
  3. Start the JavaFX client
  4. Run backend tests
  5. Run Newman collection
  6. Run Selenium tests

Notes

  • The backend defaults to MySQL and Flyway-managed schema validation.
  • Selenium may print Chrome CDP version warnings; these were non-blocking in successful test runs.
  • The slot-management logic was hardened so lot availability is synchronized from active sessions rather than relying only on blind increment/decrement updates.

Future Improvements

Possible next enhancements for the project:

  • JWT/session security hardening
  • audit trail for admin actions
  • richer analytics dashboards
  • PDF receipt export
  • notification support for unpaid dues
  • containerized local setup with Docker

Contributors / Submission Note

If you are using this repository for academic submission, this README can serve as the main project overview. You can additionally attach:

  • screenshots of the three dashboards
  • ER diagram / class diagram
  • API endpoint summary
  • testing evidence screenshots

About

A role-based Smart Parking Management System with a Spring Boot REST backend, JavaFX desktop frontend, MySQL persistence, and Admin, Supervisor, and Guard workflows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages