A FastAPI backend for managing a restaurant's menu, orders, and sales statistics.
Clone the repository and install dependencies
git clone https://github.com/wattox00/restaurantapi.git
cd restaurantapiCreate a virtual environment
Linux / macOS
python -m venv .venv
source .venv/bin/activateWindows
python -m venv .venv
.venv\Scripts\activateInstall dependencies
pip install -r requirements.txt./main.sh.\main.ps1Once running, the terminal will display clickable links to access the frontend or open the URLs manually.
<path-of-the-cloned-repo>/frontend/index.htmlMenu: http://127.0.0.1:8001
Orders: http://127.0.0.1:8002
Statistics: http://127.0.0.1:8003
Swagger UI: /docs
ReDoc: /redoc
Use the built-in HTML interface to explore routes, or interact via your own client.
<path-of-the-cloned-repo>/frontend/index.htmlWorkflow: Get the menu > Select items > Create order > Track orders > Complete orders > Check statistics.
View sales trends and graphs in the statistics tab.
Uses basic JWT authentication.
username: admin
password: admin
Feel free to change them as needed.
Click to view
-
fastapi[standard]
-
uvicorn
-
sqlalchemy
-
python-jose[cryptography]
-
passlib[bcrypt]
-
python-multipart
Click to expand
| Method | Endpoint | Description |
|---|---|---|
| GET | /get_menu |
Get all menu items |
| POST | /new_item |
Add a new menu item |
| DELETE | /delete_item/{id} |
Delete a menu item |
| PATCH | /patch_item/{id} |
Update a menu item |
| Method | Endpoint | Description |
|---|---|---|
| POST | /add_order |
Create a new order (JSON: food_names: List[str]) |
| GET | /view_orders |
Get all orders |
| GET | /view_order/{id} |
Get a specific order |
| PATCH | /update_odrder/{id} |
Update an order |
| PATCH | /finish_order/{id} |
Mark an order as finished |
| Method | Endpoint | Description |
|---|---|---|
| GET | /most_items_sold |
Get most sold menu items |
| GET | /least_items_sold |
Get least sold menu items |
| GET | /monthly_data |
Get monthly sales data |
If this project saved you time, taught you something, or made your day a little easier, you can support its development here:
Your support helps keep the project:
- Actively maintained
- Continuously improved
- Free and open source
Thanks for being part of the community 🤝
This project is licensed under the MIT License.
See the LICENSE file for full details.


