0% found this document useful (0 votes)
18 views18 pages

Restaurant Management System

The document outlines the design and implementation of a Restaurant Management System for Epicure's Delight, focusing on a food delivery app. It details the project's objectives, hardware and software requirements, functions, modules, and includes source code for database setup and user interactions. The system aims to provide convenience, variety, efficiency, and customer satisfaction in food ordering and delivery.

Uploaded by

haasiniprakash67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views18 pages

Restaurant Management System

The document outlines the design and implementation of a Restaurant Management System for Epicure's Delight, focusing on a food delivery app. It details the project's objectives, hardware and software requirements, functions, modules, and includes source code for database setup and user interactions. The system aims to provide convenience, variety, efficiency, and customer satisfaction in food ordering and delivery.

Uploaded by

haasiniprakash67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

RESTAURANT

MANAGEMENT SYSTEM

WELCOME TO
EPICURE’S DELIGHT
🍽 A FAMILY RESTAURANT!! 🍽
INDEX

S No TOPIC PAGE NO

1. OBJECTIVE OF THE PROJECT 3

HARDWARE / SOFTWARE
2. 4
REQUIREMENTS

3. FUNCTIONS 5

4. MODULES 6

5. SOURCE CODE 7

6. OUTPUT 16

7. BIBLIOGRAPHY 18

2
OBJECTIVE OF THE PROJECT:
The primary objective of a food delivery app is to provide a convenient and
efficient platform for users to order food from their favorite restaurants and have it
delivered to their doorstep. Here are some key objectives:

1. Convenience: Allow users to browse menus, place orders, and make


payments from the comfort of their homes or offices.
2. Variety: Offer a wide range of restaurant options and cuisines to cater to
diverse tastes and preferences.
3. Efficiency: Ensure timely delivery of orders with real-time tracking and
updates.
4. User Experience: Provide a seamless and user-friendly interface for easy
navigation and order placement.
5. Customer Satisfaction: Maintain high standards of service quality to
ensure customer satisfaction and loyalty.
6. Revenue Generation: Create a profitable business model through delivery
fees, service charges, and partnerships with restaurants.

3
HARDWARE REQUIREMENTS:
1.Processor: Intel Pentium 4 or later or compatible
2.Hard Disk: 410GB or more
3.RAM: 1GB or more
4.Printer: Any
5.Monitor: SVGA color monitor (touch screen or simple)
6.Pointing Device: Touch pad or keys

SOFTWARE REQUIREMENTS:
1.Python 3.9.0 or higher
2.MYSQL 8.0

4
FUNCTION:
A function is a block of code, which only runs when it is called. You can pass data,
known as parameters, into a function. A function can return data as a result.
1. Built-in functions: These predefined functions are always
available for use. Eg:- len(), int() etc.
2. Functions defined in modules: These are predefined functions available in
specific modules and can be used only when that module is imported. Eg:
random.randint() gives a random integer value in a given interval. This is available
in the random module.
3. User defined functions: the user defines these functions.

Functions used in this project:

Built-in functions User defined functions

 cursor()  menu()
 execute()  adddata()
 print()  update()
 int()  delete()
 fetchall()  display()
 commit()  set_database()
 fetchone()  user_signup
 connect()  main()

5
MODULES:
A Python module is a file containing Python definitions and statements. A module
can define functions, classes, and variables.

Modules used in this project:


Mysql.connector: This method sets up a connection, establishing a session with the
MySQL server. If no arguments are given, it uses the already configured or default
values. A connection with the MySQL server can be established using either

using them mysql.connector.connect() method or the


mysql.connector.MySQLConnection()

6
SOURCE CODE
import mysql.connector
from mysql.connector import Error, IntegrityError

mydb = mysql.connector.connect(host="localhost", user="root", password="Tiger")


cursor = mydb.cursor()

def setup_database(cursor):
cursor.execute("CREATE DATABASE IF NOT EXISTS food_delivery")
cursor.execute("USE food_delivery")
cursor.execute("""
CREATE TABLE IF NOT EXISTS veg_menu (
id INT AUTO_INCREMENT PRIMARY KEY,
type ENUM('starters', 'main_course', 'combo'),
name VARCHAR(255) UNIQUE,
price DECIMAL(10, 2)
)
""")
cursor.execute("""
CREATE TABLE IF NOT EXISTS non_veg_menu (
id INT AUTO_INCREMENT PRIMARY KEY,
type ENUM('starters', 'main_course', 'combo'),
name VARCHAR(255) UNIQUE,
price DECIMAL(10, 2)
)

7
""")
cursor.execute("""
CREATE TABLE IF NOT EXISTS desserts (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) UNIQUE,
price DECIMAL(10, 2)
)
""")
cursor.execute("""
CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) UNIQUE,
password VARCHAR(255)
)
""")

