Skip to content

KRYSTALM7/parking-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— Parking Management System – Microservices Architecture

A full-stack Parking Management System built using Angular, Spring Boot Microservices, Eureka Service Discovery, and Spring Cloud API Gateway.
The system is deployed on Vercel (Frontend) and Render (Backend).


πŸ“Œ Features

πŸ‘€ User

  • User registration & login
  • View available parking locations and slots
  • Create parking bookings
  • View booking history
  • Manage profile

πŸ› οΈ Admin

  • Admin login
  • Dashboard with system overview
  • Manage parking locations
  • Manage parking slots
  • View all bookings

βš™οΈ System

  • API Gateway based routing
  • Service discovery with Eureka
  • Centralized authentication via gateway
  • Health monitoring for all services

πŸ—οΈ Architecture Overview

Angular Frontend (Vercel)
          |
          v
Spring Cloud API Gateway (Render)
          |
          v
+-----------------------------+
|        Eureka Server        |
+-----------------------------+
       |        |        |
       v        v        v
    User     Admin    Booking   Location
  Service  Service   Service   Service

🧰 Tech Stack

Frontend

  • Angular 17+
  • TypeScript
  • RxJS
  • Angular Router
  • Deployed on Vercel

Backend

  • Java 17
  • Spring Boot
  • Spring Cloud Netflix Eureka
  • Spring Cloud Gateway
  • Spring Data JPA
  • PostgreSQL
  • Deployed on Render

πŸ“ Repository Structure

parking-management-system/
β”‚
β”œβ”€β”€ frontend/
β”‚   └── parking-management-frontend/     # Angular app
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ api-gateway/                     # Spring Cloud Gateway
β”‚   β”œβ”€β”€ eureka-server/                  # Eureka Service Registry
β”‚   β”œβ”€β”€ user-service/                   # User microservice
β”‚   β”œβ”€β”€ admin-service/                  # Admin microservice
β”‚   β”œβ”€β”€ booking-service/                # Booking microservice
β”‚   └── location-service/               # Location microservice
β”‚
└── README.md


🌍 Live URLs

πŸ”Ή Frontend (Vercel)

https://pms-findmyspot.vercel.app/

βš™οΈ Environment Configuration (IMPORTANT)

βœ… Eureka Configuration (CRITICAL)

Each backend service must explicitly override Eureka's default localhost value.

src/main/resources/application.properties

spring.application.name=admin-service

eureka.client.enabled=true
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
eureka.client.service-url.defaultZone=Your render url 

⚠️ Do NOT rely on defaults
⚠️ Do NOT leave Eureka unconfigured
⚠️ Do NOT use localhost:8761 in production


πŸ—„οΈ Database Configuration (Render)

Set the following environment variables in Render for each service:

SPRING_DATASOURCE_URL
SPRING_DATASOURCE_USERNAME
SPRING_DATASOURCE_PASSWORD

πŸš€ Deployment Steps

Backend (Render)

  1. Create a Render Web Service for each backend module
  2. Set Java version to 17
  3. Add required environment variables
  4. Enable Clear Build Cache on redeploy
  5. Deploy in this order:
    1. Eureka Server
    2. Admin Service
    3. User Service
    4. Booking Service
    5. Location Service
    6. API Gateway

Frontend (Vercel)

  1. Go to https://vercel.com
  2. Import GitHub repository
  3. Configure:
    • Framework: Angular
    • Root Directory: frontend/parking-management-frontend
    • Build Command:
      npm run build -- --configuration production
      
    • Output Directory:
      dist/parking-management
      
  4. Deploy πŸŽ‰

🌐 API Gateway Routing

All frontend API calls go through API Gateway only.

Example:

https://api-gateway-52yp.onrender.com/api/users/login
https://api-gateway-52yp.onrender.com/api/admin/login

Frontend never calls individual microservices directly.


πŸ§ͺ Health Checks

Each service exposes:

/actuator/health

Example:

https://api-gateway******r.com/actuator/health

⚠️ Common Issues & Fixes

❌ Services not registering in Eureka

βœ” Ensure Eureka URL is explicitly overridden
βœ” Remove all localhost:8761 references
βœ” Clear build cache before redeploy


❌ CORS Errors

βœ” CORS handled at API Gateway level
βœ” Gateway allows .vercel.app origins


❌ Blank Screen on Vercel

βœ” Ensure correct output directory
βœ” Ensure SPA routing handled properly
βœ” Remove unused JS script references


πŸ“š Learnings

  • Eureka defaults to localhost:8761 if not overridden
  • application.properties has highest priority
  • Clearing build cache on Render is essential
  • API Gateway must be deployed after all services
  • Frontend must always talk to the gateway

πŸ‘€ Author

MV Sujan Kumar
Full Stack Developer
Spring Boot | Angular | Microservices


⭐️ Support

If you found this project helpful, please ⭐️ the repository!

Happy Coding πŸš€

About

Microservices-based parking management system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors