CS PROJECT Bms

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 26

PEM SCHOOL OF EXCELLENCE,

KANGEYAM ROAD,
TIRUPUR – 641606.

BAKERY MANAGEMENT SYSTEM


PROJECT

SUBMITTED BY

MRIDULA S
GRADE 12

UNDER THE GUIDANCE OF


Ms. DHANALAKSHMI
DEPARTMENT OF COMPUTER SCIENCE
CERTIFICATE

This is to certify that the Project entitled “BAKERY MANAGEMENT


SYSTEM” submitted in partial fulfilment of the requirements for the award of
AISSCE practical examination in COMPUTER SCIENCE to PEM SCHOOL
OF EXCELLENCE , affiliated to Central Board of Secondary Education, New
Delhi, is a record of bonafide work carried out byMRIDULA S, under my
supervision and guidance, that no part of this project has been submitted for the
award of any other examination and the work has not been published in popular
journal or magazine.

Signature of the Guide Signature of the Principal

Signature of Signature of

External Examiner Internal Examiner


DECLARATION

I hereby declare that the training entitled “BAKERY MANAGEMENT


SYSTEM” submitted to PEM SCHOOL OF EXCELLENCE, Senior Secondary
School, affiliated to Central Board of Secondary Education, New Delhi, in
partial fulfilment of the requirements for AISSCE practical examination is an
original work and it has not been previously formed the basis for the award of
any examination during the period of my study.

Place: Tirupur
Signature of the Candidate

Date:
ACKNOWLEDGEMENT

Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express
my gratitude to the people who have been instrumental in successful completion
of this project.

I express my sincere thanks to The Correspondent,


PEM SCHOOL OF EXCELLENCE for providing me an infrastructure and
moral support while carrying out this project in the school.

I express my deep sense of gratitude to The Principal, PEM SCHOOL OF


EXCELLENCE who has been continuously motivating and extending their
helping hand to us.

My sincere thanks to Ms. DHANALAKSHMI master In-charge, a Guide,


mentor all the above a friend, who critically reviewed my project and helped in
solving every problem, occurred during implementation of the project.

I gratefully acknowledge the contribution of the individuals who contributed to


bringing this project up to this level, who continues to look after me despite my
flaws.

I express my heartfelt gratitude to my parents for constant encouragement while


carrying out this project.

The guidance and support received from all the members who contributed and
who are contributing to this project, was vital for the success of the project. I am
grateful for their constant support and help.
SYNOPSIS

A bakery management system is an integrated software solution designed to


streamline the operations of a bakery. This system facilitates efficient inventory
management, tracking ingredients and supplies to ensure optimal stock levels and
minimize waste. It includes features for managing orders, from customer intake to
production scheduling, ensuring timely and accurate fulfilment. The system also
handles sales transactions, whether they occur in-store, online, or via mobile
platforms, providing real-time sales data and financial reporting. Employee
management is another key component, offering tools for scheduling, payroll
processing, and performance tracking.

Additionally, the bakery management system enhances customer relationship


management by storing customer preferences and order histories, enabling
personalized marketing and improved customer service. Production management
features help in planning and monitoring the baking process, ensuring consistency
and quality control. The system may integrate with various point-of-sale (POS)
systems and accounting software, creating a seamless flow of information across
different business areas. By automating routine tasks and providing actionable
insights through data analytics, the bakery management system aids in decision-
making and operational efficiency, ultimately contributing to the profitability and
growth of the bakery.
.
TABLE OF CONTENTS

CONTENTS:

1. Introduction

2. System Study

2.1 Existing system

2.2 Proposed system

3. System specifications

3.1 Hardware configuration

3.2 Software configuration

4. Source code

5. Sample output

6. Conclusion

7. Bibliography
1. INTRODUCTION
The Bakery Management System will incorporate a database to store essential
data such as product names and their prices. This system will provide different
levels of access and functionality based on user roles, specifically catering to
admin and customer login capabilities.

Admin users will have comprehensive access to manage the bakery's product
database. They can view the entire list of items, add new items, delete existing
items, and update the prices of items. This allows the admin to maintain up-to-
date and accurate product information, ensuring that the bakery's offerings and
pricing reflect current operations and market conditions.

1. Login/Register

2. Add product

3. View product

4. Record sale

5. View sales

6. Delete product

The customer login feature is designed for billing purposes. When a customer
makes a purchase, the biller can log in, input the items selected by the customer
along with their quantities, and the system will automatically generate a bill.
This process ensures accuracy in billing and provides a streamlined, efficient
checkout experience for customers.
2. SYSTEM STUDY

2.1 Existing system:

The existing system at Moon Pie Bakery operates without a centralized


