Heroku App: MyExpressWay
Frontend App: MyExpressWayPortal
My Udacity Full Statck Developer Nanodegree program final project. The MyExpressWay server is used by an imaginary delivery company. They have drivers who need to login and mark if they are available and they have managers who need to login and see available drivers and deliveries.
Follow instructions on the Pipenv site to install and run pipenv. Run 'pipenv shell' to create, install dependencies, and start the virtual environment.
Follow instructions on the Postman docs to install and run postman.
run pipenv shell
run ./setup.sh
to load the environment variables.
Type flask run --reload
to run the developer server.
Type gunicorn -b localhost:5000 -w 2 app:app
to run a production server.
There are two primary roles in the application: the manager and the driver. The manager can access all aspects of the deliveries while the driver need only see available deliveries and update deliveries to mark them delivered.
Manager Permissions: -get:deliveries -post:deliveries -patch:deliveries -delete:deliveries
Driver Permissions: -get:deliveries -patch:deliveries
After creating your Auth0 app and roles configure the environment variables in setup.sh.
GET /
The application root.
GET /deliveries
Returns a json list of deliveries.
[
{
"delivered": false,
"description": "Softest Wheat Bread",
"driver_id": 1,
"id": 1
},
{
"delivered": false,
"description": "2% Milk",
"driver_id": null,
"id": 2
}
]
POST /deliveries
Create a new delivery. Returns a description of the posted item.
{
"description": "Softest Potato Bread"
}
PATCH /deliveries/
Update a delivery by the provided id. Returns the patched item.
{
"description": "Softest Wheat Bread",
"driver": 1,
"delivered": false
}
DELETE /deliveries/
Delete a delivery by the provided id. Returns a json representation of the deleted item.
{
"delivered": false,
"description": "Softest Potato Bread",
"driver_id": null,
"id": 6
}
GET /drivers
Get a list of drivers.
[
{
"fname": "John",
"id": 1,
"lname": "Smith"
},
{
"fname": "Karen",
"id": 2,
"lname": "Winters"
}
]
The postman template is myexpressway app.postman_collection.json, open this file to begin testing the endpoints. Be sure to update the tokens if they are expired.
You will find testing for each route in the provided postman configuration.