CS PROJECT Bms
CS PROJECT Bms
CS PROJECT Bms
KANGEYAM ROAD,
TIRUPUR – 641606.
SUBMITTED BY
MRIDULA S
GRADE 12
Signature of Signature of
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.
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
CONTENTS:
1. Introduction
2. System Study
3. System specifications
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
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
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
# 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
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()
stock = result[0]
if stock < quantity:
cursor.close()
conn.close()
return "Not enough stock!"
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()
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!")
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!")
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 Userstable :
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