How juliansuarez5/sistema_ventas_web works
Project Type and Purpose
• This is a full-stack e-commerce web application built on ASP.NET MVC (.NET Framework 4.7.2).
• It has two separate MVC frontends (Admin panel and Storefront), a layered backend (Entity, Business, Data), and integrates with SQL Server and PayPal REST API.
File Structure
• Top-Level Layers (N-Tier Architecture):
· CapaEntidad (Data Models/DTOs)
· CapaNegocio (Business Logic)
· CapaDatos (Data Access / CRUD)
• Presentation Projects (UI):
· CapaPresentacionAdmin (Admin MVC App – Controllers, Views, Client-side assets)
· CapaPresentacionTienda (Storefront MVC App – Controllers, Views, Client-side assets)
• Other artifacts:
· SQLQuery script for schema
· FotosCarrito folder (filesystem storage for product images)
· Solution file (.sln) and NuGet package configs
README Insights
• Layer responsibilities are explicitly documented (Entities, Business, Data, Presentation).
• Key external dependency: PayPal REST API for payment, SQL Server for persistence, ClosedXML for Excel export, jQuery/DataTables/SweetAlert/LoadingOverlay for UI.
Main Components
A. Presentation Layer
1. Admin UI (CapaPresentacionAdmin)
2. Store UI (CapaPresentacionTienda)
B. Business Layer (CapaNegocio)
C. Data Layer (CapaDatos)
D. Entity Layer (CapaEntidad)
E. Persistence
1. SQL Server Database (DB_CARRITO)
2. File system (FotosCarrito folder for images)
F. External Services
1. PayPal REST API
2. Excel export (ClosedXML)
Relationships & Interactions
• UI → Controllers → Business Layer → Data Layer → Database / File System
• Data Layer uses ADO.NET or similar to run SQL CRUD against SQL Server
• Entities flow up from Data Layer through Business Layer to Controllers, then to Views
• Storefront UI upon checkout invokes Business → PayPal service (via clsN_PayPal in CapaNegocio and cls_Checkout_Order in CapaEntidad/PayPal) → PayPal returns capture response → Business persists payment record via Data Layer → UI shows confirmation
• Admin UI can trigger Excel export: Business Layer uses ClosedXML to generate file
Architectural Patterns & Principles
• Layered (N-Tier) architecture with strict dependency direction (Presentation → Business → Data → Database)
• MVC pattern in each presentation project (Models = Entities/DTOs, Views = Razor .cshtml, Controllers)
• Separation of concerns:
· Business holds rules,
· Data holds persistence code,
· Presentation handles routing and UI
• Dependency injection can be highlighted if used (or at least show layers referencing only the next lower layer)
Essential Elements to Capture
• Two separate MVC frontends (Admin, Store) with Controllers→Views flow.
• Business layer as central orchestrator of rules, Excel export, payment logic.
• Data layer handling direct SQL CRUD.
• Entity layer as common model assembly.
• SQL Server database and file-system storage for product images.
• PayPal REST API integration flow.