Skip to content

Code for Legend Bistro which serves delicious pizzas

Notifications You must be signed in to change notification settings

Ashraf-wan/Legend_Bistro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Legend Bistro

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.

Table of Contents

Project Overview

The Legend Bistro project consists of two main components:

  1. 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.

  2. 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.

  3. 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.

Getting Started

Prerequisites

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)

Installation

  1. Clone or download the repository to your local machine.

  2. Place a JSON file named Menu.json in the project directory. This file should contain the restaurant's menu items.

  3. Create an empty text file named report.txt in the project directory. This file is used to keep track of orders.

Running the Application

Legend Bistro API (server.py)

To start the Legend Bistro API, run the following command in your terminal:

python server.py

Endpoints

Legend Bistro API

  • 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.

Admin Panel

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.

Usage

Legend Bistro API (client.py)

Admin Panel (admin.py)

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.

Data Files

  • Menu.json: Contains the restaurant menu in JSON format.
  • report.txt: Records orders and the number of times each item was ordered.

License

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

Acknowledgments