Welcome to the Legend Bistro project! Legend Bistro is a simple restaurant management system with a web API for menu access, order placement, and administrative tasks. This README provides an overview of the project, instructions for setup, and details about using the API and the Admin Panel.
- Project Overview
- Getting Started
- Running the Application
- Endpoints
- Usage
- Data Files
- License
- Acknowledgments
The Legend Bistro project consists of two main components:
-
Client UI (
client.py
): This component provides a web API for accessing the restaurant's menu, placing orders, providing user names, and confirming payment methods. The API reads menu data from a JSON file and maintains a record of orders in a text file. -
Admin Panel (
admin.py
): The admin panel allows authorized users to perform administrative tasks related to the Legend Bistro service. It includes features to check if the website is running and to view the total income generated by Legend Bistro. -
Server (
server.py
): The server component acts as the core of the Legend Bistro project, serving as the backend for both the API and the Admin Panel. It handles the HTTP requests, processes data, and communicates with the other components.
Before running the Legend Bistro project, ensure you have the following prerequisites:
- Python 3.x
- Flask library (install with
pip install flask
) - Requests library (install with
pip install requests
)
-
Clone or download the repository to your local machine.
-
Place a JSON file named
Menu.json
in the project directory. This file should contain the restaurant's menu items. -
Create an empty text file named
report.txt
in the project directory. This file is used to keep track of orders.
To start the Legend Bistro API, run the following command in your terminal:
python server.py
- Root (
/
): Provides a welcome message to Legend Bistro. - Menu (
/api/v1/menu
): Allows retrieval of the entire restaurant menu. - Order (
/api/v1/order
): Enables order placement based on the provided 'id' query parameter. - Name (
/api/v1/name
): Retrieves the user's name provided as a query parameter. - Paying (
/api/v1/paying
): Confirms the payment method used for an order.
The admin panel is accessible via admin.py
and requires a passcode for access.
Authorized users can perform the following tasks:
- Check if the website is running.
- Check the total income.
- Access the menu: http://localhost:5000/api/v1/menu
- Place an order by providing an 'id' parameter: http://localhost:5000/api/v1/order?id=1
Access the admin panel by running admin.py
and providing the correct passcode.
Choose an activity to perform:
- Check if the website is running.
- Check the total income.
Menu.json
: Contains the restaurant menu in JSON format.report.txt
: Records orders and the number of times each item was ordered.
This project is licensed under the MIT License. See the LICENSE file for details.