How maito17/miinventarioexpress works
MiInventarioExpress is an Express inventory web app with account sessions, MongoDB-backed users and products, image uploads, and a signed-in chat. The main workflow is browser login or registration, authenticated product listing and editing, then server-rendered responses; authenticated users can also open the chat and exchange Socket.IO messages. The excerpts show route-to-model and server-to-route wiring. The chat page’s client-side Socket.IO implementation is not shown, so that UI connection is omitted.
Main entry points: app.js Express server · authRoutes.js Authentication routes · productRoutes.js Product routes · chatRoutes.js Chat route
Components 16
Web server
- Express server
app.js - Session middleware
app.js
Accounts
- Authentication routes
routes/authRoutes.js - Authentication guard
middleware/authMiddleware.js - User model
models/User.js - Account views
views/auth
Inventory
- Product routes
routes/productRoutes.js - Product model
models/Product.js - Image upload
config/multer.js - Uploaded images
uploads - Product views
views/products
Live chat
- Chat route
routes/chatRoutes.js - Chat view
views/chat.hbs - Socket.IO chat
app.js
Other components
- Browser user
- MongoDB
Connections 17
- Browser user → Express server: sends requests
- Express server → Session middleware: configures
app.js - Express server → Authentication routes: mounts routes
app.js - Express server → Authentication guard: protects routes
app.js - Express server → Product routes: mounts routes
app.js - Express server → Chat route: mounts routes
app.js - Express server → MongoDB: connects to
app.js - Authentication routes → Session middleware: reads and writes
routes/authRoutes.js - Authentication routes → User model: queries and saves
routes/authRoutes.js - Authentication routes → Account views: renders
routes/authRoutes.js - Product routes → Product model: queries and updates
routes/productRoutes.js - Product routes → Image upload: uses
routes/productRoutes.js - Image upload → Uploaded images: stores images
config/multer.js - Product routes → Product views: renders
routes/productRoutes.js - Chat route → Authentication guard: checks session
routes/chatRoutes.js - Chat route → Chat view: renders
routes/chatRoutes.js - Browser user → Socket.IO chat: exchanges messages
app.js