How lekhrocks/ecommerce_be works
Project type and purpose
• This is a monolithic Spring Boot–based RESTful backend for an e-commerce application.
• Purpose: provide user authentication, product/catalog management, cart and wishlist handling, checkout (Stripe integration), and order processing via HTTP APIs.
File structure
• Top-level: standard Maven project (pom.xml, mvnw, .mvn, etc.).
• src/main/java/com/demo/ecommerce:
• config – application‐wide configuration (CORS, Swagger docs, message strings)
• controllers – REST controllers exposing API endpoints
• dto – data‐transfer objects (requests/responses) organized by feature (users, cart, checkout, product)
• model – JPA entities (User, Product, Cart, Order, etc.)
• repository – Spring Data JPA repositories
• service – business‐logic services
• exceptions – custom exceptions and a global exception handler
• common – shared response wrapper (ApiResponse)
• src/main/resources/application.properties holds DB, Stripe keys, Swagger settings, etc.
Detailed callouts
• Authentication flow: show SignUp/SignIn → AuthenticationService → TokenRepository → DB
• Cart flow: AddToCartDto → CartController → CartService → CartRepository
• Checkout flow: CheckoutItemDto → OrderService → Stripe → OrderRepository
• Exception handling: illustrate ExceptionControllerAdvice intercepting thrown exceptions