# sghast/desarrollo-web architecture

> Architecture diagram of the GitHub repository sghast/desarrollo-web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sghast/desarrollo-web
- Repository: https://github.com/sghast/desarrollo-web

## Overview

Este árbol reúne varias aplicaciones independientes: gestión de productos, un sistema MVC de productos y ventas, autenticación de SmartVET y un carrito de compra de navegador. El flujo MVC conecta la interfaz con la API de productos; SmartVET expone registro e inicio de sesión; ventas-dom consulta un catálogo externo y calcula una compra simulada. Se incluyen también los otros dos backends del árbol, aunque sus capacidades internas no pueden precisarse con los extractos disponibles. Las relaciones no verificables se omiten.

Main entry points: [`ventas-dom/src/main.js`](https://github.com/sghast/desarrollo-web/blob/master/ventas-dom/src/main.js) (Interfaz compra), [`sistema-ventas-mvc/frontend/src/App.jsx`](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/frontend/src/App.jsx) (Interfaz productos), [`smart-vet/backend/src/controllers/authController.js`](https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/controllers/authController.js) (Autenticación), [`smart-vet/backend/server.js`](https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/server.js) (Servidor SmartVET)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_productos["Gestión de productos"]
  node_crud_productos["CRUD productos<br/>[app.js]"]
  node_api_productos["API productos<br/>[server.js]"]
end

subgraph group_mvc["Sistema ventas MVC"]
  node_mvc_ui["Interfaz productos<br/>[App.jsx]"]
  node_formulario["Formulario producto"]
  node_tarjeta["Tarjeta producto<br/>[ProductoCard.jsx]"]
  node_producto_service["Servicio productos<br/>[productoService.js]"]
  node_api_app["Aplicación API<br/>[app.js]"]
  node_producto_routes["Rutas producto<br/>[productoRoutes.js]"]
  node_producto_controller["Controlador producto"]
  node_producto_model["Modelo producto<br/>[productoModel.js]"]
  node_ventas_routes["Rutas ventas<br/>[ventaRoutes.js]"]
  node_ventas_controller["Controlador ventas<br/>[ventaController.js]"]
  node_ventas_model["Modelo ventas<br/>[ventaModel.js]"]
  node_productos_data[("Datos productos<br/>[productos.json]")]
  node_ventas_data[("Datos ventas<br/>[ventas.json]")]
end

subgraph group_vet["SmartVET"]
  node_vet_server["Servidor SmartVET<br/>[server.js]"]
  node_vet_app["API SmartVET<br/>[app.js]"]
  node_auth_routes["Rutas autenticación<br/>[authRoutes.js]"]
  node_auth_controller["Autenticación<br/>[authController.js]"]
  node_user_model[("Modelo usuario<br/>[userModel.js]")]
  node_token["Generador token<br/>[generarToken.js]"]
  node_vet_db_config["Conexión base datos<br/>[database.js]"]
end

subgraph group_dom["Carrito de compra"]
  node_dom_main["Interfaz compra<br/>[main.js]"]
  node_catalogo_service["Consulta catálogo"]
  node_cart["Gestión carrito<br/>[carrito.js]"]
  node_calculos["Totales y descuento<br/>[calculos.js]"]
end

node_usuario_productos(("Usuario"))
node_vet_usuario(("Usuario SmartVET"))
node_vet_db[("MongoDB")]
node_comprador(("Comprador"))
node_catalogo_externo["Catálogo productos"]

node_mvc_ui -->|"consulta y registra"| node_producto_service
node_mvc_ui -->|"renderiza"| node_formulario
node_mvc_ui -->|"renderiza"| node_tarjeta
node_producto_service -->|"solicita por HTTP"| node_api_app
node_api_app -->|"monta rutas"| node_producto_routes
node_producto_routes -->|"despacha"| node_producto_controller
node_producto_controller -->|"consulta y modifica"| node_producto_model
node_vet_server -->|"conecta"| node_vet_db_config
node_vet_server -->|"inicia"| node_vet_app
node_vet_db_config -->|"conecta"| node_vet_db
node_vet_app -->|"monta rutas"| node_auth_routes
node_auth_routes -->|"despacha"| node_auth_controller
node_auth_controller -->|"registra y consulta"| node_user_model
node_auth_controller -->|"genera token"| node_token
node_comprador -.->|"interactúa"| node_dom_main
node_dom_main -->|"consulta catálogo"| node_catalogo_service
node_catalogo_service -->|"obtiene productos"| node_catalogo_externo
node_dom_main -->|"gestiona carrito"| node_cart
node_dom_main -->|"calcula importes"| node_calculos

click node_crud_productos "https://github.com/sghast/desarrollo-web/blob/master/crud-productos/app.js"
click node_api_productos "https://github.com/sghast/desarrollo-web/blob/master/sistema-productos/backend/server.js"
click node_mvc_ui "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/frontend/src/App.jsx"
click node_formulario "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/frontend/src/components/FormularioProducto.jsx"
click node_tarjeta "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/frontend/src/components/ProductoCard.jsx"
click node_producto_service "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/frontend/src/services/productoService.js"
click node_api_app "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/app.js"
click node_producto_routes "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/routes/productoRoutes.js"
click node_producto_controller "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/controllers/productoController.js"
click node_producto_model "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/models/productoModel.js"
click node_ventas_routes "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/routes/ventaRoutes.js"
click node_ventas_controller "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/controllers/ventaController.js"
click node_ventas_model "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/models/ventaModel.js"
click node_productos_data "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/data/productos.json"
click node_ventas_data "https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/data/ventas.json"
click node_vet_server "https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/server.js"
click node_vet_app "https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/app.js"
click node_auth_routes "https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/routes/authRoutes.js"
click node_auth_controller "https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/controllers/authController.js"
click node_user_model "https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/models/userModel.js"
click node_token "https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/utils/generarToken.js"
click node_vet_db_config "https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/config/database.js"
click node_dom_main "https://github.com/sghast/desarrollo-web/blob/master/ventas-dom/src/main.js"
click node_catalogo_service "https://github.com/sghast/desarrollo-web/blob/master/ventas-dom/src/productosService.js"
click node_cart "https://github.com/sghast/desarrollo-web/blob/master/ventas-dom/src/carrito.js"
click node_calculos "https://github.com/sghast/desarrollo-web/blob/master/ventas-dom/src/calculos.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_crud_productos,node_api_productos toneBlue
class node_mvc_ui,node_formulario,node_tarjeta,node_producto_service,node_api_app,node_producto_routes,node_producto_controller,node_producto_model,node_ventas_routes,node_ventas_controller,node_ventas_model,node_productos_data,node_ventas_data,node_vet_db toneAmber
class node_vet_server,node_vet_app,node_auth_routes,node_auth_controller,node_user_model,node_token,node_vet_db_config toneMint
class node_dom_main,node_catalogo_service,node_cart,node_calculos toneRose
class node_usuario_productos,node_vet_usuario,node_comprador,node_catalogo_externo toneIndigo
```

## Components

### Gestión de productos

- [CRUD productos](https://github.com/sghast/desarrollo-web/blob/master/crud-productos/app.js): `crud-productos/app.js`
- [API productos](https://github.com/sghast/desarrollo-web/blob/master/sistema-productos/backend/server.js): `sistema-productos/backend/server.js`

### Sistema ventas MVC

- [Interfaz productos](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/frontend/src/App.jsx): `sistema-ventas-mvc/frontend/src/App.jsx`
- [Formulario producto](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/frontend/src/components/FormularioProducto.jsx): `sistema-ventas-mvc/frontend/src/components/FormularioProducto.jsx`
- [Tarjeta producto](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/frontend/src/components/ProductoCard.jsx): `sistema-ventas-mvc/frontend/src/components/ProductoCard.jsx`
- [Servicio productos](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/frontend/src/services/productoService.js): `sistema-ventas-mvc/frontend/src/services/productoService.js`
- [Aplicación API](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/app.js): `sistema-ventas-mvc/backend/src/app.js`
- [Rutas producto](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/routes/productoRoutes.js): `sistema-ventas-mvc/backend/src/routes/productoRoutes.js`
- [Controlador producto](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/controllers/productoController.js): `sistema-ventas-mvc/backend/src/controllers/productoController.js`
- [Modelo producto](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/models/productoModel.js): `sistema-ventas-mvc/backend/src/models/productoModel.js`
- [Rutas ventas](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/routes/ventaRoutes.js): `sistema-ventas-mvc/backend/src/routes/ventaRoutes.js`
- [Controlador ventas](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/controllers/ventaController.js): `sistema-ventas-mvc/backend/src/controllers/ventaController.js`
- [Modelo ventas](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/models/ventaModel.js): `sistema-ventas-mvc/backend/src/models/ventaModel.js`
- [Datos productos](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/data/productos.json): `sistema-ventas-mvc/backend/src/data/productos.json`
- [Datos ventas](https://github.com/sghast/desarrollo-web/blob/master/sistema-ventas-mvc/backend/src/data/ventas.json): `sistema-ventas-mvc/backend/src/data/ventas.json`

### SmartVET

- [Servidor SmartVET](https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/server.js): `smart-vet/backend/server.js`
- [API SmartVET](https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/app.js): `smart-vet/backend/src/app.js`
- [Rutas autenticación](https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/routes/authRoutes.js): `smart-vet/backend/src/routes/authRoutes.js`
- [Autenticación](https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/controllers/authController.js): `smart-vet/backend/src/controllers/authController.js`
- [Modelo usuario](https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/models/userModel.js): `smart-vet/backend/src/models/userModel.js`
- [Generador token](https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/utils/generarToken.js): `smart-vet/backend/src/utils/generarToken.js`
- [Conexión base datos](https://github.com/sghast/desarrollo-web/blob/master/smart-vet/backend/src/config/database.js): `smart-vet/backend/src/config/database.js`

### Carrito de compra

- [Interfaz compra](https://github.com/sghast/desarrollo-web/blob/master/ventas-dom/src/main.js): `ventas-dom/src/main.js`
- [Consulta catálogo](https://github.com/sghast/desarrollo-web/blob/master/ventas-dom/src/productosService.js): `ventas-dom/src/productosService.js`
- [Gestión carrito](https://github.com/sghast/desarrollo-web/blob/master/ventas-dom/src/carrito.js): `ventas-dom/src/carrito.js`
- [Totales y descuento](https://github.com/sghast/desarrollo-web/blob/master/ventas-dom/src/calculos.js): `ventas-dom/src/calculos.js`

### Other components

- **Usuario**
- **Usuario SmartVET**
- **MongoDB**
- **Comprador**
- **Catálogo productos**

## Connections

- Interfaz productos → Servicio productos: consulta y registra (evidence: `sistema-ventas-mvc/frontend/src/App.jsx`)
- Interfaz productos → Formulario producto: renderiza (evidence: `sistema-ventas-mvc/frontend/src/App.jsx`)
- Interfaz productos → Tarjeta producto: renderiza (evidence: `sistema-ventas-mvc/frontend/src/App.jsx`)
- Servicio productos → Aplicación API: solicita por HTTP (evidence: `sistema-ventas-mvc/frontend/src/services/productoService.js`)
- Aplicación API → Rutas producto: monta rutas (evidence: `sistema-ventas-mvc/backend/src/app.js`)
- Rutas producto → Controlador producto: despacha (evidence: `sistema-ventas-mvc/backend/src/routes/productoRoutes.js`)
- Controlador producto → Modelo producto: consulta y modifica (evidence: `sistema-ventas-mvc/backend/src/controllers/productoController.js`)
- Servidor SmartVET → Conexión base datos: conecta (evidence: `smart-vet/backend/server.js`)
- Servidor SmartVET → API SmartVET: inicia (evidence: `smart-vet/backend/server.js`)
- Conexión base datos → MongoDB: conecta (evidence: `smart-vet/backend/src/config/database.js`)
- API SmartVET → Rutas autenticación: monta rutas (evidence: `smart-vet/backend/src/app.js`)
- Rutas autenticación → Autenticación: despacha (evidence: `smart-vet/backend/src/routes/authRoutes.js`)
- Autenticación → Modelo usuario: registra y consulta (evidence: `smart-vet/backend/src/controllers/authController.js`)
- Autenticación → Generador token: genera token (evidence: `smart-vet/backend/src/controllers/authController.js`)
- Comprador → Interfaz compra: interactúa
- Interfaz compra → Consulta catálogo: consulta catálogo (evidence: `ventas-dom/src/main.js`)
- Consulta catálogo → Catálogo productos: obtiene productos (evidence: `ventas-dom/src/productosService.js`)
- Interfaz compra → Gestión carrito: gestiona carrito (evidence: `ventas-dom/src/main.js`)
- Interfaz compra → Totales y descuento: calcula importes (evidence: `ventas-dom/src/main.js`)
