- Django: Backend
- Django Rest Framework: addons for Django
- Postgres: Database
- Pytest: testing framework
- Flake8: Linter
- Black: Formatter
A live version of the service is running on Heroku here: https://evening-scrubland-88960.herokuapp.com. It might take a few seconds for the service to spin up after a period of inactivity.
- Change permissions on entrypoint.sh
chmod +x backend/app/entrypoint.sh
- Run containers
docker-compose up -d
-
/api/pizzas/
This endpoint is supposed to provide data for the Pizza list view.
curl --location --request GET 'http://127.0.0.1:8000/api/pizzas/'
-
/api/extras/
This endpoint is supposed to provide data for the extra dropdowns.
curl --location --request GET 'http://127.0.0.1:8000/api/extras/'
-
/api/createorder/
This endpoint is for creating a new order.
curl --location --request POST 'http://127.0.0.1:8000/api/createorder/' \ --header 'Content-Type: application/json' \ --data-raw '{ "base_pizza": 1, "extras": [ { "extra": 15, "quantity": 1 }, { "extra": 16, "quantity": 5 } ], "user_name": "Dhruv", "user_address": "Wien" }'
-
/api/orders/<id>/
This endpoint returns the details of a specific order, including component items, and total price.
curl --location --request GET 'http://127.0.0.1:8000/api/orders/1'
-
/api/orders/
This endpoint returns all orders.
curl --location --request GET 'http://127.0.0.1:8000/api/orders/'
Postman collection containing the above requests can be found under the postman directory.
docker-compose exec backend pytest tests
- Add Swagger documentation using drf-yasg.
- Change
item_type
(in tableFoodItem
) to a relationship instead of CharField. (done to save time).