System requirements


Functional:

  • User should be able to request a ticket at the entrance gate.
  • User should be able to pay via credit card or phone pay, or any payment method that uses wifi.
  • Only electronic payment is allowed.
  • At the entrance or the exit, the camera should record a picture of the driver, car model and license plate.
  • If the payment has failed for any reason, the system should show a sign telling the driver to head to the security office.
  • System should show the number of available slots at the entering gate.
  • The system should not allow any new drivers to enter unless there is a free space.
  • System should store images for drivers, their cars and license plate for 7 days for security reasons.
  • The system should charge the user based on the number or hours he spent in the parking.


Non-Functional:

  • System should generate a report on a daily and monthly basis showing a report for the many cars have entered and left.
  • A security officer must ensure that all cars left the park before midnight or the cars will be removed.




Capacity estimation

  • Assuming 1000 car will enter and leave everyday and the capacity of the parking is 100 slot.
  • We need to store an object-like in the database




API design






Database design

  • We will use a non-sql object database to store userID, photo, car_license_plate.





High-level design

  • The system will mainly consist of a backend server doing all the processing and a non-sql database to save the employees data.





Request flows

  • The system starts by showing the number of available slots which is 100 every morning.
  • The driver comes, check that there is a free space and gets a ticket.
  • The backend server is then notified about this transaction, takes user data (photo, license plate) and store them in the database then decrease the number of available slots by 1.
  • When the user get to the exit, he pays via an electronic way (wifi based) and if the payment has been done successfully, the gate opens and the number to available slots increases by 1.





Detailed component design

Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...






Trade offs/Tech choices

  • We will use non-sql database to handle the type of data (object like).
  • We will use a microservice architecture which will enable us to use a ready-made payment service to interact with our system.




Failure scenarios/bottlenecks





Future improvements

  • If the system is deployed within several parking areas then it should upload the monthly sales report to the server which will then aggregate the data.