- Scenario: free parking lot without human intervention.
- parking lot:
- can create unlimited parking lots.
- can set the number of slots in each parking lot.
- car
- the car must park at the same slot size only.
- size:
- slots sizes: small, medium, large.
- car sizes: small, medium, large.
- pricing: free.
- Install Node.js 15.12.0
- Update the environment variables in .env file (you can see the example in
.env.example
) - Run
npm install
- Run
npm run start:dev
- Install Docker
- Install Docker Compose
- Run
docker-compose up -d
Tests are written using Jest and can be run using
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
for production you have to run docker exec -it parkinglot_api sh
before running test scripts
Swagger
: Once the application is running you can visit http://localhost:3000/api to see the Swagger interface.Postman
: https://documenter.getpostman.com/view/1178609/Uyr5oK1W
- parkingLots
- _id
- rank
- name
- slots
- smalls
- slotId
- isAvailable
- mediums
- slotId
- isAvailable
- larges
- slotId
- isAvailable
- createdAt
- tickets
- _id
- parkingLotId
- slotId
- plateNumber
- carSize
- exitAt
- createdAt
-
POST
/parkinglot
to create parking lot -
POST
/car/park
to park a car in a parking lot -
POST
/car/exit
to check out a parking -
GET
/car/status
to get available slots of all parking slots -
GET
/ticket?vehicleSize=large
to get ticket
- E2E test
- Unit test
- JWT for Authentication
- Example for client use
- Dockerfile for development