management system for handling product data and customer billing. Currently,
there is no automated process for managing inventory, updating product prices,
or generating bills for customers. Admin tasks, such as adding or removing
items from the menu, are done manually, leading to inefficiencies and potential
errors. Similarly, customer billing is a manual process, where the biller notes
down items and quantities and calculates the total amount manually. This
manual approach is time-consuming, prone to errors, and lacks the ability to
maintain accurate records of transactions and inventory levels.

2.2 Proposed system:

The proposed Python Bakery Management System aims to address the shortcomings
of the existing system by introducing a comprehensive software solution. This system
will store product data, including names and prices, in a database, providing easy
access for both admin and customer functions. Admin users will have the capability
to add, delete, and update items in the menu, as well as manage product prices
efficiently. The system will automate inventory management, ensuring optimal stock
levels and reducing waste.

Additionally, the system will provide features such as customer name and phone
number tracking for better customer relationship management.

Overall, the proposed system will revolutionize operations at Moon Pie Bakery,
introducing efficiency, accuracy, and convenience into inventory management.
It will empower the bakery to streamline operations, reduce errors, and provide
a better experience for both staff and customers.
3. SYSTEM SPECIFICATIONS

3.1. Hardware Configuration:

Laptop - Dell
Processor - Intel I3 @ 1.20GHz Processor
Clock speed - 2.10 GHz
Installed RAM - 4.00 GB
Memory - 512 GB
System type - 64-bit OS, x64-based processor

3.2. Software Configuration:

Operating System - Windows 11


Front-end - Python 3.11.2
Back -end - MySQL 8.0
4.SOURCE CODE

#IMPORTING NECESSARY MODULES


importmysql.connector
fromgetpass import getpass
importhashlib

# Database Configuration
db_config = {
'user': 'root',
'password': 'root',
'host': 'localhost',
'database': 'bakery'
}

# Database Connection
defget_db_connection():
connection = mysql.connector.connect(**db_config)
return connection

# Utility Functions for User Management


defhash_password(password):
return hashlib.sha256(password.encode()).hexdigest()

defcreate_user(username, password):
conn = get_db_connection()
cursor = conn.cursor()
hashed_password = hash_password(password)
cursor.execute('''INSERT INTO users (username,
password) VALUES (%s, %s)''', (username, hashed_password))
conn.commit()
cursor.close()
conn.close()
defauthenticate_user(username, password):
conn = get_db_connection()
cursor = conn.cursor()
hashed_password = hash_password(password)
cursor.execute('''SELECT * FROM users WHERE
username = %s AND password = %s''',
(username, hashed_password))
user = cursor.fetchone()
cursor.close()
conn.close()
return user is not None

