Skip to content

KRYSTALM7/parking-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 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