A web-based inventory management system demonstrating the use of hashmaps (dictionaries) and priority queues (min-heap) for efficient data organization.
- Add, Update, Delete Items: Manage inventory items with name, quantity, and price
- Fast Lookup: Uses Python dictionary (hashmap) for O(1) item retrieval
- Low Stock Alerts: Automatic tracking using a min-heap priority queue
- Search Functionality: Search items by name
- Sortable Inventory: Sort by name, quantity, or price
- Customizable Threshold: Set your own low stock threshold
- Persistent Storage: SQLite database stored locally in
inventory.db
-
HashMap (Dictionary):
- Python
dictfor O(1) item lookup by name - Efficient storage and retrieval of inventory items
- Python
-
Priority Queue (Min-Heap):
- Python
heapqfor tracking low stock items - Automatically maintains items sorted by quantity
- Efficient O(log n) updates when quantities change
- Python
-
Install dependencies:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Run the application:
./run.sh # Or directly: python3 app.py -
Open your browser to: http://localhost:5000
- Add Items: Use the form at the top to add new inventory items
- Update Items: Click "Edit" on any item to modify quantity or price
- Delete Items: Click "Delete" to remove items from inventory
- Search: Use the search box to find items by name
- Sort: Use the dropdown to sort items by different criteria
- Low Stock: Items below the threshold appear in the Low Stock section
- Adjust Threshold: Change the low stock threshold value as needed
- Backend: Flask (Python) REST API
- Frontend: Vanilla JavaScript with dynamic updates
- Database: SQLite with local storage
- Architecture: MVC pattern with clean separation of concerns