defsetup_user_table():
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL
);
""")
conn.commit()
cursor.close()
conn.close()

# Utility Functions for Product Management


defadd_product(name, price, stock):
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute('''INSERT INTO products (name, price, stock)
VALUES (%s, %s, %s)''', (name, price, stock))
conn.commit()
cursor.close()
conn.close()
defview_products():
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("SELECT * FROM products")
products = cursor.fetchall()
cursor.close()
conn.close()
return products

# Function to update products


defupdate_product(product_id, name, price, stock):
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute('''UPDATE products SET name = %s,
price = %s, stock = %s WHERE id = %s''',
(name, price, stock, product_id))
conn.commit()
cursor.close()
conn.close()

# Function to delete product


defdelete_product(product_id):
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("DELETE FROM products WHERE id = %s", (product_id,))
conn.commit()
cursor.close()
conn.close()

# Utility Functions for Sales Management


defrecord_sale(product_id, quantity):
conn = get_db_connection()
cursor = conn.cursor()

cursor.execute("SELECT stock FROM products WHERE id = %s", (product_id,))


result = cursor.fetchone()
if result is None:
cursor.close()
conn.close()
return "Product not found!"

stock = result[0]
if stock < quantity:
cursor.close()
conn.close()
return "Not enough stock!"

cursor.execute('''INSERT INTO sales (product_id, quantity)


VALUES (%s, %s)''', (product_id, quantity))
cursor.execute('''UPDATE products SET stock =
stock - %s WHERE id = %s''', (quantity, product_id))

conn.commit()
cursor.close()
conn.close()
return "Sale recorded successfully!"

defview_sales():
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("""
SELECT sales.id, products.name, sales.quantity, sales.sale_date
FROM sales JOIN products ON sales.product_id = products.id
""")
sales = cursor.fetchall()
cursor.close()
conn.close()
return sales

# Main Application
def main():
setup_user_table()
setup_product_table()
setup_sales_table()

print("******Welcome to the Bakery Management System******")


print("")
print("")
print("\\\\\\\\\\MOONPIE BAKERY/////////")

while True:
print("\n1. Login")
print("2. Register")
print("3. Exit")
choice = input("Enter your choice: ")

if choice == '1':
username = input("Enter username: ")
password = getpass("Enter password: ")

ifauthenticate_user(username, password):
print("Login successful!")
manage_bakery()
else:
print("Invalid username or password!")

elif choice == '2':


username = input("Enter new username: ")
password = getpass("Enter new password: ")
create_user(username, password)
print("User registered successfully!")

elif choice == '3':


print("Goodbye!")
break

else:
print("Invalid choice! Please try again.")

defmanage_bakery():
while True:
print("\nBakery Management System")
print("1. Add Product")
print("2. View Products")
print("3. Update Product")
print("4. Delete Product")
print("5. Record Sale")
print("6. View Sales")
print("7. Logout")
choice = input("Enter your choice: ")

if choice == '1':
name = input("Enter product name: ")
price = float(input("Enter product price: "))
stock = int(input("Enter product stock: "))
add_product(name, price, stock)
print("Product added successfully!")

elif choice == '2':


products = view_products()
print("\n--- Product List ---")
for product in products:
print(f'''ID: {product[0]}, Name: {product[1]},
Price: {product[2]}, Stock: {product[3]}''')
print("--------------------")

elif choice == '3':


product_id = int(input("Enter product ID to update: "))
name = input("Enter new product name: ")
price = float(input("Enter new product price: "))
stock = int(input("Enter new product stock: "))
update_product(product_id, name, price, stock)
print("Product updated successfully!")

elif choice == '4':


product_id = int(input("Enter product ID to delete: "))
delete_product(product_id)
print("Product deleted successfully!")

elif choice == '5':


product_id = int(input("Enter product ID: "))
quantity = int(input("Enter quantity: "))
message = record_sale(product_id, quantity)
print(message)
elif choice == '6':
sales = view_sales()
print("\n--- Sales Records ---")
for sale in sales:
print(f'''Sale ID: {sale[0]}, Product: {sale[1]}, Quantity: {sale[2]}, Date: {sale[3]} ''')
print("----------------------")

elif choice == '7':


print("Logged out!")
break

else:
print("Invalid choice! Please try again.")

defsetup_product_table():
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS products (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
price DECIMAL(10, 2) NOT NULL,
stock INT NOT NULL
);
""")
conn.commit()
cursor.close()
conn.close()

defsetup_sales_table():
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS sales (
id INT AUTO_INCREMENT PRIMARY KEY,
product_id INT,
quantity INT NOT NULL,
sale_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (product_id) REFERENCES products(id)
);
""")
conn.commit()
cursor.close()
conn.close()

if __name__ == "__main__":
main()
5. SAMPLE OUTPUTMAIN SCREEN :

ADD PRODUCT:

VIEW PRODUCTS:
UPDATE PRODUCT:

DELETE PRODUCT:
RECORD SALE:

VIEW SALES:
TABLE STRUCTURES:
Tables in bakery Database:

Structure of products table:

Structure of Sales table :

Structure of Userstable :

Sample run’s data :


6. CONCLUSION

The implementation of a bakery management system signifies a transformative step


towards enhancing the efficiency, accuracy, and overall productivity of bakery
operations. By integrating inventory management, sales tracking, and customer
relationship management into a cohesive digital platform, bakeries can streamline
their workflows, reduce waste, and improve customer satisfaction. The system not
only automates routine tasks but also provides valuable insights through data
analytics, enabling informed decision-making and strategic planning. Ultimately, a
well-designed bakery management system empowers bakeries to maintain consistent
product quality, optimize resource utilization, and adapt swiftly to market demands,
fostering sustainable growth and a competitive edge in the dynamic food industry.

Additionally, the adoption of such a system enhances the ability to manage orders
efficiently, track customer preferences, and tailor offerings to meet specific demands,
thereby fostering stronger customer loyalty and repeat business. The real-time data
accessibility and reporting capabilities ensure that bakery managers can monitor
performance metrics and quickly identify areas for improvement. Furthermore, by
minimizing human errors and automating manual processes, the bakery management
system helps in maintaining compliance with health and safety regulations, reducing
the risk of costly mistakes and ensuring the highest standards of hygiene and quality
control are met. In summary, the integration of a comprehensive bakery management
system is a strategic investment that not only streamlines operations but also positions
the bakery for long-term success and growth in an increasingly competitive market.
7 . BIBLIOGRAPHY

1. BOOK REFERNCE – SUMITA ARORA


2. https://www.w3schools.com/python/python_mysql_getstarted.asp
3. https://www.freecodecamp.org/news/python-datetime-now-how-toget-
todays-date-and-time/
4. https://www.w3schools.com/sql/sql_ref_drop_constraint.asp
5. https://www.scribd.com/document/417815101/Atm-Project
6. http://www.greencastleschool.in/page/banking-atm

You might also like