This Python application provides a simple Book Store Management System using MySQL for data storage. It allows users to sign up, log in, manage books, track sales, and handle staff details.
- User Authentication:
-
Signup: Allows new users to create accounts with a username and password. -
Login: Verifies user credentials to grant access to the system.
-
- Book Management:
-
Add Books: Adds new books to the inventory, updating quantities if the book already exists. -
Delete Books (Sell): Simulates selling books, updating inventory, and recording sales. -
Search Books: Searches for books by name, genre, or author. -
Available Books: Displays a list of all available books.
-
- Sales Tracking:
-
Sell Record: Stores records of book sales, including customer details and book information. -
Total Income: Calculates and displays the total income from book sales. - Reset Sell history: Deletes all the records from sell history.
-
- Staff Management:
-
Add Staff: Adds new staff member details. -
Remove Staff: Removes existing staff member details. -
Staff Details: Displays details of all staff members.
-
- Python 3.x
- MySQL Server
mysql-connector-pythonlibrary (Install usingpip install mysql-connector-python)
-
Install Dependencies:
pip install mysql-connector-python
-
MySQL Setup:
- Ensure you have a running MySQL server.
- Create a user with necessary privileges. In the code provided the user is root with password kvafs123. Please change these credentials.
- The script creates a database named
storeand tables within it.
-
Run the Application:
python your_script_name.py
(Replace
your_script_name.pywith the actual name of your Python script.)
-
Signup/Login:
-
The application prompts you to either sign up or log in. -
Follow the on-screen instructions to create an account or log in.
-
-
Main Menu:
-
After successful login, you'll see the main menu with options to manage books, staff, sales, and more. -
Enter the corresponding number to select an option. - Follow the prompts to perform the chosen operation.
-
-
Book Operations:
-
Add books by entering book details. -
Sell books by entering customer and book details. -
Search for books using the provided search options. - View available books.
-
-
Staff Operations:
- Add, remove or view staff details.
-
Sales Operations:
- View sell history or reset it.
- View total income.
storeDatabase:signupTable:username(VARCHAR(20))password(VARCHAR(20))
Available_BooksTable:BookName(VARCHAR(30) PRIMARY KEY)Genre(VARCHAR(20))Quantity(INT(3))Author(VARCHAR(20))Publication(VARCHAR(30))Price(INT(4))
Sell_recTable:CustomerName(VARCHAR(20))PhoneNumber(CHAR(10) UNIQUE KEY)BookName(VARCHAR(30) FOREIGN KEY referencingAvailable_Books)Quantity(INT(100))Price(INT(4))
Staff_detailsTable:Name(VARCHAR(30))Gender(VARCHAR(10))Age(INT(3))PhoneNumber(CHAR(10) UNIQUE KEY)Address(VARCHAR(40))