How nguyennhat99/computerdeviceshopping works
Project type and purpose
• Full-stack web application: public storefront + admin (private) portal
• Built on ASP.NET Core MVC, EF Core, SQL Server, Razor Views, with payment/email integrations
File structure
• Presentation layer:
• Controllers/ (public site controllers)
• Areas/PrivateSite/Controllers/ (admin controllers)
• Views/ and Areas/PrivateSite/Views/ (Razor view files)
• ViewComponents/, DTOs/, ViewModel/
• wwwroot/ (static assets: JS, CSS, images, lib)
• Business-logic & services:
• Services/ShoppingCartService.cs, UserLoggedService.cs, VnPayService.cs
• Common/ (authentication, email sender, helpers, CommentHub.cs for SignalR)
• Data-access layer:
• Models/ComputerDeviceDataContext.cs (DbContext) + entity classes
• Config & startup:
• Program.cs, appsettings*.json, Properties/launchSettings.json
README for technical stack & external services
• ASP.NET Core MVC, SignalR, Session & Cookie Auth
• EF Core + SQL Server
• MailKit (EmailSender)
• VNPay Payment Gateway integration via VnPayLibrary.cs
1. Browser → Kestrel web server (HTTP/S requests)
2. Web server → Controller (public or admin)
3. Controller → Services or directly → DbContext
4. Services → DbContext → SQL Server
5. Services → External (SMTP, VNPay API)
6. SignalR: Controller → CommentHub → Browser clients
7. Static requests: Browser → wwwroot (served by web server)
Architectural patterns & design principles
• MVC (separate Models, Views, Controllers)
• Layered architecture (Presentation → BLL → DAL → Data/External)
• Dependency Injection for services & DbContext
• Area-based segregation for public vs. admin portals
• DTOs/ViewModels for data transfer to views
• SignalR for real-time updates (hub in Common/CommentHub.cs)
Final checklist
• All major folders/files represented as logical components
• Public vs. Admin separation clearly shown
• Data flows (HTTP, DB calls, external API calls, SignalR messages)
• Authentication & authorization modules
• Static content delivery path (wwwroot)
• External integrations (Email, Payment)