How iiamhimanshu/stocksense-inventory-system works
StockSense is a Spring Boot inventory REST backend. Clients use product and category endpoints to submit validated requests or query inventory; controllers delegate to services, which apply business rules, map entities and DTOs, and use repositories for persistence. Product operations include CRUD, duplicate-name checks, search, low-stock filtering, and category lookup; category deletion protects categories still in use. DTO validation and centralized JSON error handling are also represented. The README describes MySQL persistence; suppliers, authentication, and other roadmap items are not implemented in the provided tree. Some links rely on the source index rather than full excerpts.
Main entry points: ProductService.java Product Operations · CategoryController.java Category Endpoints · CategoryService.java Category Operations · ProductRepository.java Product Repository
Components 15
REST API
- Product Endpoints
src/main/java/com/stocksense/inventory/controller/ProductController.java - Category Endpoints
src/main/java/com/stocksense/inventory/controller/CategoryController.java - Product DTOs
src/main/java/com/stocksense/inventory/dto - Category DTOs
src/main/java/com/stocksense/inventory/dto - Error Responses
src/main/java/com/stocksense/inventory/exception/GlobalExceptionHandler.java
Inventory Services
- Product Operations
src/main/java/com/stocksense/inventory/service/ProductService.java - Category Operations
src/main/java/com/stocksense/inventory/service/CategoryService.java
Data Mapping
- Product Mapper
src/main/java/com/stocksense/inventory/mapper/ProductMapper.java - Category Mapper
src/main/java/com/stocksense/inventory/mapper/CatgeoryMapper.java
Persistence and Errors
- Product Entity
src/main/java/com/stocksense/inventory/model/Product.java - Category Entity
src/main/java/com/stocksense/inventory/model/Category.java - Product Repository
src/main/java/com/stocksense/inventory/repository/ProductRepository.java - Category Repository
src/main/java/com/stocksense/inventory/repository/CategoryRepository.java
Other components
- API Client
- MySQL
Connections 22
- API Client → Product Endpoints: calls REST
README.md - API Client → Category Endpoints: calls REST
README.md - Product Endpoints → Product Operations: delegates
src/main/java/com/stocksense/inventory/controller/ProductController.java - Category Endpoints → Category Operations: delegates
src/main/java/com/stocksense/inventory/controller/CategoryController.java - Category Endpoints → Product Operations: queries products
src/main/java/com/stocksense/inventory/controller/CategoryController.java - Product Endpoints → Product DTOs: accepts and returns
src/main/java/com/stocksense/inventory/controller/ProductController.java - Category Endpoints → Category DTOs: accepts and returns
src/main/java/com/stocksense/inventory/controller/CategoryController.java - Product Operations → Product Repository: queries and saves
src/main/java/com/stocksense/inventory/service/ProductService.java - Product Operations → Category Repository: checks categories
src/main/java/com/stocksense/inventory/service/ProductService.java - Product Operations → Product Mapper: maps products
src/main/java/com/stocksense/inventory/service/ProductService.java - Category Operations → Category Repository: queries and saves
src/main/java/com/stocksense/inventory/service/CategoryService.java - Category Operations → Product Repository: checks usage
src/main/java/com/stocksense/inventory/service/CategoryService.java - Category Operations → Category Mapper: maps categories
src/main/java/com/stocksense/inventory/service/CategoryService.java - Product Mapper → Product DTOs: maps DTOs
src/main/java/com/stocksense/inventory/mapper/ProductMapper.java - Product Mapper → Product Entity: maps entity
src/main/java/com/stocksense/inventory/mapper/ProductMapper.java - Category Mapper → Category DTOs: maps DTOs
src/main/java/com/stocksense/inventory/mapper/CatgeoryMapper.java - Category Mapper → Category Entity: maps entity
src/main/java/com/stocksense/inventory/mapper/CatgeoryMapper.java - Product Repository → Product Entity: persists
src/main/java/com/stocksense/inventory/repository/ProductRepository.java - Category Repository → Category Entity: persists
src/main/java/com/stocksense/inventory/repository/CategoryRepository.java - Product Repository → MySQL: stores inventory
README.md - Category Repository → MySQL: stores categories
README.md - Error Responses → API Client: returns JSON errors
src/main/java/com/stocksense/inventory/exception/GlobalExceptionHandler.java