How matheus-castro-paula/trilha-backend-matheuscastro-2026-01 works
This is an Express REST API for a product catalog. Users register or log in, then browse products and—when authenticated—create and manage reviews; admins manage products and users. Authentication also supports password recovery by email, and product writes can upload images to Cloudinary. The graph follows the documented route/controller structure and sampled controller calls; several capabilities are documented but their implementation files were not sampled, so links to those integrations reflect README evidence.
Main entry points: models/index.js Sequelize models · index.js Express server · productRoutes.js Product routes · userRoutes.js User routes
Components 20
API routing
- Express server
index.js - Auth routes
routes/authRoutes.js - User routes
routes/userRoutes.js - Product routes
routes/productRoutes.js - Review routes
routes/reviewRoutes.js
Identity and access
- Authentication
controllers/authController.js - User management
controllers/userController.js - JWT verification
middlewares/authMiddleware.js - Admin authorization
middlewares/isAdmin.js
Catalog and reviews
- Product catalog
controllers/productController.js - Review management
controllers/reviewController.js - Image upload
middlewares/uploadMiddleware.js
Persistence
- Sequelize models
models/index.js - User records
models/user.js - Product records
models/product.js - Review records
models/review.js
Other components
- API client
- MySQL database
- Mailtrap SMTP
- Cloudinary
Connections 25
- API client → Express server: sends HTTP
- Express server → Auth routes: dispatches
- Express server → User routes: dispatches
- Express server → Product routes: dispatches
- Express server → Review routes: dispatches
- Auth routes → Authentication: dispatches
- User routes → User management: dispatches
- Product routes → Product catalog: dispatches
- Review routes → Review management: dispatches
- User routes → JWT verification: guards
- User routes → Admin authorization: guards
- Product routes → JWT verification: guards
- Product routes → Admin authorization: guards
- Product routes → Image upload: processes uploads
- Review routes → JWT verification: guards
- Authentication → Sequelize models: queries users
- User management → Sequelize models: queries users
- Product catalog → Sequelize models: queries products
- Review management → Sequelize models: queries reviews
- Sequelize models → User records: loads model
- Sequelize models → Product records: loads model
- Sequelize models → Review records: loads model
- Sequelize models → MySQL database: persists records
- Authentication → Mailtrap SMTP: sends recovery email
- Image upload → Cloudinary: uploads images