How ksenmay/modsen-catalog works
MODSEN CATALOG is a Spring application for role-based administration of a product catalog, with CRUD operations and user authentication. The main workflow is an API request handled by a controller, processed by an application service, and persisted through repository ports; product, category, user, and review management are distinct stages. Price history and application events support additional workflows. The source excerpts show several service-to-port calls, but not the adapter implementations or full event wiring, so those links are omitted or marked unverified.
Main entry points: ProductService.java Product management · EventPublisher.java Event publisher · ReviewService.java Review management · CategoryService.java Category management
Components 23
Web API
- Product API
src/main/java/by/may/web/controllers/ProductController.java - Category API
src/main/java/by/may/web/controllers/CategoryController.java - User API
src/main/java/by/may/web/controllers/UserController.java - Review API
src/main/java/by/may/web/controllers/ReviewController.java - Auth API
src/main/java/by/may/web/controllers/AuthController.java - Error responses
src/main/java/by/may/web/advice/GlobalExceptionHandler.java
Application Services
- Product management
src/main/java/by/may/application/service/ProductService.java - Category management
src/main/java/by/may/application/service/CategoryService.java - User management
src/main/java/by/may/application/service/UserService.java - Review management
src/main/java/by/may/application/service/ReviewService.java - Authentication
src/main/java/by/may/application/service/AuthService.java - Price history
src/main/java/by/may/application/service/PriceHistoryService.java
Persistence
- Category repository port
src/main/java/by/may/application/port/CategoryRepositoryPort.java - Product repository port
src/main/java/by/may/application/port/ProductRepositoryPort.java - User repository port
src/main/java/by/may/application/port/UserRepositoryPort.java - Review repository port
src/main/java/by/may/application/port/ReviewRepositoryPort.java - History repository port
src/main/java/by/may/application/port/PriceHistoryRepositoryPort.java
Events and Security
- Event publisher
src/main/java/by/may/application/port/EventPublisher.java - Spring event adapter
src/main/java/by/may/infrastructure/event/SpringEventPublisher.java - Event handlers
src/main/java/by/may/infrastructure/listener - JWT security
src/main/java/by/may/infrastructure/security/JwtService.java
Other components
- API client
- PostgreSQL
Connections 35
- API client → Product API: requests
src/main/java/by/may/web/controllers/ProductController.java - API client → Category API: requests
- API client → User API: requests
src/main/java/by/may/web/controllers/UserController.java - API client → Review API: requests
src/main/java/by/may/web/controllers/ReviewController.java - API client → Auth API: authenticates
- Product API → Product management: calls
src/main/java/by/may/web/controllers/ProductController.java - Product API → Price history: calls
src/main/java/by/may/web/controllers/ProductController.java - User API → User management: calls
src/main/java/by/may/web/controllers/UserController.java - Review API → Review management: calls
src/main/java/by/may/web/controllers/ReviewController.java - Category API → Category management: calls
src/main/java/by/may/web/controllers/CategoryController.java - Auth API → Authentication: calls
- Product management → Product repository port: reads and writes
src/main/java/by/may/application/service/ProductService.java - Product management → History repository port: saves history
src/main/java/by/may/application/service/ProductService.java - Product management → Review repository port: soft deletes
src/main/java/by/may/application/service/ProductService.java - Category management → Category repository port: reads and writes
src/main/java/by/may/application/service/CategoryService.java - Category management → Product repository port: checks usage
src/main/java/by/may/application/service/CategoryService.java - User management → User repository port: reads and writes
src/main/java/by/may/application/service/UserService.java - Review management → Review repository port: reads and writes
src/main/java/by/may/application/service/ReviewService.java - Review management → User repository port: checks user
src/main/java/by/may/application/service/ReviewService.java - Review management → Product repository port: checks product
src/main/java/by/may/application/service/ReviewService.java - Authentication → User repository port: reads and writes
src/main/java/by/may/application/service/AuthService.java - Product management → Event publisher: publishes events
src/main/java/by/may/application/service/ProductService.java - Category management → Event publisher: publishes events
src/main/java/by/may/application/service/CategoryService.java - User management → Event publisher: publishes events
src/main/java/by/may/application/service/UserService.java - Review management → Event publisher: publishes events
src/main/java/by/may/application/service/ReviewService.java - Authentication → Event publisher: publishes events
src/main/java/by/may/application/service/AuthService.java - Product management → History repository port: persists history
src/main/java/by/may/application/service/ProductService.java - Event publisher → Spring event adapter: implemented by
- Spring event adapter → Event handlers: dispatches events
- Authentication → JWT security: creates tokens
src/main/java/by/may/application/service/AuthService.java - Product repository port → PostgreSQL: persists through
- Category repository port → PostgreSQL: persists through
- User repository port → PostgreSQL: persists through
- Review repository port → PostgreSQL: persists through
- History repository port → PostgreSQL: persists through