Skip to content

sagargupta312/Inventory-Management

Repository files navigation

Inventory Management System

This is a desktop-based Inventory Management System built using Python.
The project focuses mainly on backend logic and data flow, while the GUI is used only as a medium to interact with the logic.

The application allows users to add, view, update, delete, and search products stored in a MySQL database.

Required Libraries

  • customtkinter – for building the GUI
  • mysql-connector-python – for MySQL database connectivity
  • Pillow – for image handling in the GUI

Project Overview

The core idea of this project is to understand how:

  • User input flows from GUI to backend logic
  • Data is validated before database operations
  • Records are updated and searched efficiently
  • A table view stays synchronized with the database

The project is structured to clearly separate:

  • GUI
  • Application logic
  • Database operations

Backend Logic Explanation

1. Add Product Logic

  • User enters product details in the form
  • Input is validated (no empty fields)
  • Data is sent to the database insert function
  • After successful insertion:
    • The table is cleared
    • Data is reloaded from the database
  • A success message is shown to the user

This ensures the table always reflects the actual database state.


2. Update Product Logic (Different from Add)

Update works differently from Add:

  • User selects a row from the product table
  • The selected row’s data is automatically filled into the same form
  • The product ID is used only to identify the row, not to update it
  • User edits the required fields
  • On clicking Update:
    • Backend updates the record using WHERE id = selected_id
    • Table is refreshed from the database

The same form is reused for both Add and Update,
only the action (Save / Update) changes the behavior.


3. Delete Logic

  • User selects a product from the table
  • Backend deletes the record using the selected product ID
  • Table is refreshed to reflect the change

4. Search Logic (Case-Insensitive & Partial Match)

The search feature works as follows:

  • User selects a search filter (Product / Distributor / Category)
  • User enters a keyword
  • Backend performs a case-insensitive partial search
  • The database returns only matching rows
  • Table view is refreshed with filtered results

This allows:

  • Searching desi to match Desi Ghee and DESI Rabdi
  • Clean separation between UI and search logic

5. Table Synchronization Rule

The table is never manually updated row by row.

Instead:

  • The table is cleared
  • Fresh data is fetched from the database
  • The table is repopulated

This avoids inconsistencies between UI and database.


Screenshots

Screenshots are provided for better understanding of the application flow.

  • Screenshot 2026-01-23 183513
  • main

Database & SQL Notice

  • The actual MySQL database is not included in this repository
  • Database passwords are intentionally hidden
  • To run the project:
    • Create your own MySQL database
    • Create tables based on the provided structure idea
    • Update credentials locally

This is done for security reasons and follows standard practice.


Learning & Acknowledgements

  • This project was developed with the help of:
    • Official Python and MySQL documentation
    • Assistance from ChatGPT for understanding concepts, debugging logic, and improving structure

All logic was read, understood, and implemented, not blindly copied.


Key Takeaways

  • Clear separation of GUI and backend logic
  • Proper use of IDs for update and delete operations
  • Case-insensitive search handling
  • Real-world CRUD application flow
  • Practical understanding of Python–MySQL integration

How to Run (High Level)

  1. Clone the repository
  2. Create your own MySQL database
  3. Configure database credentials locally
  4. Run the main Python file

Final Note

This project is meant as a learning-focused inventory system,
with emphasis on logic clarity and real application behavior,
not just UI appearance. bw D MEGA MART is my store name

About

Grocery Store - II , Python desktop inventory system with DB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages