How miusuario-steven/e-commerce-eagle-tech works
Project Type & Purpose
• This is a full-stack E-Commerce system built with Angular (frontend) and Spring Boot (backend).
• It follows a Hexagonal (Ports & Adapters) architecture on the backend, and a modular component-service pattern on the frontend.
• Key business capabilities: user registration/authentication (JWT + roles), product browsing & cart management, PayPal checkout, order history, admin CRUD for products/categories.
File Structure Analysis
• Top-level:
• backend/ → Java/Spring Boot service with pom.xml, src/main/java, src/main/resources, src/test
• frontend/ → Angular application with src/app components, services, interceptors, routing
• Backend layers under src/main/java/com/eagletech/ecommerce/backend:
• domain/port & model → core business interfaces and entities
• application/ → service classes implementing use cases (CategoryService, OrderService, etc.)
• infrastructure/ → adapters (Spring Data JPA repos), REST controllers, DTOs, mappers (MapStruct), security (JWT filters & configs), PayPal integration
• frontend/src/app:
• components/ – UI components (authentication, product list, cart, orders, admin panels)
• services/ – HTTP services wrapping REST API calls
• common/ – shared model interfaces & types
• guards & interceptors – JWT auth guard, HTTP interceptor
Extracted Architectural Insights from README
• Hexagonal architecture with clear separation:
• Domain (entities & ports)
• Application (business logic)
• Infrastructure (adapters, controllers, persistence)
• Angular standalone components for fast load, Tailwind CSS for styling
• Spring Security + JWT for auth, PayPal SDK for payments, PostgreSQL for persistence
Main Components
a. Frontend Layer (Angular App)
• UI Components & Routes
• HTTP Services (CategoryService, ProductService, AuthService, etc.)
• Auth Interceptor & Auth Guard
b. Backend Layer (Spring Boot API)
• REST Controllers (CategoryController, ProductController, OrderController, PaypalController, Auth Controllers)
• Application Services (use-case orchestrators)
• Domain Ports (ICategoryRepository, IOrderRepository, etc.) & Models (Product, Order, User, etc.)
• Infrastructure Adapters:
– JPA Repositories (CategoryCrudRepositoryImpl, etc.) → PostgreSQL
– MapStruct Mappers
– JWT Generator, Validator, Filters → Spring Security
– PayPal SDK Integration Service
c. Database
• PostgreSQL schema reflecting entities: users, products, categories, orders, order_products
d. External Services
• PayPal API
Component Relationships & Data Flow
• User Browser → Angular UI → HTTP Request (with JWT) → REST Controllers
• Controller → maps DTO → calls Application Service → invokes Domain Port
• Domain Port → Infrastructure Adapter → JPA Repository → PostgreSQL
• For payments: Application Service → PayPalService → PayPal API → returns payment URL/confirmation
• JWT Generation on login/registration → issued to client → sent on subsequent requests → validated by JWTFilter → security context
Architectural Patterns & Design Principles
• Hexagonal Architecture (Ports & Adapters) on backend for testability and separation of concerns
• Layered MVC within the hexagon: Controllers (inbound), Services (use-cases), Domain (business rules), Adapters (outbound)
• Dependency Inversion: business logic depends on interfaces (ports), implemented by infrastructure
• Angular Modular Components + Services + Interceptors for clear UI-to-API separation
Essential Details to Capture
• Authentication flow (JWT issuance & validation)
• PayPal integration path
• Separation of concerns (which class lives in which hexagon segment)
• Angular routing & guard protecting admin vs. user paths
• Data transformation via DTOs & Mappers