How raiyan12999/estore works
Project type and purpose
• This is a monolithic Spring Boot “eStore” RESTful backend for managing an online store’s products, categories, suppliers, and detailed relationships. It exposes HTTP endpoints, uses JPA/Hibernate for persistence in MySQL, and applies an AOP-based logging aspect.
File structure
• Top-level: Maven project with pom.xml.
• src/main/java/com/webApp/eStore:
• controller/* – REST controllers (HomeController, LoginController, ProductController, CategoryController, ProductDetailsController)
• service/* – business logic (ProductService, CategoryService, ProductDetailsService)
• repository/* – Spring Data JPA repos (ProductRepo, CategoryRepo, ProductDetailsRepo)
• model/* – JPA entities (Product, Category, Supplier, ProductDetails)
• aspect/LogginAspect.java – AOP logging
• EStoreApplication.java – Spring Boot entry point
• src/main/resources: application.properties, data.sql (schema/data seeding)
• Standard test suite under src/test/java.
Key insights from README
• Layered architecture: Controllers → Services → Repositories → MySQL
• Uses entity relationships (One-to-Many, Many-to-Many, One-to-One)
• AOP for logging service calls
• Cross-origin enabled, Jackson for JSON, SLF4J for logs
a. Main components:
1) External Clients (Browser, Postman, Mobile App)
3) Spring Boot Application
– Presentation Layer: REST Controllers
– Business Layer: Services
– Persistence Layer: Repositories
– Cross-cutting Concern: Logging Aspect
4) MySQL Database
5) Static Resources (if serving any via Spring MVC) or External Auth Service for /login
b. Relationships & interactions:
• Clients send HTTP(S) requests to controllers (e.g., GET /api/products)
• Controllers delegate to corresponding Service methods
• Service methods apply business rules, call Repository interfaces
• Repositories translate method calls to SQL via Hibernate, interact with MySQL
• Data flows back up: MySQL → Repo → Service → Controller → JSON response to client
• AOP Aspect intercepts Service calls for logging both requests and responses
c. Architectural patterns & design principles:
• Layered (Controller-Service-Repository)
• MVC-ish for REST (no UI templates, JSON only)
• Dependency Injection via Spring’s @Autowired/@Service/@Repository
• Aspect-Oriented Programming for logging cross-cutting concerns
• JPA/Hibernate for ORM, with lazy/eager fetching and cascade rules
d. Key technologies/frameworks:
• Spring Boot (Web, Data JPA, AOP)
• Maven build (pom.xml)
• MySQL (runtime) + Hibernate
• Jackson (JSON serialization)
• SLF4J (logging)
Detail without over-compartmentalizing
• Every layer (presentation, business, persistence)
• Cross-cutting concerns (AOP logging)
• External dependencies (MySQL) and major frameworks (Spring Boot, Hibernate, Jackson)
• Don’t split into microservices unless that’s a future goal—focus on the existing monolith