This is a REST API for a Pizza delivery service built for learning FastAPI.
METHOD | ROUTE | FUNCTIONALITY | ACCESS |
---|---|---|---|
POST | /auth/signup/ |
Register new user | All users |
POST | /auth/login/ |
Login user | All users |
POST | /orders/ |
Place an order | All users |
PUT | /orders/{id}/ |
Update an order | All users |
PATCH | /orders/{id}/ |
Update order status | Superuser |
DELETE | /orders/{id}/ |
Delete/Remove an order | All users |
GET | /orders/ |
Get user's orders | All users |
GET | /orders/all/ |
List all orders made | Superuser |
GET | /orders/{id}/ |
Retrieve an order | Superuser |
GET | /orders/my/{id}/ |
Get user's specific order | |
GET | /docs/ |
View API documentation | All users |
- Install Postgreql
- Install Python
- Git clone the project with
git clone https://github.com/MinnullinIlshat/pizza_delivery_api.git
- Create your virtualenv with
Pipenv
orvirtualenv
and activate it. - Install the requirements with
pip install -r requirements.txt
- Set Up your PostgreSQL database and set its URI in your
database.py
engine=create_engine('postgresql://postgres:<username>:<password>@localhost/<db_name>',
echo=True
)
- Create your database by running
python init_db.py
- Finally run the API ``` uvicorn main:app ``