Skip to content

WattoX00/restaurantapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

116 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Restaurant API

A FastAPI backend for managing a restaurant's menu, orders, and sales statistics.

Demos

🚀 Installation

Clone the repository and install dependencies
git clone https://github.com/wattox00/restaurantapi.git
cd restaurantapi

Create a virtual environment

Linux / macOS
python -m venv .venv
source .venv/bin/activate
Windows
python -m venv .venv
.venv\Scripts\activate

Install dependencies

pip install -r requirements.txt

⚡ Running the Server

Linux / macOS

./main.sh

Windows

.\main.ps1

Once running, the terminal will display clickable links to access the frontend or open the URLs manually.

<path-of-the-cloned-repo>/frontend/index.html

🌐 Accessing the APIs manually

Menu: http://127.0.0.1:8001

Orders: http://127.0.0.1:8002

Statistics: http://127.0.0.1:8003

📄 Interactive API Documentation

Swagger UI: /docs

ReDoc: /redoc

🛠 Usage

Use the built-in HTML interface to explore routes, or interact via your own client.

<path-of-the-cloned-repo>/frontend/index.html

Workflow: Get the menu > Select items > Create order > Track orders > Complete orders > Check statistics.

View sales trends and graphs in the statistics tab.

🔒 Authentication

Uses basic JWT authentication.

Default credentials for all login pages:

username: admin password: admin

Feel free to change them as needed.

📦 Dependencies

Click to view
  • fastapi[standard]

  • uvicorn

  • sqlalchemy

  • python-jose[cryptography]

  • passlib[bcrypt]

  • python-multipart

API Endpoints

Click to expand

Menu Management

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

Orders

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

Statistics

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

Feel free to modify anything inside the app to suit your needs!

❤️ Support

If this project saved you time, taught you something, or made your day a little easier, you can support its development here:

👉 Buy me a coffee via PayPal

Your support helps keep the project:

  • Actively maintained
  • Continuously improved
  • Free and open source

Thanks for being part of the community 🤝

📄 License

This project is licensed under the MIT License.
See the LICENSE file for full details.

About

Api for restaurants

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages