The Inventory Management System is a distributed microservices-based application developed using Spring Boot and Spring Cloud. It is designed to simulate a real-world inventory/e-commerce platform, enabling seamless management of users, products, inventory, carts, and payments with high scalability and modularity.
This system follows modern enterprise architecture patterns, ensuring each microservice is independently deployable, has its own database, and communicates with others securely via API Gateway and Eureka Service Discovery.
- ✅ Service Discovery with Eureka Server
- ✅ API Gateway as a single entry point with routing & JWT validation
- ✅ User Authentication & Authorization with Spring Security + JWT
- ✅ Product Catalog Management (CRUD for products)
- ✅ Inventory Management (stock validation, search by location)
- ✅ Shopping Cart (add/remove/update cart items)
- ✅ Payment Processing integrated with Cart Service
- ✅ Independent databases per service (MySQL/H2)
- ✅ Centralized Exception Handling
- Port: 8761
- Purpose: Service registry
- Dashboard: http://localhost:8761
- Port: 8080
- Routes:
/user-service/** → USER-SERVICE/product-service/** → PRODUCT-SERVICE/inventory-service/** → INVENTORY-SERVICE/cart-service/** → CART-SERVICE/payment-service/** → PAYMENT-SERVICE
- Responsibilities: Routing, JWT validation
- Port: 8085
- Features:
POST /auth/login→ Login & issue JWTPOST /auth/register→ Register userGET /users→ Manage users
- Security: Spring Security + JWT
- Port: 8084
- Features:
POST /products→ Create productGET /products→ List allGET /products/{id}→ By IDPUT /products/{id}→ UpdateDELETE /products/{id}→ DeleteGET /products/inventory/{invtId}→ By inventory
- Port: 8083
- Features:
POST /inventory→ Add recordGET /inventory→ All inventoriesGET /inventory/{id}→ By IDPUT /inventory/{id}→ UpdateDELETE /inventory/{id}→ DeleteGET /inventory/inventoriesByLocation/{loc}→ Filter by location
- Port: 8082
- Features:
POST /cart→ Create new cartGET /cart/{id}→ Get cart by IDDELETE /cart/{id}→ Delete cartPOST /cart/{id}/items→ Add itemGET /cart/{id}/items→ List itemsPUT /cart/{id}/items/{itemId}→ Update itemDELETE /cart/{id}/items/{itemId}→ Remove item
- Integration: Calls Product Service for product details
- Port: 8085
- Features:
POST /payments/checkout→ Process payment for a cart
- Flow:
- Fetches cart via Cart Service
- Validates user & total amount
- Saves payment record
- User logs in via User Service → JWT issued
- Client includes JWT in request headers
- API Gateway validates JWT
- Request forwarded to relevant service
- Services trust JWT-validated traffic only via Gateway
User Service DB
erDiagram
USER {
long user_id PK
string username
string password_hash
string role
}
Product Service DB
erDiagram
PRODUCT {
long product_id PK
string product_name
string category
decimal price
}
Inventory Service DB
erDiagram
INVENTORY {
long inventory_id PK
string category
string location
}
Cart Service DB
erDiagram
CART ||--o{ CART_ITEM : contains
CART {
long cart_id PK
long user_id
}
CART_ITEM {
long cart_item_id PK
long cart_id FK
long product_id
int quantity
}
Payment Service DB
erDiagram
PAYMENT {
long payment_id PK
long user_id
long cart_id
decimal amount
string payment_status
string payment_mode
}
- Java 17+
- Maven 3.8+
- MySQL running locally
# Build all services
mvn clean install
# Run each microservice
mvn spring-boot:run- Eureka: 8761
- Gateway: 8080
- User: 8085
- Product: 8084
- Inventory: 8083
- Cart: 8082
- Payment: 8085
- Showcases real-world inventory management system
- Implements microservices best practices
- Demonstrates Spring Security & JWT
- Uses Eureka + Gateway for scalability
- Clean separation: each service has its own DB & logic