An API that allows users to make maintenance/repair requests to operations or repairs department and monitor the status of their request.
The API should have the following API endpoints working:
| Endpoint | Functionality |
|---|---|
| GET /api/v1/users/requests | Get all requests |
GET /api/v1/users/requests/<requestId> |
Get a request |
| POST /api/v1/users/requests | Create a request |
PUT /api/v1/users/requests/<requestId> |
Modify a request |
This API will use data structures to store data.
-
Clone the repository as follows:
git clone https://github.com/leni1/main-tracker-api.git -
Checkout the
developbranch:git checkout develop -
Create a virtual environment in the source code folder through either of the following commands:
python -m venv name-of-virtual-environmentor
virtualenv name-of-virtual-environment -
Activate the virtual environment and install the dependencies in
requirements.txtsource name-of-virtual-environment/bin/activatepip install -r requirements.txt -
Export the application as an environment variable and set the
flaskenvironment to productionexport FLASK_APP=apiexport FLASK_ENV=production -
Run the application using
flask runand test the endpoints with sample data using Postman orcurl.
To run tests, follow steps 1 to 4 (if you haven't already done so) and then enter pytest tests/ at the command prompt.
Leni Kadali Mutungi