How thuanthichlaptrinh/websitenongsan_mvc works
Project type and purpose
• This is a full-stack, monolithic ASP.NET MVC e-commerce website for buying and selling agricultural products (“WebsiteNongSan”).
• It targets two user personas: public shoppers (user area) and administrators (Admin area).
File structure
• Top-level solution and project files:
• WebsiteNongSan.sln, WebsiteNongSan.csproj
• Global.asax, RouteConfig.cs – ASP.NET MVC entry point and routing
• packages.config – NuGet dependencies (Entity Framework, jQuery, etc.)
• MVC directories:
• Controllers (NguoiDungController, SanPhamController, DatHangController, etc.)
• Views (Areas/Admin/Views for admin UI; Views/Shared and Views/{Feature} for user UI)
• Models (Entity Framework EDMX model in Model1.edmx, entity classes, context)
• Static assets:
• Content/Assets (CSS, JS, images) + Bootstrap5 folder
• Scripts (jQuery, validation)
• plugin/ckeditor and plugin/ckfinder – WYSIWYG editor and file manager
• Admin Area: Uses Areas/Admin to separate admin controllers, views, and static assets.
Confirm technical stack and architecture from README
• ASP.NET MVC on .NET Framework
• Entity Framework (Database-first using .edmx)
• SQL Server backend
• Frontend libraries: Bootstrap 5, jQuery, CKEditor, CKFinder
a. Main components to represent
• Client browser (User UI vs Admin UI)
• Web Server – ASP.NET MVC Application
• MVC Layers:
– Controllers (route incoming HTTP to actions)
– Views (Razor .cshtml templates for HTML)
– Models / Data Access (EF DbContext and entity classes)
• SQL Server Database
• File storage for uploads (served via CKFinder)
• Third-party libraries (CKEditor plugin, CKFinder connector)
• Static asset server (serving CSS, JS, images)
b. Relationships and interactions
• User/Admin browser issues HTTP requests → Web Server
• Routing engine (Global.asax/RouteConfig) → appropriate Controller/Area
• Controller calls EF DbContext → fetch/update data in SQL Server
• Controller returns a View (.cshtml) populated with Model data
• Client loads static assets (CSS, JS) and editor plugins (CKEditor)
• For file uploads, CKEditor calls CKFinder connector → writes to server file system
• Admin controllers under Areas/Admin namespace handle management workflows
c. Architectural patterns and design principles
• MVC pattern to separate concerns
• Area segregation for Admin vs User modules
• Database-first Entity Framework for data layer
• Layered architecture: Presentation (Views + static assets), Application (Controllers + routing), Data (EF + SQL Server)
d. Key technologies and libraries
• .NET Framework / ASP.NET MVC
• Entity Framework (EDMX + DbContext)
• SQL Server
• Bootstrap 5, jQuery
• CKEditor, CKFinder (with ASPX connector)
Detail
• Both user and admin features as separate modules.
• EF EDMX model as part of the data access layer.
• Don’t shy away from labeling every major folder or service – more granularity helps stakeholders understand responsibilities.