I have used the Flask framework & MySQL as the database
Assumptions:
- I have assumed that only a single manager is handling the access requests of equipments.
How to configure the project on your Machine
-
Clone the project
-
Install the dependencies from requirements.txt
-
Create a MySQL database on your machine & edit the configurations.py file with the respective values of (host, database, user, password)
-
Also configure the secretKey for flask in configuration.py
-
Now, to create all the tables & insert some minimum data run the migrate.py file.
-
What does the migrate.py file do ?
It will create four tables namely (equipments, employee, manager, requestQueue) & insert some data
Equipments has [Motherboard(P1), Keyboard(P2), Mouse(P3)]
Employee has [Rohan(E1), Akash(E2), Sagar(E3)]
Manager has [Paresh(M1)]
requestQueue is Empty [This table is used as a queue for keeping a track of the access requests from the employees]
To know know more about the tables please check out the migrate.py file.
-
Now we are ready to start the server
Run the command python apis.py to run the server on port 5000
-
Basically the app takes you to the home page of employees where in one can ask for access of the equipment OR return an equipment..
-
And, the manager page link is mentioned on the Home page where in a manager can see the list of issued/available equipments & a list of access requests from the employees.