0% found this document useful (0 votes)
59 views21 pages

Boutique

Uploaded by

Mohan Vithya
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)
59 views21 pages

Boutique

Uploaded by

Mohan Vithya
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/ 21

INTRODUCTION

A Boutique Shop Management System is a software application designed to


help small businesses, particularly boutique stores, manage their day-to-day
operations efficiently. It allows business owners and staff to handle various
activities such as managing customer data, tracking product inventory,
processing sales, and generating reports. The main goal of such a system is to
streamline business operations, improve data accuracy, and enhance decision-
making by providing a centralized platform for managing key business
functions.

This system can be implemented using various technologies, but in this case, we
will use Python for the application logic and MySQL as the database for
storing data. The system provides a user-friendly interface (through the
command line in this case) to interact with the database and perform common
operations like:

1. Customer Management: Storing customer details, viewing customer


information, and managing customer records.
2. Product Management: Adding, updating, and viewing product
inventory, including product details like name, description, price, and
stock quantity.
3. Order Management: Creating orders by linking products with
customers, updating product stock, and calculating the total sales amount
for each order.
4. Sales Tracking: Keeping track of all orders placed, including the
products bought and the total amount spent.

1
Benefits of a Boutique Shop Management System

1. Improved Efficiency: Automates the process of managing customers,


products, and orders, saving time and reducing manual errors.
2. Real-time Data: Keeps track of inventory in real-time, ensuring that
product availability is always up-to-date.
3. Customer Satisfaction: Helps in providing better service to customers
by keeping their records easily accessible and processing orders quickly.
4. Sales and Financial Analysis: Allows store owners to view sales data
and generate reports, helping in making informed business decisions.

System Overview

The Boutique Shop Management System described in this project includes


several core functionalities, which are:

1. Customer Management:
o Add new customers with essential information such as name,
email, phone number, and address.
o View and manage the list of all customers.
2. Product Inventory:
o Add new products, including their names, descriptions, prices, and
stock quantities.
o View current stock levels and update stock when products are sold.
3. Order Management:
o Create orders by associating products with a customer, updating
stock levels, and calculating the total cost of the order.
o View a list of all orders and order details.

2
Design Choices

• Database Structure: The system uses a relational database (MySQL) to


store customer, product, and order data. The database schema consists of
four primary tables:
o customers: Stores customer information.
o products: Stores product details and inventory.
o orders: Contains order-related information, including which
customer placed the order and the total amount.
o order_items: Stores the details of each product within an order (i.e.,
product ID, quantity, and price).
• Without Foreign Keys: This implementation does not use foreign key
constraints in the database, meaning that the application logic (in Python)
is responsible for ensuring data consistency. For example, before
processing an order, the system manually checks if the referenced
customer and product exist and whether there is sufficient stock.

Technologies Used

1. Python: The main programming language used for building the


application logic. Python’s simplicity and ease of use make it a great
choice for such projects.
2. MySQL: A widely used relational database management system
(RDBMS) to store and manage data related to customers, products, and
orders. MySQL's powerful querying capabilities allow for efficient data
management and retrieval.
3. MySQL Connector for Python: A Python library (mysql-connector-
python) used to interact with the MySQL database.

3
Example Use Case

Consider a boutique shop that sells various clothing items. A customer can:

• Browse through the available products.


• Add items to their cart and place an order.
• The system automatically updates the inventory to reflect the purchased
items.

The business owner can:

• Add new products to the inventory.


• View orders and customer details.
• Track stock levels and reorder items when necessary.

Conclusion

This Boutique Shop Management System provides a practical and simple


solution for managing key business operations in a boutique store. By
automating tasks like inventory management, customer records, and order
processing, it enables the business owner to focus more on customer satisfaction
and business growth. This system can be further extended with features like
reporting, sales analysis, or integration with an online store for an even more
powerful solution.

4
FRONT END: PYTHON

BACK END: MYSQL

PYTHON:

Python is an interpreted, object-oriented high-level programming language with


dynamic semantics developed by Guido Van Rossum. It was originally released
in 1991. Designed to be easy as well as fun, the name “Python” is a nod to the
British comedy group Monty Python. Python has a reputation as a beginner-
friendly language, replacing Java as the most widely used introductory language
because it handles much of the complexity for the user, allowing beginners to
focus on fully grasping programming concepts rather than minute details.

Python is used for server-side web development, software development,


mathematics, and system scripting, and is popular for Rapid Application
Development and as a scripting or glue language to tie existing components
because of its high-level, built-in data structures, dynamic typing, and dynamic
binding. Program maintenance costs are reduced with Python due to the easily
learned syntax and emphasis on readability. Additionally, Python’s support of
modules and packages facilitates modular programs and reuse of code. Python
is an open source community language, so numerous independent programmers
are continually building libraries and functionality for it.

5
MYSQL:

MYSQL is a SQL-based relational database management system for web


databases. Use MySQL for various applications, including data cleansing, data
warehousing, online shopping, logging software, and portals. MySQL can store
everything from a single record to a complete product inventory. The
application of MySQL varies based on the need. It can associate with any
scripting language like PHP or Perl and create websites.

6
Source Code:

import mysql.connector

