Skip to content

Spring Boot REST API for managing a parking lot. πŸ…ΏοΈ πŸš— πŸš– 🚘 πŸš™

Notifications You must be signed in to change notification settings

edych/Parking-Lot-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

84 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— πŸ…ΏοΈ Parking Lot API πŸ…ΏοΈ πŸš™

CircleCI codecov

I used H2 database for persistence and Liquibase for schema management.
There is no booking restrictions per Customer.

Requirements

  • Java 11

Building and running the app

Docker

docker build -t edych/parking-lot-api .
docker run -p 8080:8080 edych/parking-lot-api

Maven

./mvnw clean install
java -jar target/parking-0.0.1-SNAPSHOT.jar

Entity Relationship Diagram

alt text

Prepared data

  • There are two ParkingFloors, each with 30 ParkingSpots
  • There is one Customer: id: 1, name: edych
  • H2 Console is available at http://localhost:8080/h2

API

Swagger UI

Documentation available at http://localhost:8080/swagger-ui.html

Postman

There is postman.json collection provided in the root of repository.

Curls

1. Create a new Reservation

curl -X POST 'localhost:8080/reservation' \
-H 'Content-Type: application/json' \
--data-raw '{"customerId": 1,"parkingSpotId": 5}'

2. Delete Reservation

curl -X DELETE 'localhost:8080/reservation/1'

3. Get a list of all Reservations made by Customer

curl -X GET 'localhost:8080/reservations?customerId=1'

4. Get a list of all available ParkingSpots

curl -X GET 'localhost:8080/parking-spot/available'

About

Spring Boot REST API for managing a parking lot. πŸ…ΏοΈ πŸš— πŸš– 🚘 πŸš™

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published