def insert_data(cursor):
# Check if the tables are empty before inserting
cursor.execute("SELECT COUNT(*) FROM veg_menu")
if cursor.fetchone()[0] == 0:
veg_menu_data = [
('starters', 'Vegetable Spring Rolls', 150),
('starters', 'Paneer Tikka', 200),
('starters', 'Vegetable Samosa', 100),
('starters', 'Hara Bhara Kebab', 150),

8
('main_course', 'Paneer Butter Masala', 250),
('main_course', 'Dal Makhani', 180),
('combo', 'Veg Thali', 300)
]
for item in veg_menu_data:
try:
cursor.execute("INSERT INTO veg_menu (type, name, price) VALUES
(%s, %s, %s)", item)
except IntegrityError:
pass

cursor.execute("SELECT COUNT(*) FROM non_veg_menu")


if cursor.fetchone()[0] == 0:
non_veg_menu_data = [
('starters', 'Chicken Tikka', 250),
('main_course', 'Butter Chicken', 350),
('combo', 'Non-Veg Thali', 500)
]
for item in non_veg_menu_data:
try:
cursor.execute("INSERT INTO non_veg_menu (type, name, price)
VALUES (%s, %s, %s)", item)
except IntegrityError:
pass

cursor.execute("SELECT COUNT(*) FROM desserts")

9
if cursor.fetchone()[0] == 0:
desserts_data = [
('Gulab Jamun', 100),
('Ras Malai', 120)
]
for item in desserts_data:
try:
cursor.execute("INSERT INTO desserts (name, price) VALUES (%s,
%s)", item)
except IntegrityError:
pass

def user_signup(cursor):
username = input("Enter a username: ").strip()
password = input("Enter a password: ").strip() # Consider hashing this
try:
cursor.execute("INSERT INTO users (username, password) VALUES (%s,
%s)", (username, password))
mydb.commit()
print("\nSign up successful!\n")
except IntegrityError:
print("\nUsername already exists. Please try again.")

def user_login(cursor):
username = input("Enter your username: ").strip()
password = input("Enter your password: ").strip()

10
cursor.execute("SELECT * FROM users WHERE username = %s AND
password = %s", (username, password))
user = cursor.fetchone()
if user:
print("\n\nLogin successful!\n")
return True
else:
print("\nInvalid credentials. Please try again.\n")
return False

def fetch_menu(cursor, food_type):


query = "SELECT DISTINCT * FROM " + ("veg_menu" if food_type == 'veg'
else "non_veg_menu")
cursor.execute(query)
return cursor.fetchall()

def fetch_desserts(cursor):
cursor.execute("SELECT DISTINCT * FROM desserts")
return cursor.fetchall()

def display_menu(menu, food_type):


print(f"\n{food_type.capitalize()} Menu:")
for item in menu:
print(f"ID: {item[0]}, Type: {item[1]}, Name: {item[2]}, Price: {item[3]}")

def display_desserts(desserts):

11
print("\nDesserts Menu:")
for dessert in desserts:
print(f"ID: {dessert[0]}, Name: {dessert[1]}, Price: {dessert[2]}")

def generate_bill(order_items, restaurant_name="Epicure's Delight"):

print("**************************************************************
******************")

print("**************************************************************
******************")
print("\n------------------- Bill ---------------------")
print(f" Restaurant: {restaurant_name} ")
total = 0
for item in order_items:
print(f"{item[0]} : ₹{item[1]}")
total += item[1]
print("------------------------------------------------")
print(f"Total : ₹{total} ")
print("------------------------------------------------")
print("Thank you for ordering from Epicure's Delight!\n")

def main():
try:
setup_database(cursor)
insert_data(cursor) # Call only once

12
print("**************************************************************
******************")
print(" Welcome to Epicure's Delight! ")
print(" A family Restaurant! ")

print("**************************************************************
******************")
while True:
action = input("Would you like to 'signup' or 'login'?\nPress 1 to SignUp and
2 to Login: ").strip().lower()
if action == '1':
user_signup(cursor)
elif action == '2':
if user_login(cursor):
break
else:
print("Invalid choice. Please type 'signup' or 'login'.")

print("**************************************************************
******************")
food_type = input("Would you like to see the 'veg' or 'non-veg' menu?
").strip().lower()
if food_type not in ['veg', 'non-veg']:
print("Invalid choice. Please choose 'veg' or 'non-veg'.")
return
menu = fetch_menu(cursor, food_type)
display_menu(menu, food_type)

13
# Display desserts
desserts = fetch_desserts(cursor)
display_desserts(desserts)
print("\nWould you like to order anything from the menu? (yes/no)")
if input().strip().lower() == 'yes':
order_items = []
while True:
item_id = int(input("Enter the ID of the item to order (or 0 to finish): "))
if item_id == 0:
break
# Verify if the item exists in the menu
cursor.execute("SELECT name, price FROM veg_menu WHERE id =
%s", (item_id,))
veg_item = cursor.fetchone()
cursor.execute("SELECT name, price FROM non_veg_menu WHERE id
= %s", (item_id,))
non_veg_item = cursor.fetchone()
cursor.execute("SELECT name, price FROM desserts WHERE id = %s",
(item_id,))
dessert_item = cursor.fetchone()
if veg_item:
item_name, item_price = veg_item
elif non_veg_item:
item_name, item_price = non_veg_item
elif dessert_item:
item_name, item_price = dessert_item

14
else:
print("Item not found. Please enter a valid ID.")
continue
order_items.append((item_name, item_price))
if order_items:
generate_bill(order_items, restaurant_name="Epicure's Delight")
elif input().strip().lower() == 'no':
print("Thanks for wasting our time")
else:
print("Please enter YES or NO")
except mysql.connector.Error as err:
print(f"Error: {err}")
finally:
cursor.close()
mydb.close()

main()

15
OUTPUT

16
17
BIBLIOGRAPHY
 Book- Python by Sumita Arora
 www.python.org
 https://www.geeksforgeeks.com

18

You might also like