How paul-developer-stack/tarea-h6 works
This is a Spanish-language REST API for customer, contact, product, and contact-type management. The principal workflow is an HTTP client request entering the Express app, being dispatched to a resource route and controller, then reading or changing MySQL data and returning JSON. The sampled code shows those paths for customers, contacts, and products; the contact-type route queries the database directly. The README is empty, so capability coverage is based on the source index and sampled files; unsampled customer/product routes and product wiring are represented only where the source index confirms them.
Main entry points: app.js Express app · db.js MySQL pool · server.js HTTP server · clientes.routes.js Customer routes
Components 13
HTTP entry
- HTTP server
api/server.js - Express app
api/src/app.js
Resource APIs
- Customer routes
api/src/routes/clientes.routes.js - Customer operations
api/src/controllers/clientes.controller.js - Contact routes
api/src/routes/contactos.routes.js - Contact operations
api/src/controllers/contactos.controller.js - Product routes
api/src/routes/productos.routes.js - Product operations
api/src/controllers/productos.controller.js - Contact types
api/src/routes/tiposContacto.routes.js
Persistence
- MySQL pool
api/src/config/db.js - MySQL database
Error handling
- HTTP errors
api/src/middlewares/errorHandler.js
Other components
- API client
Connections 16
- API client → HTTP server: sends HTTP
- HTTP server → Express app: starts
api/server.js - API client → Express app: requests
- Express app → Customer routes: mounts route
api/src/app.js - Express app → Contact routes: mounts route
api/src/app.js - Express app → Product routes: mounts route
api/src/app.js - Express app → Contact types: mounts route
api/src/app.js - Customer routes → Customer operations: dispatches
api/src/routes/clientes.routes.js - Contact routes → Contact operations: dispatches
api/src/routes/contactos.routes.js - Product routes → Product operations: dispatches
api/src/routes/productos.routes.js - Customer operations → MySQL pool: queries
api/src/controllers/clientes.controller.js - Contact operations → MySQL pool: queries
api/src/controllers/contactos.controller.js - Product operations → MySQL pool: queries
api/src/controllers/productos.controller.js - Contact types → MySQL pool: queries
api/src/routes/tiposContacto.routes.js - MySQL pool → MySQL database: connects
- Express app → HTTP errors: registers handlers
api/src/app.js