This project implements a low level design system for a smart parking lot. The system efficiently manages vehicle entry and exit, parking space allocation, and fee calculation. It is designed to handle multiple floors and various parking spots, accommodating different vehicle sizes such as motorcycles, cars, and buses.
- Automatic Parking Spot Allocation: Assigns parking spots based on vehicle size and availability.
- Vehicle Check-In and Check-Out: Records entry and exit times of vehicles.
- Parking Fee Calculation: Calculates parking fees based on duration and vehicle type.
- Real-Time Availability Update: Updates and broadcasts the availability of parking spots in real-time.
ParkingLot capacity: number, parkingSpace: map, availability: number, chargesPerHour: number, parkingSpots: array
Vehicle numberPlate: string
Motorcycle numberPlate: string, name: string, color: string, type: string
Car numberPlate: string, name: string, color: string, type: string
Bus numberPlate: string, type: string
Parking Spot id: number, floorNumber: number, spotNumber: number
Backend: Node.js
- Clone the repository:
git clone https://github.com/aayushah711/lld-parking-lot.git
cd lld-parking-lot
- Add parking lot configuration in runner.js:
let carParkingLot = new CarParkingLot(2, 1, 40);
- Add vehicles
let car1 = new Car("1", "Innova", "red");
let car2 = new Car("2", "Swift", "blue");
let car3 = new Car("3", "Alto", "grey");
- Add the check in & check out details:
carParkingLot.addVehicle(car1, 1);
carParkingLot.addVehicle(car2, 2);
carParkingLot.addVehicle(car3, 3);
carParkingLot.removeVehicle(car1, 3);
carParkingLot.addVehicle(car3, 3);
- Run the runner:
node runner.js