Usersnack is a Flask and Postgresql API backend project. Simulate an API of a Pizza restaurant to show the offer and send orders.
In live on AWS!
Resource | Method | Description | Form |
---|---|---|---|
/pizzas | GET | Return a list of all available pizzas | |
/pizzas/int:pizza_id | GET | Return details of the selected pizza and extra ingredients to add | |
/pizzas/submit | POST | Generate an order stored in DB. Return the total amount of the order. | name: String, address: String(min 6, max 50), pizza: Integer (pizza_id),extras: IntegerList |
/orders | GET | Return a list of all stored orders |
- Install Docker (https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04)
- Install Docker-Compose (https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-18-04)
- Git clone the project
docker-compose-build && docker-compose up
- Run docker-compose
- docker exec -it usernack_api-usersnack_1 bash
- python3 manage.py db init
- python3 manage.py db migrate
- python3 manage.py db upgrade
- docker exec -it usernack_api-usersnack_1 bash
- python3 command_initial_data.py
- docker-compose down --volumes
- Remove migrations folder
- Create migration files again after run docker-compose