How pablosazycz/comercio works
Comercio is an Express/MongoDB commerce application. Its main customer workflow is browsing products, adding them to a cart, checking out, and creating and viewing orders. Separate branches cover account access, product and category administration, REST APIs, and real-time chat/operator support. The sampled files show the app mounting routes, several controllers calling models, and payment processing creating an order; unsampled route wiring and other controller behavior are represented only where the README or source index supports them.
Main entry points: routes Web routes · app.js Express app · socket.js Socket service · pedidoController.js Order processing
Components 23
Web entry
- Express app
app.js - Web routes
routes - API routes
routes
Commerce workflow
- Cart operations
controllers/carroController.js - Carts
models/Carro.js - Order processing
controllers/pedidoController.js - Orders
models/Pedido.js
Catalog management
- Product catalog
controllers/productoController.js - Category management
controllers/categoriaController.js - Products
models/Producto.js - Categories
models/Categoria.js
Identity and APIs
- Account access
controllers/authController.js - Users
models/Usuario.js - Role checks
middlewares/auth.js - Product API
controllers/apiProductoController.js - Category API
controllers/apiCategoriaController.js
Chat support
- Chat routes
routes/chat.js - Chat service
config/chatbot.js - Socket service
config/socket.js - Chat client
public/js/chat.js - Operator client
public/js/operator.js
Other components
- Customer
- Operator
Connections 29
- Customer → Express app: sends requests
app.js - Express app → Web routes: mounts
app.js - Express app → API routes: mounts
app.js - Web routes → Account access: routes to
routes/auth.js - Account access → Users: reads and writes
controllers/authController.js - Web routes → Role checks: protects routes
routes/carro.js - Web routes → Product catalog: routes to
routes/producto.js - Product catalog → Products: reads and writes
controllers/productoController.js - Product catalog → Categories: reads
controllers/productoController.js - Web routes → Category management: routes to
routes/categoria.js - Category management → Categories: reads and writes
controllers/categoriaController.js - Category management → Products: reads
controllers/categoriaController.js - API routes → Product API: routes to
routes/apiProducto.js - Product API → Products: reads and writes
controllers/apiProductoController.js - API routes → Category API: routes to
routes/apiCategoria.js - Category API → Categories: reads and writes
controllers/apiCategoriaController.js - Web routes → Cart operations: routes to
routes/carro.js - Cart operations → Carts: reads and writes
controllers/carroController.js - Web routes → Order processing: routes to
routes/pedido.js - Order processing → Carts: reads and updates
controllers/pedidoController.js - Order processing → Orders: creates
controllers/pedidoController.js - Web routes → Chat routes: mounts
app.js - Chat routes → Chat service: uses
routes/chat.js - Express app → Socket service: configures
app.js - Socket service → Chat service: uses
config/socket.js - Customer → Chat client: uses
- Operator → Operator client: uses
- Chat client → Socket service: exchanges messages
- Operator client → Socket service: exchanges messages