How jdamour12/umurarashop-be works
UmuraraShop is an e-commerce API. Clients use the registered routes to manage accounts, browse products and categories, maintain a cart, and place or manage orders; authentication and admin checks protect applicable routes. Controllers coordinate persistence and side effects, including product-image uploads and email notifications. The graph preserves the documented category, product, cart, order, and account capabilities. Some router/controller and infrastructure details are unsampled, so only relationships supported by excerpts, the source index, or explicit API documentation are shown.
Main entry points: server.ts Express server · order.controller.ts Order lifecycle · emailService.ts Email delivery · product.router.ts Product routes
Components 27
API routing
- Express server
server/src/server.ts - Auth routes
server/src/routers/auth.router.ts - Category routes
server/src/routers/category.router.ts - Product routes
server/src/routers/product.router.ts - Cart routes
server/src/routers/cart.router.ts - Order routes
server/src/routers/order.router.ts
Accounts and access
- Account workflows
server/src/controllers/auth.controller.ts - Token verification
server/src/middlewares/auth.middleware.ts - Admin authorization
server/src/middlewares/isAdmin.middleware.ts - User records
server/src/models/User.ts
Shop operations
- Category management
server/src/controllers/category.controller.ts - Category records
server/src/models/Category.ts - Product management
server/src/controllers/product.controller.ts - Product records
server/src/models/Product.ts - Image upload parsing
server/src/middlewares/upload.middleware.ts - Cart management
server/src/controllers/cart.controller.ts - Cart records
server/src/models/Cart.ts - Order lifecycle
server/src/controllers/order.controller.ts - Order records
server/src/models/Order.ts
External services
- Image hosting config
server/src/config/cloudinary.ts - Cloudinary
- Email delivery
server/src/services/emailService.ts - Mail provider config
server/src/config/mail.ts - Welcome email template
server/src/templates/welcome.template.ts - Reset email template
server/src/templates/resetEmail.template.ts - Order email template
server/src/templates/orders.template.ts
Other components
- API client
Connections 37
- API client → Express server: sends API requests
server/src/server.ts - Express server → Auth routes: mounts routes
server/src/server.ts - Express server → Category routes: mounts routes
server/src/server.ts - Express server → Product routes: mounts routes
server/src/server.ts - Express server → Cart routes: mounts routes
server/src/server.ts - Express server → Order routes: mounts routes
server/src/server.ts - Auth routes → Account workflows: dispatches requests
server/src/routers/auth.router.ts - Category routes → Category management: dispatches requests
server/src/routers/category.router.ts - Product routes → Product management: dispatches requests
server/src/routers/product.router.ts - Cart routes → Cart management: dispatches requests
server/src/routers/cart.router.ts - Order routes → Order lifecycle: dispatches requests
server/src/routers/order.router.ts - Category routes → Token verification: checks tokens
server/src/routers/category.router.ts - Product routes → Token verification: checks tokens
server/src/routers/product.router.ts - Cart routes → Token verification: checks tokens
server/src/routers/cart.router.ts - Order routes → Token verification: checks tokens
server/src/routers/order.router.ts - Category routes → Admin authorization: checks admin role
server/src/routers/category.router.ts - Product routes → Admin authorization: checks admin role
server/src/routers/product.router.ts - Order routes → Admin authorization: checks admin role
server/src/routers/order.router.ts - Account workflows → User records: reads and writes
server/src/controllers/auth.controller.ts - Order lifecycle → User records: reads user
server/src/controllers/order.controller.ts - Category management → Category records: manages records
server/src/controllers/category.controller.ts - Product management → Product records: manages records
server/src/controllers/product.controller.ts - Product management → Category records: validates category
server/src/controllers/product.controller.ts - Cart management → Cart records: manages cart
server/src/controllers/cart.controller.ts - Cart management → Product records: looks up products
server/src/controllers/cart.controller.ts - Order lifecycle → Cart records: reads cart
server/src/controllers/order.controller.ts - Order lifecycle → Product records: checks and adjusts stock
server/src/controllers/order.controller.ts - Order lifecycle → Order records: creates and updates orders
server/src/controllers/order.controller.ts - Product routes → Image upload parsing: parses image
server/src/routers/product.router.ts - Product management → Image hosting config: uses image service
server/src/controllers/product.controller.ts - Image hosting config → Cloudinary: configures access
- Account workflows → Email delivery: sends account emails
server/src/controllers/auth.controller.ts - Order lifecycle → Email delivery: sends order email
server/src/controllers/order.controller.ts - Email delivery → Mail provider config: uses provider config
server/src/services/emailService.ts - Email delivery → Welcome email template: renders message
server/src/services/emailService.ts - Email delivery → Reset email template: renders message
server/src/services/emailService.ts - Email delivery → Order email template: renders message
server/src/services/emailService.ts