Stockify is a robust command-line inventory management system built with Java. It provides a comprehensive solution for managing product inventory with features like adding products, updating quantities, tracking prices, and generating inventory reports.
- Product Management
- Add new products with unique IDs
- Update product quantities and prices
- Remove products from inventory
- View detailed product information
- Inventory Operations
- List all products in inventory
- Sort products by various attributes (ID, name, quantity, price)
- Calculate the total inventory value
- Track product count
- Data Validation
- Unique product ID validation
- Input format verification
- Positive number validation for quantities and prices
- Product name format validation
- Java JDK 17 or higher
- Gradle 8.5 or higher
- Clone the repository:
git clone https://github.com/yourusername/stockify-platform.git cd stockify-platform
- Build the project:
./gradlew build
- Run the application:
./gradlew run
The system accepts the following commands:
- Add Product
ADD_PRODUCT <product_id> <product_name> <quantity> <price>
- Update Quantity
UPDATE_QUANTITY <product_id> <quantity>
- Update Price
UPDATE_PRICE <product_id> <price>
- View Product
VIEW_PRODUCT <product_id>
- Remove Product
REMOVE_PRODUCT <product_id>
- List Products
LIST_PRODUCTS
- Sort Products
`SORT_PRODUCTS
- Exit Application
EXIT
`> ADD_PRODUCT 101 Apple 10 50 SUCCESS
UPDATE_QUANTITY 101 20 SUCCESS
VIEW_PRODUCT 101 Product ID: 101 Name: Apple Quantity: 20 Price: 50
LIST_PRODUCTS 101:Apple:20:50
EXIT Product Count: 1 Total Inventory Value: 1000 Goodbye!`
The project follows clean architecture principles and is organized into the following packages:
com.stockify.platform/
├── App.java # Main application entry point
├── model/
│ └── Product.java # Product entity
├── service/
│ └── InventoryService.java # Business logic
├── controller/
│ └── CommandController.java # Command handling
└── util/
└── ValidationUtil.java # Input validation
Run the test suite using:
./gradlew test
The test suite includes:
- Basic functionality tests
- Edge cases
- Input validation
- State management
- Integration tests
- Product IDs must be unique
- Product names cannot contain spaces or semicolons
- Quantities and prices must be positive integers
- All inputs must follow the specified format
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors who helped shape this project
- Inspired by real-world inventory management systems
- Built with modern Java practices and clean architecture principles