The project demonstrate to use of Flask micro framework for the creation of a an hypethoical Pizza Delivery Service API
- Use Flask with Flask-RESTX
- Database integration with Flask SQLAlchemy
- Authentication with JWT
- Enviroment Seperation
- Error handing with Werkzeug
- API documentation with SwaggerUI and Flask-RESTX
- Unit testing
- Database Migration
Method | Route | Functionality | Access |
---|---|---|---|
POST | /auth/signup/ |
Register new user | All users |
POST | /auth/login/ |
Login user | All users |
POST | /orders/order/ |
Place an order | All users |
PUT | /orders/order/update/{order_id}/ |
Update an order | All users |
PUT | /orders/order/status/{order_id}/ |
Update order status | Superuser |
DELETE | /orders/order/delete/{order_id}/ |
Delete/Remove an order | All users |
GET | /orders/user/orders/ |
Get user's orders | All users |
GET | /orders/orders/ |
List all orders made | Superuser |
GET | /orders/order/{order_id}/ |
Retrieve an order | Superuser |
GET | /orders/user/order/{order_id}/ |
Get user's specific order | |
GET | /docs/ |
View API documentation | All users |
Clone the project reposity
git clone https://github.com/danielogen/FlaskPizza-api.git
Change directory to project folder, create a virtual environment and activate it
$ cd FlaskPizza-api
$ python -m venv env
$ source env/bin/activate
Install all the required dependencies
$ pip install -r requirements.txt
Run the project in development
$ export FLASK_APP=api/
$ export FLASK_DEBUG=1
$ Flask run
python runserver.py