π Enhanced Stock Management System A feature-rich, color-coded Java console application for professional inventory and stock management with advanced analytics and reporting capabilities.
Java License Status
π Features Core Functionality β Add Stock - Add new products with quantity and price
β Update Stock - Modify quantity and price of existing stocks
β Remove Stock - Delete stock items with quantity validation
β View All Stocks - Display complete inventory in formatted table
Advanced Features π Search Functionality - Case-insensitive partial matching
π Inventory Reports - Detailed statistics and analysis
π Transaction History - Complete audit trail with timestamps
π° Inventory Valuation - Calculate total value with breakdowns
UI & UX π¨ Color-Coded Interface - ANSI color codes for better visibility
π± Professional Formatting - Unicode borders and tables
π Emoji Support - Visual indicators for status and actions
β Timestamp Logging - Automatic transaction tracking
π System Requirements Java Version: Java 8 or higher
OS: Windows, macOS, Linux
Terminal: Any standard terminal/console
RAM: Minimal (< 50MB)
π Quick Start Installation bash
git clone https://github.com/yourusername/stock-management-system.git cd stock-management-system
javac EnhancedStockManagementSystem.java
java EnhancedStockManagementSystem Usage text
- Select an option from the menu (1-10)
- Follow the prompts for each operation
- Enter valid data as requested
- View results with color-coded output
- Press Enter to return to menu π Feature Details
- Add New Stock text
- Enter stock name (must be unique)
- Enter quantity (non-negative)
- Enter price per unit
- Auto-logged to transaction history
- Update Stock Details text Options:
- Update quantity only
- Update price only
- Update both simultaneously
- Real-time modifications
- Remove Stock text
- Enter stock name
- Specify quantity to remove
- Validation checks prevent over-removal
- Auto-delete when quantity reaches 0
- Search Functionality text
- Case-insensitive search
- Partial name matching
- Display matching results with details
- Show quantity, price, and total value
- Low Stock Alerts text Triggers when:
- Quantity < 10 items OR
- Total value < βΉ5,000
Shows:
- Alert icon (
β οΈ ) - Stock name
- Current quantity
- Restock suggestion
- Inventory Report text Displays:
- Generated timestamp
- Total items in stock
- Total unique products
- Total inventory value
- Average price per product
- Top 3 stocks by value
- Transaction History text Records:
- Operation type (ADD/UPDATE/REMOVE)
- Stock name
- Quantity involved
- Timestamp (DD-MM-YYYY HH:MM:SS)
- Formatted table view
- Total Inventory Value text Shows:
- Grand total value
- Product-wise breakdown
- Percentage distribution
- Color-coded display π¨ Color Scheme Color Usage Code π’ Green Success, Positive actions \u001B[32m π΄ Red Errors, Warnings, Low stock \u001B[31m π΅ Blue Section headers \u001B[34m π‘ Yellow Prompts, Inputs \u001B[33m π΅ Cyan Borders, Tables \u001B[36m βͺ White Normal text \u001B[37m π Project Structure text stock-management-system/ β βββ EnhancedStockManagementSystem.java β βββ EnhancedStockManagementSystem (Main class) β βββ Stock (Model class) β βββ Transaction (History tracking class) β βββ README.md (this file) βββ COMPARISON.md (Original vs Enhanced comparison) βββ LICENSE βββ .gitignore ποΈ Code Architecture Main Classes
- EnhancedStockManagementSystem
java
public class EnhancedStockManagementSystem {
- main() : Entry point
- run() : Main event loop
- addStock() : Add new inventory
- updateStock() : Modify stock details
- removeStock() : Delete inventory
- viewAllStocks() : Display all items
- searchStock() : Find items
- viewLowStockAlerts() : Show alerts
- viewInventoryReport() : Generate report
- viewTransactionHistory() : Show history
- calculateTotalInventoryValue() : Calculate total
- Helper methods for UI and validation }
- Stock
java
public class Stock {
- String name
- int quantity
- double price
- getters/setters
- getTotalValue() : Calculate total
- isLowStock() : Check threshold
- removeQuantity() : Decrease inventory
- toString() : Display format }
- Transaction
java
public class Transaction {
- String type (ADD/UPDATE/REMOVE)
- String stockName
- int quantity
- double price
- String timestamp
- Getters for all fields } π Comparison with Original Feature Original Enhanced Status Add Stock β β Enhanced Updated Remove Stock β β Enhanced Updated View Stock β β Full Table Improved Update Stock β β NEW Search β β NEW Low Stock Alerts β β NEW Inventory Report β β NEW Transaction History β β NEW Total Value β β NEW Color UI β β NEW Error Handling Basic Advanced Enhanced Code Quality Good Excellent Enhanced Improvement Summary:
Lines of Code: 100 β 500 (+400%)
Features: 3 β 9 (+200%)
Classes: 2 β 3 (+50%)
π‘ Usage Examples Example 1: Adding Stock text Enter stock name: Laptop Enter quantity: 50 Enter price per unit (βΉ): 45000 β Stock added successfully! Example 2: Searching Stock text Enter stock name to search: Lap β Found 1 result(s): Laptop
- Quantity: 50
- Price: βΉ45,000.00
- Total Value: βΉ2,250,000.00
Example 3: Low Stock Alert
text
β οΈ Found 2 stock(s) below optimal level: - Mouse: Qty: 5 (Consider restocking)
- Keyboard: Qty: 8 (Consider restocking) Example 4: Inventory Report text π SUMMARY STATISTICS βββββββββββββββββββββββββββββββββ Total Items in Stock: 250 Total Unique Products: 5 Total Inventory Value: βΉ5,000,000.00 Average Price: βΉ1,000,000.00
π TOP STOCKS BY VALUE βββββββββββββββββββββββββββββββββ
- Laptop - βΉ2,250,000.00
- Desktop - βΉ1,800,000.00
- Monitor - βΉ950,000.00 π Input Validation The system includes comprehensive validation:
java β Duplicate stock prevention β Negative number handling β InputMismatchException catching β Empty string validation β Quantity overflow prevention β Price validation β Range checking for menu options π Future Enhancements Database integration (MySQL/PostgreSQL)
File export (CSV/PDF reports)
User authentication system
Multi-warehouse support
Barcode/QR code integration
Mobile app companion
REST API development
GUI version using JavaFX
Automatic reorder alerts
Supplier management
π€ Contributing Contributions are welcome!