How hung1962003/backend works
Main Components
• Service Layer: Found under src/main/java/store/auroraauction/be/service. This layer implements business logic and coordinates between the API and repository layers. Mark out key services (e.g., AuctionService, BidService, CartService, JewelryService, etc.).
• Data Access Layer (Repositories): Located under src/main/java/store/auroraauction/be/repository. These components interact with the database (likely using Spring Data JPA) and include AuctionRepository, BidRepository, OrderRepository, etc.
• Domain Models/Entities: Under src/main/java/store/auroraauction/be/entity. These classes represent the persistent data like Account, Auction, Bid, Cart, Jewelry, Order, etc. They form the backbone of the database schema.
• Additional Components:
• Configuration: In the src/main/java/store/auroraauction/be/config folder lie important configuration classes for security (SercurityConfig), CORS, Firebase, Thymeleaf, and WebSocket.
• Exception Handling: The exception package manages error scenarios.
• Utilities: Helpers under the utils package (like AccountUtils).
• Various enums (domain statuses), which further support business logic.
• External Integrations: The project uses Firebase integration (firebase-admin.json, FirebaseConfig), email templates (under src/main/resources/templates), and the potential for WebSocket configuration. These indicate connections to third-party services.
Relationships and Data Flows
• From the Controllers (API Layer), illustrate calls to corresponding Service Layer components.
• Optionally, indicate external interactions (e.g., calls to Firebase for notifications/authentication, email services for sending notifications, or operations configured via WebSocket).
Architectural Patterns/Design Principles
• Use of Dependency Injection: Although not drawn explicitly, mention that Spring handles wiring of API -> Service -> Repository.
• Configuration and External Integrations: Emphasize that this backend leverages Spring’s configuration capabilities to manage cross-cutting concerns like security, CORS, and integration with Firebase.
• Separation of Concerns: Each package (Models, API, Service, Repository) is separated by responsibility, enhancing testability and maintainability.
Technical Stack Details
• Language/Framework: Java with Spring Boot.
• Build Tool: Maven (see pom.xml, and Maven wrapper files).
• Database: While not explicitly configured here, the presence of repositories and entity classes implies a relational database.
• External Services: Firebase (for authentication or notifications), Email service (using Thymeleaf templates).
• Other Libraries: JPA/Hibernate for ORM, Spring Security for authentication/authorization, and possibly WebSocket for real-time features.
• Clients (Web/Mobile coming from the front end)
• API Controllers (in the API package)
• Service Components (business logic layer)
• Repositories (data access layer)
• Database (the persistence layer)
• Configurations/Integrations (Firebase, Email, WebSocket)
• From Client → API Layer (HTTP requests)
• API Layer → Service Layer (logic processing)
• Service Layer → Repository Layer (data operations)
• Repository Layer → Database (CRUD operations)