How olivervinh/do-an-tot-nghiep works
Main Components
• Backend API Server: The “API” folder is an ASP.NET Core Web API project built in C#. It contains controllers for handling various business functions (accounts, authentication, blogs, carts, orders, notifications, etc.), along with data access via Entity Framework (see Data, DPContext, SeedData, and the presence of packages for EntityFramework) and helper functionalities including JWT-based authentication (JwtFactory, JwtIssuerOptions) and SignalR for real-time communications.
• Admin Application: The “AdminApp” directory is an Angular-based admin dashboard that likely provides functionalities for managing products, orders, users, and other administrative tasks.
• Client Application: The “ClientApp” directory is also an Angular project, serving as the customer-facing website for browsing products, checkout process, user account management, etc.
• Database: Although it is not visible as a separate service in the file tree, the SQL folder (with DoAnTotNghiep.sql) implies a relational database (probably SQL Server) used by the backend.
• Supporting Assets: There is a “Doc” folder (for documentation) and additional assets like images and configurations that support both the API (wwwroot) and the frontend clients.
Relationships and Data Flows
• SignalR “hubs” in the API (for example, BroadcastHub) suggest real-time data push (possibly for notifications or live updates), so indicate that as a subcomponent/process inside the backend.
• The API uses JWT authentication and middleware for error handling (ExceptionMiddleware) and validations, which should be noted as important design patterns inside the API component.
Architectural Patterns and Technologies
• MVC Pattern: The API leverages Controllers and Views (for PDF generation using cshtml views) in an MVC style, even if it’s a REST API.
• Separation of Concerns: Distinct projects for Admin and Client front-ends, implying clear separation of responsibilities and UI roles.
• Technology Stack:
– Backend: C#, ASP.NET Core, Entity Framework, SignalR, JWT.
– Frontend: Angular (two separate apps), with Angular’s routing modules, components, services, and assets.
– Database: Likely SQL Server (with connection settings defined in appsettings.json files and the SQL scripts provided).
• The use of DTOs (Data Transfer Objects) in the API suggests a layered design to isolate the business models from how data is exchanged with clients.