How rocioglopez/socios_ventas works
This repository contains two related implementations of the same purchasing-management domain, plus some shared data artifacts. The main architectural split is between a .NET MVC application in Sprint-1/Sprint 1 and a smaller Flask/Vue application in ERPCompras.
The Sprint-1/Sprint 1 project is the most complete backend-centric system. It is an ASP.NET Core 8 MVC app with server-rendered Razor views, controller-driven routing, EF Core data access, and a relational database schema managed through migrations. Program.cs, AppDbContext.cs, and the migration history show the classic layered MVC structure: controllers orchestrate use cases, models/view models shape data, and views render HTML responses.
Its core business modules are separated by controller and view area: Account for authentication and profile flows, Solicitudes for purchase requests and approval workflows, Ordenes for purchase orders, Inventario for stock control, Proveedores for supplier evaluation/history, Reportes for cost analytics, Historial for purchase history, Contratos for contract tracking, and Bitacora for audit logging. This is the main functional boundary map for the application.
The persistence layer in Sprint-1 is relational and migration-based. The Models folder defines the domain entities and view models such as SolicitudCompra, OrdenCompra, InventarioProducto, Proveedor, EvaluacionProveedor, NotificacionCompra, AlertaInventario, and Bitacora. EF Core migrations indicate schema evolution for inventory history, received orders, cost analysis, inventory replenishment seed data, and audit trail support.
There is a small service layer in Sprint-1, centered on BitacoraService. That suggests cross-cutting logging/audit behavior is abstracted away from controllers, while most other business logic still appears to live close to the MVC boundary. Views/Shared/_Layout.cshtml and the static assets under wwwroot provide the UI shell, Bootstrap styling, jQuery validation, and client-side scripts.
The ERPCompras folder is a separate Flask-based implementation with a different architectural style. Backend/app.py is the backend entry point, templates/ contains Jinja-rendered pages for login, dashboard, register, password recovery, and profile, and static/js/mensajes.js holds browser-side behavior. This side of the repo is much more file-backed and lightweight than the .NET app.
In ERPCompras, application state is stored in JSON files under data/ rather than in a relational database. The named files map directly to business entities: users.json, solicitudes_compra.json, inventario.json, alertas_inventario.json, and notificaciones.json. That means the backend likely reads and writes these files directly to persist users, requests, inventory, alerts, and notifications.
ERPCompras/frontend is a separate Vue 3 + Vite client. Its src/App.vue, main.js, and components like Inventario.vue and Historial.vue show a component-based frontend for selected modules rather than the whole system. This frontend likely consumes the Flask backend or shared JSON-driven endpoints and complements the server-rendered Flask templates.
Session handling is explicit in the Flask side: the flask_session directory indicates server-side session storage rather than purely cookie-based state. That matters architecturally because authentication and login state are persisted on the server filesystem, not just in the browser.
The most important data flow in both implementations is the same business pipeline: users authenticate, create purchase requests, approvals generate purchase orders, received orders update inventory, and low stock produces alerts/notifications. Supplier evaluation and historical reporting sit alongside that pipeline as analytical and audit-oriented subsystems.
The repo also includes repository-level artifacts for runtime and scaffolding: Bootstrap/jQuery assets in the .NET app, Vue/Vite tooling in the Flask frontend, and multiple technology stacks overall. For an architecture diagram, the cleanest representation is two parallel application stacks sharing the same purchasing domain but using different persistence and UI strategies: MVC + EF Core + relational DB on one side, Flask + JSON storage + Vue components on the other.
Main entry points: Program.cs Program · app.py Flask App · OrdenesController.cs Ordenes · InventarioController.cs Inventario
Components 23
.NET MVC app
ASP.NET Core 8 application with Razor views, controllers, EF Core, and migrations.
- Program · ASP.NET Core host and composition root.
Sprint-1/Sprint 1/Program.cs - Db Context · Relational persistence and model mapping.
Sprint-1/Sprint 1/Data/AppDbContext.cs - Account · Authentication and profile flows.
Sprint-1/Sprint 1/Controllers/AccountController.cs - Solicitudes · Purchase request workflow and approvals.
Sprint-1/Sprint 1/Controllers/SolicitudesController.cs - Ordenes · Purchase order handling.
Sprint-1/Sprint 1/Controllers/OrdenesController.cs - Inventario · Stock management and replenishment views.
Sprint-1/Sprint 1/Controllers/InventarioController.cs - Proveedores · Supplier history and evaluation.
Sprint-1/Sprint 1/Controllers/ProveedoresController.cs - Reportes · Cost analytics dashboard.
Sprint-1/Sprint 1/Controllers/ReportesController.cs - Bitacora · Audit trail access.
Sprint-1/Sprint 1/Controllers/BitacoraController.cs - Bitacora Service · Shared audit/logging behavior.
Sprint-1/Sprint 1/Services/BitacoraService.cs - Solicitud · Purchase request entity.
Sprint-1/Sprint 1/Models/SolicitudCompra.cs - Orden · Purchase order entity.
Sprint-1/Sprint 1/Models/OrdenCompra.cs - Inventario · Inventory product entity.
Sprint-1/Sprint 1/Models/InventarioProducto.cs - Proveedor · Supplier entity and evaluation subject.
Sprint-1/Sprint 1/Models/Proveedor.cs - Shared Layout · Common UI shell for server-rendered pages.
Sprint-1/Sprint 1/Views/Shared/_Layout.cshtml
Flask + Vue app
Flask backend with JSON persistence, server-rendered templates, and a Vue frontend.
- Flask App · Flask application entry point and routing layer.
ERPCompras/Backend/app.py - JSON Data · File-backed persistence for users, requests, inventory, alerts, and notifications.
ERPCompras/data - Templates · Server-rendered pages for login, dashboard, profile, and recovery.
ERPCompras/templates - Session Store · Filesystem-backed Flask session state.
ERPCompras/flask_session - Vue Entry · Vue 3 and Vite application entry.
ERPCompras/frontend/src/main.js - Inventario UI · Frontend inventory view.
ERPCompras/frontend/src/components/Inventario.vue - Historial UI · Frontend history view.
ERPCompras/frontend/src/components/Historial.vue - Mensajes JS · Client-side message and interaction helper.
ERPCompras/static/js/mensajes.js
Connections 20
- Program → Db Context: configures · Bootstraps EF Core persistence and application services.
- Program → Account: hosts · Registers MVC routing and controller execution.
- Program → Shared Layout: serves · Uses the shared Razor shell for rendered pages.
- Solicitudes → Solicitud: reads/writes · Handles purchase request data.
- Solicitudes → Ordenes: leads to · Approved requests become purchase orders.
- Ordenes → Orden: manages · Creates and tracks purchase orders.
- Ordenes → Inventario: updates · Received orders flow into inventory changes.
- Inventario → Inventario: manages · Reads and updates stock records.
- Proveedores → Proveedor: manages · Maintains supplier data and evaluations.
- Reportes → Db Context: queries · Builds analytics from persisted purchasing data.
- Bitacora → Bitacora Service: uses · Delegates audit behavior to the service layer.
- Bitacora Service → Db Context: persists · Stores audit entries in the relational database.
- Flask App → JSON Data: reads/writes · Uses JSON files as the main persistence layer.
- Flask App → Templates: renders · Serves Jinja pages for core user flows.
- Flask App → Session Store: stores · Keeps server-side session state on disk.
- Vue Entry → Inventario UI: imports · Bootstraps the inventory component.
- Vue Entry → Historial UI: imports · Bootstraps the history component.
- Mensajes JS → Templates: enhances · Adds browser-side behavior to template-driven pages.
- Templates → JSON Data: backed by · Template flows align with file-backed business state.
- Inventario → Bitacora: audits · Inventory changes can be logged to the audit trail.