A Spring Boot backend with a built-in browser UI for managing parking lots, floors, spots, panels, vehicles, tickets, exits, and payments.
- Java with Spring Boot
3.5.4 - Gradle wrapper
- Spring Web and Spring Data JPA
- H2 in-memory database
- Static frontend served from
src/main/resources/static
./gradlew bootRunOpen:
http://localhost:8081
The H2 console is available at:
http://localhost:8081/h2-console
Use these H2 settings:
JDBC URL: jdbc:h2:mem:parkingdb
User: sa
Password:
- Open
http://localhost:8081. - Click
Seed Demoto create a parking lot, two floors, spots, entry and exit panels, and sample vehicles. - Use
Register Vehicleto add a vehicle. - Use
Issue Ticketto assign an available spot. - Open
Payments, choose the active ticket, and clickCalculate Fee. - Enter the ticket ID in
Take Paymentand clickMark Paid.
The UI talks directly to the backend APIs under /api, so it works from the same Spring Boot server without a separate frontend build step.
Base URL:
http://localhost:8081/api
Main endpoints:
GET /parkinglotsPOST /parkinglotsGET /floors/by-lot/{parkingLotId}POST /floorsGET /spots/by-floor/{floorId}GET /spots/available/{floorId}POST /spotsGET /vehiclesPOST /vehiclesGET /entry-panels/by-lot/{parkingLotId}POST /entry-panelsGET /exit-panels/by-lot/{parkingLotId}POST /exit-panelsGET /tickets/activePOST /ticketsPOST /tickets/exitPOST /paymentsGET /payments/by-ticket/{ticketId}
More endpoint examples are in API_DOCUMENTATION.md.
src/main/java/com/bharatp/ParkingLotBackend
controller/ REST API controllers
dto/ Request and response objects
entity/ JPA entities
enums/ Vehicle, spot, and payment enums
exception/ API error handling
mapper/ Entity/DTO mapping helpers
repository/ Spring Data repositories
service/ Business logic and allocation/pricing strategies
src/main/resources
application.properties
static/ Browser UI
- The app uses an in-memory H2 database, so data resets when the backend restarts.
- The configured server port is
8081. - The current Gradle toolchain is set to Java
24inbuild.gradle.