How duong2402/swd works
Main Components
• Frontend (FigureShop_FE): An Angular application that serves both admin and client user interfaces. It contains separate modules for UI-Admin (handling product, category, order management among others) and UI-Client (covering cart, checkout, product display, and user interactions).
• API Layer (EShopWebAPI): An ASP.NET Core Web API project exposing RESTful endpoints. Controllers for authentication, cart, category, figures (products), orders, and users let the frontend interact with the backend.
• Application Layer (Application folder): Contains DTOs, mapping profiles for converting between domain and transfer objects, pagination helpers, and various business services (cart, image, order, product, user). This layer encapsulates the business logic and acts as the mediator between the API controllers and the domain layer.
• Domain Layer (Domain folder): Holds your core business entities (Cart, Product, Order, User, etc.), base entities, value objects (including enums for order status and stock status), and domain interfaces (like the generic repository and UnitOfWork definitions).
Out Relationships and Interactions
• API controllers in EShopWebAPI invoke methods in the Application layer. Represent these as calls from controllers (e.g., AuthController, CartController, etc.) to services in the Application folder.
• The Application layer uses DTOs to interact with the Domain layer’s Entities and passes data to/from the Infrastructure layer. Clearly mark these interactions.
• Infrastructure handles data persistence. The Application layer calls repository methods (through UnitOfWork) to query or update the database (as represented by the OnlineFigureShopDB.sql file).
• Additional services (like the ImageService) and configurations (e.g., JwtHelper) can be highlighted, showing any external or cross-cutting concerns like authentication or file handling.
Architectural Patterns
• Layered Architecture / Onion Architecture: Emphasize the separation of concerns between the Frontend, API, Application logic, Domain, and Infrastructure.
• Use of DTOs and Mapping Profiles: Show that there are mapping profiles which convert between Domain objects and DTOs, ensuring data encapsulation.
• Repository and Unit of Work Patterns in the Infrastructure layer: These provide abstraction over data persistence.
• Dependency Injection: Although not explicitly seen here, the separation suggests use of IoC containers to inject dependencies (services, repositories, etc.).
Relevant Technologies
• Frontend: Angular (with its routing, service layers, and component-based structure).
• Backend: ASP.NET Core with controllers, dependency injection, and configuration via appsettings.json.
• Persistence: Likely Entity Framework Core (given the presence of ApplicationDbContext and repository patterns) with a SQL database.
• Other Utilities: AutoMapper (implied by the MappingProfile), JWT for authentication (by examining the JwtHelper and AuthTokenOptions in Infrastructure).