|
| 1 | +<div align="center"> |
| 2 | + |
| 3 | +``` |
| 4 | +╔════════════════════════════════════════════════════════════════════════════════════════════════════╗ |
| 5 | +║ ║ |
| 6 | +║ ██╗███╗ ██╗██╗ ██╗███████╗███╗ ██╗████████╗ ██████╗ ██████╗██╗ ██╗ ║ |
| 7 | +║ ██║████╗ ██║██║ ██║██╔════╝████╗ ██║╚══██╔══╝██╔═══██╗██╔══██╗╚██╗ ██╔╝ ║ |
| 8 | +║ ██║██╔██╗ ██║██║ ██║█████╗ ██╔██╗ ██║ ██║ ██║ ██║██████╔╝ ╚████╔╝ ║ |
| 9 | +║ ██║██║╚██╗██║╚██╗ ██╔╝██╔══╝ ██║╚██╗██║ ██║ ██║ ██║██╔══██╗ ╚██╔╝ ║ |
| 10 | +║ ██║██║ ╚████║ ╚████╔╝ ███████╗██║ ╚████║ ██║ ╚██████╔╝██║ ██║ ██║ ║ |
| 11 | +║ ╚═╝╚═╝ ╚═══╝ ╚═══╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ║ |
| 12 | +║ ║ |
| 13 | +║ ███╗ ███╗ █████╗ ███╗ ██╗ █████╗ ██████╗ ███████╗███╗ ███╗███████╗███╗ ██╗████████╗ ║ |
| 14 | +║ ████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝ ██╔════╝████╗ ████║██╔════╝████╗ ██║╚══██╔══╝ ║ |
| 15 | +║ ██╔████╔██║███████║██╔██╗ ██║███████║██║ ███╗█████╗ ██╔████╔██║█████╗ ██╔██╗ ██║ ██║ ║ |
| 16 | +║ ██║╚██╔╝██║██╔══██║██║╚██╗██║██╔══██║██║ ██║██╔══╝ ██║╚██╔╝██║██╔══╝ ██║╚██╗██║ ██║ ║ |
| 17 | +║ ██║ ╚═╝ ██║██║ ██║██║ ╚████║██║ ██║╚██████╔╝███████╗██║ ╚═╝ ██║███████╗██║ ╚████║ ██║ ║ |
| 18 | +║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ║ |
| 19 | +║ ║ |
| 20 | +╚════════════════════════════════════════════════════════════════════════════════════════════════════╝ |
| 21 | +``` |
| 22 | + |
| 23 | +# 📦 Inventory Management System |
| 24 | + |
| 25 | +[](https://www.oracle.com/java/) |
| 26 | +[](https://spring.io/projects/spring-boot) |
| 27 | +[](https://maven.apache.org/) |
| 28 | +[](https://www.mysql.com/) |
| 29 | +[](https://opensource.org/licenses/MIT) |
| 30 | + |
| 31 | +**A comprehensive Spring Boot application for multi-warehouse inventory management with advanced tracking and analytics** |
| 32 | + |
| 33 | +[Features](#-features) • [Tech Stack](#-tech-stack) • [Getting Started](#-getting-started) • [API Documentation](#-api-documentation) • [License](#-license) |
| 34 | + |
| 35 | +</div> |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## 📋 Table of Contents |
| 40 | + |
| 41 | +- [Overview](#-overview) |
| 42 | +- [Features](#-features) |
| 43 | +- [Tech Stack](#-tech-stack) |
| 44 | +- [Entities](#-entities) |
| 45 | +- [Getting Started](#-getting-started) |
| 46 | +- [API Documentation](#-api-documentation) |
| 47 | +- [Database Schema](#-database-schema) |
| 48 | +- [License](#-license) |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## 🎯 Overview |
| 53 | + |
| 54 | +**Inventory Management System** is an enterprise-grade Spring Boot application designed for comprehensive inventory tracking across multiple warehouses. It provides complete functionality for managing products, stock levels, suppliers, purchases, sales, and inter-warehouse transfers with advanced features like batch tracking, expiry management, and inventory valuation. |
| 55 | + |
| 56 | +This project demonstrates: |
| 57 | +- Multi-warehouse inventory management |
| 58 | +- Complex JPA entity relationships |
| 59 | +- RESTful API design with comprehensive endpoints |
| 60 | +- Service layer architecture with business logic |
| 61 | +- Advanced querying and reporting capabilities |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## ✨ Features |
| 66 | + |
| 67 | +### Core Features |
| 68 | +- ✅ **Multi-Warehouse Support** - Track inventory across multiple warehouse locations |
| 69 | +- ✅ **Product Management** - Comprehensive product catalog with SKU and barcode support |
| 70 | +- ✅ **Stock Tracking** - Real-time stock levels with batch and lot number tracking |
| 71 | +- ✅ **Supplier Management** - Vendor management with ratings and payment terms |
| 72 | +- ✅ **Purchase Orders** - Complete purchase order lifecycle management |
| 73 | +- ✅ **Sales Orders** - Sales order processing with payment tracking |
| 74 | +- ✅ **Stock Transfers** - Inter-warehouse stock transfer with approval workflow |
| 75 | + |
| 76 | +### Advanced Features |
| 77 | +- 📊 **Inventory Valuation** - Support for FIFO, LIFO, and Average costing methods |
| 78 | +- 📅 **Expiry Tracking** - Batch and expiry date management for perishable goods |
| 79 | +- 🔔 **Low Stock Alerts** - Automatic alerts when stock falls below reorder levels |
| 80 | +- 📈 **Analytics Ready** - Date range queries for reporting and forecasting |
| 81 | +- 🏷️ **Barcode/QR Support** - Product identification via barcode scanning |
| 82 | +- 💰 **Financial Tracking** - Cost price, selling price, and profit margin tracking |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +## 🛠️ Tech Stack |
| 87 | + |
| 88 | +| Technology | Version | Purpose | |
| 89 | +|------------|---------|---------| |
| 90 | +| **Java** | 21 | Programming Language | |
| 91 | +| **Spring Boot** | 4.0.1 | Application Framework | |
| 92 | +| **Spring Data JPA** | 4.0.1 | Data Access Layer | |
| 93 | +| **Hibernate** | (via Spring Boot) | ORM Framework | |
| 94 | +| **MySQL** | 8.0+ | Relational Database | |
| 95 | +| **Maven** | 4.0.0 | Build Tool | |
| 96 | +| **Spring Boot DevTools** | 4.0.1 | Development Utilities | |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## 📦 Entities |
| 101 | + |
| 102 | +### 1. Product |
| 103 | +Represents items in the inventory system |
| 104 | +- Product information (name, SKU, barcode, description) |
| 105 | +- Pricing (cost price, selling price) |
| 106 | +- Category and unit of measurement |
| 107 | +- Reorder level for low stock alerts |
| 108 | + |
| 109 | +### 2. Warehouse |
| 110 | +Represents storage locations |
| 111 | +- Warehouse identification (code, name) |
| 112 | +- Location details (address, city, state, country) |
| 113 | +- Contact information |
| 114 | +- Capacity tracking |
| 115 | +- Active/inactive status |
| 116 | + |
| 117 | +### 3. Stock |
| 118 | +Tracks inventory levels in warehouses |
| 119 | +- Product-warehouse relationship |
| 120 | +- Quantity tracking |
| 121 | +- Batch and lot number |
| 122 | +- Expiry and manufacturing dates |
| 123 | +- Valuation method (FIFO/LIFO/Average) |
| 124 | + |
| 125 | +### 4. Supplier |
| 126 | +Manages vendor information |
| 127 | +- Supplier details (code, name, contact) |
| 128 | +- Payment terms and credit limit |
| 129 | +- Rating system (1-5 stars) |
| 130 | +- Active/inactive status |
| 131 | + |
| 132 | +### 5. Purchase |
| 133 | +Purchase order management |
| 134 | +- Order tracking (PO number, dates) |
| 135 | +- Supplier and product relationship |
| 136 | +- Quantity and pricing |
| 137 | +- Order status (Pending, Confirmed, Shipped, Delivered, Cancelled) |
| 138 | +- Batch and expiry tracking |
| 139 | + |
| 140 | +### 6. Sale |
| 141 | +Sales order processing |
| 142 | +- Order tracking (SO number, dates) |
| 143 | +- Customer information |
| 144 | +- Quantity, pricing, discount, and tax |
| 145 | +- Payment status (Unpaid, Partially Paid, Paid, Refunded) |
| 146 | +- Order status (Pending, Confirmed, Processing, Shipped, Delivered, Cancelled, Returned) |
| 147 | + |
| 148 | +### 7. Transfer |
| 149 | +Inter-warehouse stock transfers |
| 150 | +- Transfer tracking (transfer number, dates) |
| 151 | +- Source and destination warehouses |
| 152 | +- Product and quantity |
| 153 | +- Transfer status (Pending, Approved, In Transit, Received, Cancelled, Rejected) |
| 154 | +- Approval workflow (initiated by, approved by, received by) |
| 155 | + |
| 156 | +--- |
| 157 | + |
| 158 | +## 🚀 Getting Started |
| 159 | + |
| 160 | +### Prerequisites |
| 161 | + |
| 162 | +- **Java Development Kit (JDK) 21** or higher |
| 163 | +- **Maven 3.6+** |
| 164 | +- **MySQL 8.0+** installed and running |
| 165 | +- **Git** for cloning the repository |
| 166 | + |
| 167 | +### Installation |
| 168 | + |
| 169 | +1. **Clone the repository** |
| 170 | + ```bash |
| 171 | + git clone https://github.com/Dronanaik/Java_Backend.git |
| 172 | + cd Java_Backend/InventoryManagement |
| 173 | + ``` |
| 174 | + |
| 175 | +2. **Create MySQL Database** |
| 176 | + ```bash |
| 177 | + mysql -u root -p |
| 178 | + ``` |
| 179 | + |
| 180 | + Then execute: |
| 181 | + ```sql |
| 182 | + CREATE DATABASE inventory_management; |
| 183 | + EXIT; |
| 184 | + ``` |
| 185 | + |
| 186 | +3. **Configure Database Connection** |
| 187 | + |
| 188 | + Edit `src/main/resources/application.properties`: |
| 189 | + ```properties |
| 190 | + spring.datasource.username=your_mysql_username |
| 191 | + spring.datasource.password=your_mysql_password |
| 192 | + ``` |
| 193 | + |
| 194 | +4. **Install Dependencies** |
| 195 | + ```bash |
| 196 | + mvn clean install |
| 197 | + ``` |
| 198 | + |
| 199 | +### Running the Application |
| 200 | + |
| 201 | +```bash |
| 202 | +mvn spring-boot:run |
| 203 | +``` |
| 204 | + |
| 205 | +The application will start on `http://localhost:8080` |
| 206 | + |
| 207 | +--- |
| 208 | + |
| 209 | +## 📡 API Documentation |
| 210 | + |
| 211 | +### Base URL |
| 212 | +``` |
| 213 | +http://localhost:8080/api |
| 214 | +``` |
| 215 | + |
| 216 | +### Product Endpoints |
| 217 | +- `GET /products` - Get all products |
| 218 | +- `GET /products/{id}` - Get product by ID |
| 219 | +- `GET /products/sku/{sku}` - Get product by SKU |
| 220 | +- `GET /products/barcode/{barcode}` - Get product by barcode |
| 221 | +- `GET /products/category/{category}` - Get products by category |
| 222 | +- `GET /products/search?name={name}` - Search products by name |
| 223 | +- `POST /products` - Create new product |
| 224 | +- `PUT /products/{id}` - Update product |
| 225 | +- `DELETE /products/{id}` - Delete product |
| 226 | + |
| 227 | +### Warehouse Endpoints |
| 228 | +- `GET /warehouses` - Get all warehouses |
| 229 | +- `GET /warehouses/{id}` - Get warehouse by ID |
| 230 | +- `GET /warehouses/code/{code}` - Get warehouse by code |
| 231 | +- `GET /warehouses/active` - Get active warehouses |
| 232 | +- `GET /warehouses/city/{city}` - Get warehouses by city |
| 233 | +- `POST /warehouses` - Create new warehouse |
| 234 | +- `PUT /warehouses/{id}` - Update warehouse |
| 235 | +- `DELETE /warehouses/{id}` - Delete warehouse |
| 236 | + |
| 237 | +### Stock Endpoints |
| 238 | +- `GET /stocks` - Get all stocks |
| 239 | +- `GET /stocks/{id}` - Get stock by ID |
| 240 | +- `GET /stocks/product/{productId}` - Get stocks by product |
| 241 | +- `GET /stocks/warehouse/{warehouseId}` - Get stocks by warehouse |
| 242 | +- `GET /stocks/product/{productId}/warehouse/{warehouseId}` - Get stock by product and warehouse |
| 243 | +- `GET /stocks/expiring?beforeDate={date}` - Get expiring stocks |
| 244 | +- `GET /stocks/low-stock` - Get low stock items |
| 245 | +- `POST /stocks` - Create new stock |
| 246 | +- `PUT /stocks/{id}` - Update stock |
| 247 | +- `DELETE /stocks/{id}` - Delete stock |
| 248 | + |
| 249 | +### Supplier Endpoints |
| 250 | +- `GET /suppliers` - Get all suppliers |
| 251 | +- `GET /suppliers/{id}` - Get supplier by ID |
| 252 | +- `GET /suppliers/code/{code}` - Get supplier by code |
| 253 | +- `GET /suppliers/active` - Get active suppliers |
| 254 | +- `GET /suppliers/rating/{rating}` - Get suppliers by rating |
| 255 | +- `POST /suppliers` - Create new supplier |
| 256 | +- `PUT /suppliers/{id}` - Update supplier |
| 257 | +- `DELETE /suppliers/{id}` - Delete supplier |
| 258 | + |
| 259 | +### Purchase Endpoints |
| 260 | +- `GET /purchases` - Get all purchases |
| 261 | +- `GET /purchases/{id}` - Get purchase by ID |
| 262 | +- `GET /purchases/order/{orderNumber}` - Get purchase by order number |
| 263 | +- `GET /purchases/supplier/{supplierId}` - Get purchases by supplier |
| 264 | +- `GET /purchases/status/{status}` - Get purchases by status |
| 265 | +- `GET /purchases/date-range?startDate={start}&endDate={end}` - Get purchases by date range |
| 266 | +- `POST /purchases` - Create new purchase |
| 267 | +- `PUT /purchases/{id}` - Update purchase |
| 268 | +- `DELETE /purchases/{id}` - Delete purchase |
| 269 | + |
| 270 | +### Sale Endpoints |
| 271 | +- `GET /sales` - Get all sales |
| 272 | +- `GET /sales/{id}` - Get sale by ID |
| 273 | +- `GET /sales/order/{orderNumber}` - Get sale by order number |
| 274 | +- `GET /sales/status/{status}` - Get sales by status |
| 275 | +- `GET /sales/payment-status/{paymentStatus}` - Get sales by payment status |
| 276 | +- `GET /sales/date-range?startDate={start}&endDate={end}` - Get sales by date range |
| 277 | +- `GET /sales/customer?name={name}` - Search sales by customer name |
| 278 | +- `POST /sales` - Create new sale |
| 279 | +- `PUT /sales/{id}` - Update sale |
| 280 | +- `DELETE /sales/{id}` - Delete sale |
| 281 | + |
| 282 | +### Transfer Endpoints |
| 283 | +- `GET /transfers` - Get all transfers |
| 284 | +- `GET /transfers/{id}` - Get transfer by ID |
| 285 | +- `GET /transfers/number/{transferNumber}` - Get transfer by number |
| 286 | +- `GET /transfers/from-warehouse/{warehouseId}` - Get transfers from warehouse |
| 287 | +- `GET /transfers/to-warehouse/{warehouseId}` - Get transfers to warehouse |
| 288 | +- `GET /transfers/status/{status}` - Get transfers by status |
| 289 | +- `POST /transfers` - Create new transfer |
| 290 | +- `PUT /transfers/{id}` - Update transfer |
| 291 | +- `DELETE /transfers/{id}` - Delete transfer |
| 292 | + |
| 293 | +--- |
| 294 | + |
| 295 | +## 🗄️ Database Schema |
| 296 | + |
| 297 | +The application uses complex JPA relationships: |
| 298 | + |
| 299 | +``` |
| 300 | +Product (1) ────< (N) Stock >──── (1) Warehouse |
| 301 | + │ |
| 302 | +Supplier (1) ────< (N) Purchase >──── (1) Product |
| 303 | + >──── (1) Warehouse |
| 304 | +
|
| 305 | +Product (1) ────< (N) Sale >──── (1) Warehouse |
| 306 | +
|
| 307 | +Product (1) ────< (N) Transfer |
| 308 | +Warehouse (1) ──< (N) Transfer (from) |
| 309 | +Warehouse (1) ──< (N) Transfer (to) |
| 310 | +``` |
| 311 | + |
| 312 | +**Key Relationships:** |
| 313 | +- **Product → Stock**: One-to-Many (One product can exist in multiple warehouses) |
| 314 | +- **Warehouse → Stock**: One-to-Many (One warehouse can store multiple products) |
| 315 | +- **Supplier → Purchase**: One-to-Many (One supplier can have multiple purchase orders) |
| 316 | +- **Product → Purchase/Sale/Transfer**: One-to-Many relationships for tracking |
| 317 | + |
| 318 | +--- |
| 319 | + |
| 320 | +## 📄 License |
| 321 | + |
| 322 | +This project is licensed under the **MIT License**: |
| 323 | + |
| 324 | +``` |
| 325 | +MIT License |
| 326 | +
|
| 327 | +Copyright (c) 2025 Java Backend Projects |
| 328 | +
|
| 329 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 330 | +of this software and associated documentation files (the "Software"), to deal |
| 331 | +in the Software without restriction, including without limitation the rights |
| 332 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 333 | +copies of the Software, and to permit persons to whom the Software is |
| 334 | +furnished to do so, subject to the following conditions: |
| 335 | +
|
| 336 | +The above copyright notice and this permission notice shall be included in all |
| 337 | +copies or substantial portions of the Software. |
| 338 | +
|
| 339 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 340 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 341 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 342 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 343 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 344 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 345 | +SOFTWARE. |
| 346 | +``` |
| 347 | + |
| 348 | +--- |
| 349 | + |
| 350 | +<div align="center"> |
| 351 | + |
| 352 | +**⭐ If you find this project helpful, please consider giving it a star!** |
| 353 | + |
| 354 | +Made with ❤️ using Spring Boot & Java |
| 355 | + |
| 356 | +</div> |
0 commit comments