How yashh-ops/offduty works
OFFDUTY is a three-application commerce product: a customer storefront, a separate admin console, and an Express/Mongoose API. Customers browse and filter clothing, manage carts and wishlists, authenticate, and proceed through checkout; staff manage catalog, orders, and other store operations. The README identifies campaign merchandising, clothing metadata, and gender/fit filtering, while noting that variant-level checkout and live integrations are not verified. Some backend route and page implementations were not sampled, so the graph omits uncertain links rather than inferring them.
Main entry points: App.jsx Storefront app · server.js REST API server · productController.js Catalog and filtering · orderController.js Orders and checkout
Components 29
Customer storefront
- Storefront app
frontend/src/App.jsx - Browse catalog
frontend/src/pages/Shop.jsx - Product detail
frontend/src/pages/Product.jsx - Cart state
frontend/src/context/CartContext.jsx - Cart and checkout
frontend/src/pages/Cart.jsx - Customer account
frontend/src/context/AuthContext.jsx - Wishlist
frontend/src/context/WishlistContext.jsx - Product API client
frontend/src/services/productService.js - Order API client
frontend/src/services/orderService.js
Store administration
- Admin console
admin/src/App.jsx - Staff authentication
admin/src/context/AuthContext.jsx - Catalog management
admin/src/pages/ProductForm.jsx - Admin API client
admin/src/lib/api.js
Commerce API
- REST API server
backend/server.js - Product routes
backend/src/routes/productRoutes.js - Catalog and filtering
backend/src/controllers/productController.js - Orders and checkout
backend/src/controllers/orderController.js - User operations
backend/src/controllers/userController.js - Wishlist operations
backend/src/routes/wishlistRoutes.js
Persistence and media
- Product records
backend/src/models/Product.js - Order records
backend/src/models/Order.js - User records
backend/src/models/User.js - Collections
backend/src/models/Collection.js - Image upload helper
backend/src/utils/uploadImage.js - MongoDB
External services
- Shiprocket
- Razorpay
Other components
- Shopper
- Store staff
Connections 32
- Shopper → Storefront app: uses
frontend/src/App.jsx - Storefront app → Browse catalog: routes to
frontend/src/App.jsx - Storefront app → Product detail: routes to
frontend/src/App.jsx - Storefront app → Cart and checkout: routes to
frontend/src/App.jsx - Storefront app → Customer account: provides
frontend/src/App.jsx - Storefront app → Cart state: provides
frontend/src/App.jsx - Storefront app → Wishlist: provides
frontend/src/App.jsx - Browse catalog → Product API client: fetches products
frontend/src/services/productService.js - Product detail → Product API client: fetches products
frontend/src/services/productService.js - Cart and checkout → Cart state: uses cart
frontend/src/App.jsx - Cart and checkout → Order API client: submits orders
frontend/src/services/orderService.js - Store staff → Admin console: uses
admin/src/App.jsx - Admin console → Staff authentication: provides
admin/src/App.jsx - Admin console → Catalog management: routes to
admin/src/App.jsx - Staff authentication → Admin API client: calls
admin/src/context/AuthContext.jsx - Catalog management → Admin API client: calls
admin/src/pages/ProductForm.jsx - REST API server → Product routes: mounts routes
backend/server.js - Product routes → Catalog and filtering: routes requests
backend/src/routes/productRoutes.js - Catalog and filtering → Product records: queries
backend/src/controllers/productController.js - Catalog and filtering → Collections: queries
backend/src/controllers/productController.js - Catalog and filtering → Image upload helper: uploads images
backend/src/controllers/productController.js - Orders and checkout → Product records: checks inventory
backend/src/controllers/orderController.js - Orders and checkout → Order records: creates orders
backend/src/controllers/orderController.js - Orders and checkout → Shiprocket: fulfills shipments
backend/src/controllers/orderController.js - Wishlist operations → User records: updates wishlist
backend/src/routes/wishlistRoutes.js - Wishlist operations → Product records: checks products
backend/src/routes/wishlistRoutes.js - User operations → User records: queries users
backend/src/controllers/userController.js - REST API server → MongoDB: connects database
README.md - REST API server → Razorpay: handles payments
README.md - Product API client → REST API server: calls API
README.md - Order API client → REST API server: calls API
README.md - Admin API client → REST API server: calls API
README.md