from mysql.connector import Error

# Function to connect to the MySQL database

def connect():

try:

connection = mysql.connector.connect(

host='localhost',

database='boutique_shop',

user='root',

password='admin'

if connection.is_connected():

return connection

except Error as e:

print(f"Error: {e}")

return None

# Function to add a new customer

def add_customer(name, email, phone, address):

connection = connect()

7
if connection:

cursor = connection.cursor()

query = "INSERT INTO customers (name, email, phone, address)


VALUES (%s, %s, %s, %s)"

cursor.execute(query, (name, email, phone, address))

connection.commit()

print(f"Customer {name} added successfully!")

cursor.close()

connection.close()

# Function to add a new product

def add_product(name, description, price, stock_quantity):

connection = connect()

if connection:

cursor = connection.cursor()

query = "INSERT INTO products (name, description, price,


stock_quantity) VALUES (%s, %s, %s, %s)"

cursor.execute(query, (name, description, price, stock_quantity))

connection.commit()

print(f"Product {name} added successfully!")

cursor.close()

connection.close()

8
# Function to update stock quantity of a product

def update_product_stock(product_id, quantity):

connection = connect()

if connection:

cursor = connection.cursor()

query = "UPDATE products SET stock_quantity = stock_quantity + %s


WHERE product_id = %s"

cursor.execute(query, (quantity, product_id))

connection.commit()

print(f"Product stock updated!")

cursor.close()

connection.close()

# Function to create an order

def create_order(customer_id, product_id, quantity):

connection = connect()

if connection:

cursor = connection.cursor()

# Check if the customer exists

9
cursor.execute("SELECT * FROM customers WHERE customer_id =
%s", (customer_id,))

customer = cursor.fetchone()

if not customer:

print("Customer not found!")

return

# Check if the product exists

cursor.execute("SELECT * FROM products WHERE product_id = %s",


(product_id,))

product = cursor.fetchone()

if not product:

print("Product not found!")

return

# Check if there's enough stock

stock_quantity = product[4]

if stock_quantity < quantity:

print(f"Not enough stock! Available stock: {stock_quantity}")

return

# Calculate total amount

10
unit_price = product[3]

total_amount = unit_price * quantity

# Insert order details

cursor.execute("INSERT INTO orders (customer_id, total_amount)


VALUES (%s, %s)", (customer_id, total_amount))

order_id = cursor.lastrowid # Get the last inserted order ID

# Insert order items

cursor.execute("INSERT INTO order_items (order_id, product_id,


quantity, unit_price) VALUES (%s, %s, %s, %s)",

(order_id, product_id, quantity, unit_price))

# Update product stock quantity

update_product_stock(product_id, -quantity)

connection.commit()

print(f"Order created successfully with Order ID: {order_id}")

cursor.close()

connection.close()

# Function to view all products in the inventory

11
def view_products():

connection = connect()

if connection:

cursor = connection.cursor()

cursor.execute("SELECT * FROM products")

products = cursor.fetchall()

print("Products in Inventory:")

for product in products:

print(f"ID: {product[0]}, Name: {product[1]}, Price: {product[3]},


Stock: {product[4]}")

cursor.close()

connection.close()

# Function to view all customers

def view_customers():

connection = connect()

if connection:

cursor = connection.cursor()

cursor.execute("SELECT * FROM customers")

customers = cursor.fetchall()

print("Customers:")

for customer in customers:

12
print(f"ID: {customer[0]}, Name: {customer[1]}, Email:
{customer[2]}")

cursor.close()

connection.close()

# Function to view all orders

def view_orders():

connection = connect()

if connection:

cursor = connection.cursor()

cursor.execute("SELECT * FROM orders")

orders = cursor.fetchall()

print("Orders:")

for order in orders:

print(f"Order ID: {order[0]}, Customer ID: {order[1]}, Date: {order[2]},


Total: {order[3]}")

cursor.close()

connection.close()

# Main function to interact with the system

def main():

while True:

13
print("\nBoutique Shop Management System")

print("1. Add Customer")

print("2. Add Product")

print("3. View Products")

print("4. Create Order")

print("5. View Orders")

print("6. View Customers")

print("7. Exit")

choice = input("Enter your choice: ")

if choice == '1':

name = input("Enter customer name: ")

email = input("Enter customer email: ")

phone = input("Enter customer phone: ")

address = input("Enter customer address: ")

add_customer(name, email, phone, address)

elif choice == '2':

name = input("Enter product name: ")

description = input("Enter product description: ")

price = float(input("Enter product price: "))

14
stock_quantity = int(input("Enter stock quantity: "))

add_product(name, description, price, stock_quantity)

elif choice == '3':

view_products()

elif choice == '4':

customer_id = int(input("Enter customer ID: "))

product_id = int(input("Enter product ID: "))

quantity = int(input("Enter quantity: "))

create_order(customer_id, product_id, quantity)

elif choice == '5':

view_orders()

elif choice == '6':

view_customers()

elif choice == '7':

print("Exiting the system...")

break

else:

15
print("Invalid choice. Please try again.")

if __name__ == "__main__":

main()

16
Python Output:

17
18
MYSQL Output:

19
20
21

You might also like