- Clone the application in eclipse/intelliJ
- On running - it will by default start on http://localhost:8080
- H2 Console will get available on : http://localhost:8080/h2-console
- H2 console will be accessible using default credentials : sa/password
- The postman collection is attached inside the directory /design
- Open Terminal at project base location
- Run
mvn clean install
to verify the installation and tests - Run
docker build --tag=parking-management-system-latest .
- Run
docker run -p8080:8080 parking-management-system-latest
- Test the application by hitting
http://localhost:8080/parking/123
-
Create Parking Space Curl :
curl --location --request POST 'http://localhost:8080/parking' \ --header 'Content-Type: application/json' \ --data-raw '{ "parkingName": "BLR Parking1", "city": "Bangalore", "small": 5, "medium": 5, "large": 5, "extraLarge": 5 }'
-
Allocate Parking Space Curl :
curl --location --request POST 'http://localhost:8080/getslot/01db76ae-e9d5-40f7-ac1d-c733f7fb18df/EXTRALARGE?carNumber=KA05KY1352'
-
Release Parking Space Curl :
curl --location --request POST 'http://localhost:8080/releaseslot/0845eb64-ac40-4f68-9a20-a365e66fd328/4e7e06d1-a5bc-4254-a090-ab66bc05c415'
-
Get Current Parking Status Curl :
curl --location --request GET 'http://localhost:8080/parking/01db76ae-e9d5-40f7-ac1d-c733f7fb18df'
The project has test coverage of 100% for controllers, 98.2% for all the services.
Java 17, Spring Boot 3.0.1 and SQL - H2 for easy support to start the application locally (This can be easily migrated to NoSQL for enhanced scalability), Docker - to provide cloud native support and easy deployment on any managed k8s cluster, slf4j profile based logging for enhanced tracebility and debugging.