How vatanak-dev/store-management-api works
Store Management API exposes product and category management plus account registration and authentication. The main workflow is HTTP product requests through controllers, service logic, mapping and persistence, returning DTOs; product search adds dynamic filtering and pagination, while stock and status updates are distinct operations. The README also documents Swagger and validation. Source excerpts chiefly show product and user service behavior; category, security wiring, and some endpoints are represented where indexed or documented, so unsupported internal links are omitted.
Main entry points: ProductService.java Product operations · UserRepository.java User repository · CategoryService.java Category operations · CategoryRepository.java Category repository
Components 24
API endpoints
- Product endpoints
src/main/java/com/vdev/controller/ProductController.java - Category endpoints
src/main/java/com/vdev/controller/CategoryController.java - User registration
src/main/java/com/vdev/controller/UserController.java - Authentication endpoint
src/main/java/com/vdev/controller/AuthController.java
Store domain
- Product operations
src/main/java/com/vdev/service/ProductService.java - Category operations
src/main/java/com/vdev/service/CategoryService.java - Product mapping
src/main/java/com/vdev/mapper/ProductMapper.java - Category mapping
src/main/java/com/vdev/mapper/CategoryMapper.java - Product filters
src/main/java/com/vdev/specification/ProductSpecification.java - Product entity
src/main/java/com/vdev/entity/Product.java - Category entity
src/main/java/com/vdev/entity/Category.java
Persistence
- Product repository
src/main/java/com/vdev/repository/ProductRepository.java - Category repository
src/main/java/com/vdev/repository/CategoryRepository.java - User repository
src/main/java/com/vdev/repository/UserRepository.java - MySQL database
- Schema migrations
src/main/resources/db/migration
Identity and security
- Account registration
src/main/java/com/vdev/service/UserService.java - User lookup
src/main/java/com/vdev/service/CustomUserDetailsService.java - User entity
src/main/java/com/vdev/entity/User.java - Security configuration
src/main/java/com/vdev/config/SecurityConfig.java
Runtime support
- Error handling
src/main/java/com/vdev/exception/GlobalExceptionHandler.java - JPA auditing
src/main/java/com/vdev/config/JpaAuditingConfig.java - Spring Boot application
src/main/java/com/vdev/StoreManagementApiApplication.java
Other components
- API client
Connections 25
- API client → Product endpoints: sends requests
src/main/java/com/vdev/controller/ProductController.java - Product endpoints → Product operations: delegates
src/main/java/com/vdev/controller/ProductController.java - Category endpoints → Category operations: delegates
src/main/java/com/vdev/controller/CategoryController.java - User registration → Account registration: delegates
src/main/java/com/vdev/controller/UserController.java - Authentication endpoint → User lookup: authenticates
- API client → Category endpoints: sends requests
- API client → User registration: sends requests
- API client → Authentication endpoint: sends requests
- Product operations → Product repository: reads and writes
src/main/java/com/vdev/service/ProductService.java - Product operations → Category repository: loads category
src/main/java/com/vdev/service/ProductService.java - Product operations → Product mapping: maps results
src/main/java/com/vdev/service/ProductService.java - Product operations → Product filters: builds filters
src/main/java/com/vdev/service/ProductService.java - Category operations → Category repository: reads and writes
src/main/java/com/vdev/service/CategoryService.java - Category operations → Category mapping: maps category
src/main/java/com/vdev/service/CategoryService.java - Account registration → User repository: stores accounts
src/main/java/com/vdev/service/UserService.java - User lookup → User repository: loads user
src/main/java/com/vdev/service/CustomUserDetailsService.java - Security configuration → User lookup: configures lookup
src/main/java/com/vdev/config/SecurityConfig.java - Product repository → MySQL database: persists
- Category repository → MySQL database: persists
- User repository → MySQL database: persists
- Product entity → Category entity: references
src/main/java/com/vdev/entity/Product.java - User entity → User repository: stored by
src/main/java/com/vdev/repository/UserRepository.java - Product operations → Error handling: raises domain errors
- Spring Boot application → JPA auditing: starts application
- Schema migrations → MySQL database: defines schema