How lnlonggg/doan1_2025 works
Project type and purpose
• This is an ASP.NET Core MVC full-stack web application named QL_CuaHangDienThoai (Phone Store Management).
• Purpose: provide an online storefront for browsing products, managing carts and orders, handling user accounts, and integrating with an external payment gateway (VnPay).
File structure
• Controllers folder: MVC controllers (Account, Home, Shop, Cart, Checkout, Admin, etc.).
• Views folder: Razor views under feature subfolders (Account, Shop, Cart, Checkout, etc.) plus Shared layout.
• Models folder: domain and EF Core entity definitions (DatabaseModels.cs) and ViewModels for data transfer.
• Data folder: ApplicationDbContext (Entity Framework Core context).
• Migrations folder: EF Core migrations for database schema.
• Services folder: business logic and external-service wrappers (VnPayService, VnPayLibrary).
• Helpers folder: utility classes (e.g. ImageHelper).
• wwwroot: static assets (CSS, JS, images, client-side libs).
• Program.cs & appsettings.json: application entry point and configuration.
README
• Very minimal (“# DoAn1-master”). No additional architectural notes; we infer MVC + EF Core + external payment integration.
a. Main components
• Client (Browser/Mobile)
• ASP.NET Core Web Server (Kestrel + HTTP Pipeline)
• MVC Layers:
– Controllers (AccountController, ShopController, etc.)
– Services/Helpers (VnPayService, ImageHelper)
– Data Access (ApplicationDbContext, EF Core)
• Database (SQL Server or any configured RDBMS)
• External Payment Gateway (VnPay)
• Static Asset Server (wwwroot)
b. Relationships and interactions
• Client ↔ Web Server: HTTP/HTTPS requests and responses
• Controllers invoke Services and Data Access layers
• Services wrap business logic and call external VnPay APIs
• ApplicationDbContext interacts with the relational database via EF Core
• Migrations update database schema
• Static assets served directly from wwwroot
c. Architectural patterns and design principles
• MVC (Model-View-Controller) for clear separation of concerns
• Repository pattern implied via DbContext
• Dependency Injection for Services and DbContext
• Layered architecture: Presentation → Business Logic → Data Access
• External integration encapsulated in Service classes
d. Key technologies, frameworks, libraries
• ASP.NET Core MVC
• Entity Framework Core with Migrations
• Razor Views (server-side rendering)
• VnPayLibrary for payment integration
• Bootstrap, jQuery in wwwroot for UI styling and validation