Skip to content

rahul-chakradhari/ParkFlow-Microservices-based-Parking-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 

Repository files navigation

🚗 ParkFlow Microservices-Based Smart Parking Management System

Built a backend-focused Parking Lot Management System using microservices architecture, emphasizing real-world workflows, fault tolerance, and role-based access control.

✨ Why ParkFlow?

Modern parking systems demand:

Scalability
High availability
Clean domain separation
Graceful failure handling

ParkFlow solves these challenges by modeling parking as a distributed microservice ecosystem.

🧩 Problem Statement

Design and implement a parking system that can:

✅ Dynamically allocate parking slots
✅ Generate and manage parking tickets
✅ Calculate parking charges at exit
✅ Handle service failures without breaking user flow
✅ Secure admin and user operations

🏗️ Architecture Overview

ParkFlow follows a microservices architecture with single-responsibility services and fault-tolerant communication.

Each service is:

Independently deployable Loosely coupled Designed around real-world parking domains

Service Responsibility
User Service Vehicle entry & exit APIs
Parking Service Central orchestration & ticket generation
Slot Service Parking slot allocation & release
Pricing Service Parking fee calculation
Admin Service Admin-only privileged operations
Eureka Server Service discovery

📷 High-Level Architecture Diagram

architecture

⚙️ Tech Stack

☕ Java 17 🌱 Spring Boot 🔐 Spring Security ♻️ Resilience4j (Circuit Breaker) 🧭 Eureka Service Discovery 🌐 REST APIs 🧰 Maven 🧑‍💻 Git & GitHub

🧠 Key Design Decisions

✅ REST-based communication for clarity and simplicity
✅ No JWT / DB auth to avoid over-engineering
✅Circuit breakers only where user experience matters
✅Pricing calculated at exit to mimic real parking flow
✅Focus was on architecture clarity, not feature bloat.

♻️ Fault Tolerance & Resilience

To ensure smooth user experience even during failures:

Implemented Circuit Breaker pattern using Resilience4j

Added fallback responses for critical services

🔌 Slot Service Fallback

💰 Pricing Service Fallback

🔐 Security Implementation

Role-based authorization (USER / ADMIN) In-memory authentication for simplicity Separate security configurations for user and admin services

👤 User Authentication

🛡️ Admin Authorization

⚔️ Challenges & Solutions

Challenge Solution
Selecting a stable and industry-standard Java version for microservices development Used Java 17 (LTS) for long-term support, better performance, and compatibility with Spring Boot
Inter-service communication between multiple microservices Implemented Eureka Discovery Server for dynamic service registration and discovery
Calling other microservices from one service Used Spring RestTemplate for synchronous REST-based inter-service communication
Avoiding hardcoded service URLs Resolved service endpoints dynamically using Eureka service names
Handling service failures without cascading impact Implemented Circuit Breaker pattern using Resilience4j
Providing fault tolerance during downstream failures Added fallback mechanisms for graceful degradation
Securing APIs across microservices Applied Spring Security with role-based authorization (ADMIN, USER)
Reducing repetitive boilerplate code Used Project Lombok to auto-generate getters, setters, and constructors
API visibility and documentation Integrated Swagger / OpenAPI for API documentation and testing
Ensuring scalability and loose coupling Followed Microservices Architecture best practices
Manual API testing during development Used Postman for request validation and debugging

📘 API Documentation (Swagger) 📑
🔹 All services expose Swagger UI for easy API exploration and testing
🔹 Swagger is enabled using Springdoc OpenAPI
🔹 Each microservice provides interactive API documentation at:
👉 http://localhost:/swagger-ui.html 🌐

✨ This allows:
✅ Easy API testing without Postman 🧪
✅ Clear request/response contracts 📄
✅ Faster onboarding for developers 🚀

🧰 Lombok Usage 🛠️
🔹 Integrated Lombok to reduce boilerplate code ✂️
🔹 Simplified DTOs and models using annotations 📦
🔹 Eliminated repetitive getters, setters, constructors, and builders 🔁
🔹 Improved code readability and maintainability 📈
🔹 No impact on runtime performance ⚡

📸 Screenshots
🧠 Complete Architecture Diagram

full diagram

🧭 Eureka Dashboard

eureka dashboard

📬 API Responses (Postman)
🚗 User Entry

🚪 User Exit

⭐ Special Entry through Admin

🔥 Circuit Breaker in Action

🚀 Future Enhancements
🔑 JWT-based authentication
🗄️ Database persistence (MySQL)
🚪 API Gateway
🧰 Implement Global Exception Handler
⚙️ Centralized configuration server
📊 Admin dashboard UI

▶️ How to Run Locally

1.Start Eureka Server
2.Start all microservices
3.Test APIs using Postman

👨‍💻 Author

Rahul Chakradhari
Java Backend Developer | Microservices | Spring Boot

📍 Location: Bengaluru , Karnataka
📞 Phone: +91 83058 25263
📧 Email: rahulchakradhari10september@gmail.com
🔗 LinkedIn: https://www.linkedin.com/in/rahulchakradhari

⭐ If you found this project useful
Feel free to ⭐ star the repository or reach out for collaboration, feedback, or opportunities.

About

A microservices-based Parking Management System that automates slot allocation, ticketing, and payments — reducing human effort and congestion.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages