How mohimas/zeynova works
Purpose and Deployable Units
This is a three-part e-commerce system: a customer storefront, an administrative console, and a Node.js API. The Vite React clients bootstrap at frontend/src/main.jsx and admin/src/main.jsx; the backend process starts at backend/server.js. Each deployable includes Vercel configuration (frontend/vercel.json, admin/vercel.json, backend/vercel.json).
Customer Storefront
The customer-facing React application routes through frontend/src/App.jsx and composes shopping, account, and support flows. Core commerce pages include product browsing/details (frontend/src/pages/Collection.jsx, frontend/src/pages/Product.jsx), cart and checkout (frontend/src/pages/Cart.jsx, frontend/src/pages/PlaceOrder.jsx), and order/account views (frontend/src/pages/Orders.jsx, frontend/src/pages/Profile.jsx). Reusable catalogue and recommendation presentation is concentrated in frontend/src/components/Productitem.jsx, frontend/src/components/RelatedProducts.jsx, and frontend/src/components/PersonalizedRecommendations.jsx.
Client State and Purchase Flow
frontend/src/context/ShopContext.jsx is the principal storefront state boundary, likely coordinating shared catalogue, cart, authentication, and API-facing state for pages/components. The primary customer flow is browse collection → inspect product → update cart → place/verify order, represented by frontend/src/pages/Collection.jsx, frontend/src/pages/Cart.jsx, and frontend/src/pages/Verify.jsx. Authentication and customer self-service are exposed through frontend/src/pages/Login.jsx, frontend/src/pages/UserDashboard.jsx, and frontend/src/pages/Wishlist.jsx.
API and Domain Layer
The Express backend separates HTTP routing, controller logic, and MongoDB persistence. Routes define the public/API boundary in backend/routes/productRoute.js, backend/routes/orderRoute.js, and backend/routes/userRoute.js; corresponding controllers implement product, order, cart, dashboard, and user operations in backend/controllers/productController.js, backend/controllers/orderController.js, and backend/controllers/cartController.js. Persistent domain records are modeled in backend/models/productModel.js, backend/models/orderModel.js, and backend/models/userModel.js, with dedicated inquiry and review records.
Identity, Roles, and Protected Operations
Authentication and authorization are middleware gates between API routes and controllers: backend/middleware/auth.js protects authenticated customer operations, while backend/middleware/adminAuth.js and backend/middleware/roleAuth.js distinguish administrative or role-restricted actions. This boundary supports separate customer and staff clients rather than embedding administrative capabilities in the storefront.
Administration and Operations
The admin React app is centered on operational management pages: admin/src/pages/Dashboard.jsx, admin/src/pages/List.jsx, and admin/src/pages/Orders.jsx, plus product creation/editing in admin/src/pages/Add.jsx and admin/src/pages/Edit.jsx. Its shell and login boundary are implemented by admin/src/App.jsx, admin/src/components/Sidebar.jsx, and admin/src/components/Login.jsx. Backend dashboard endpoints/controllers (backend/routes/dashboardRoute.js, backend/controllers/dashboardController.js) support administrative summary data.
Infrastructure and External Services
MongoDB is the primary persistence runtime, configured through backend/config/mongodb.js. Cloudinary is the media-storage integration, configured in backend/config/cloudinary.js; multipart upload handling is isolated in backend/middleware/multer.js, forming the upload boundary before product/media controller handling. The applications use JavaScript/React Vite clients and a Node.js backend, with Vercel deployment descriptors for all three units.
Main entry points: orderController.js Commerce Controllers · App.jsx Storefront Routes · productRoute.js Product, Order & User Routes · dashboardRoute.js Dashboard Routes
Components 20
Customer Storefront
Vite React shopping client.
- Storefront Bootstrap
frontend/src/main.jsx - Storefront Routes
frontend/src/App.jsx - Shop State · Shared catalogue, cart, authentication, and API-facing state.
frontend/src/context/ShopContext.jsx - Browse & Product Views
frontend/src/pages/Collection.jsx - Cart & Checkout
frontend/src/pages/Cart.jsx - Order Verification
frontend/src/pages/Verify.jsx - Account & Self-Service
frontend/src/pages/UserDashboard.jsx - Product Recommendations
frontend/src/components/PersonalizedRecommendations.jsx
Admin Console
Vite React operations client.
- Admin Bootstrap
admin/src/main.jsx - Admin Shell & Login
admin/src/App.jsx - Operations Management · Dashboard, product management, and order operations.
admin/src/pages/Dashboard.jsx
Node.js API
Express domain and HTTP boundary.
- Express Server
backend/server.js - Product, Order & User Routes
backend/routes/productRoute.js - Dashboard Routes
backend/routes/dashboardRoute.js - Auth & Role Gates · Customer, admin, and role-restricted operation guards.
backend/middleware/auth.js - Commerce Controllers · Product, order, cart, user, and dashboard operations.
backend/controllers/orderController.js - Multipart Uploads
backend/middleware/multer.js - Commerce Records · Product, order, user, inquiry, and review records.
backend/models/productModel.js
Data & Media Services
- MongoDB · Primary persistence runtime.
backend/config/mongodb.js - Cloudinary
backend/config/cloudinary.js
Connections 24
- Storefront Bootstrap → Storefront Routes: mounts
- Storefront Routes → Shop State: uses shared state
- Storefront Routes → Browse & Product Views: routes to
- Storefront Routes → Cart & Checkout: routes to
- Storefront Routes → Account & Self-Service: routes to
- Browse & Product Views → Product Recommendations: renders
- Browse & Product Views → Cart & Checkout: adds items
- Cart & Checkout → Order Verification: places and verifies order
- Shop State → Product, Order & User Routes: API requests
- Admin Bootstrap → Admin Shell & Login: mounts
- Admin Shell & Login → Operations Management: routes to
- Operations Management → Dashboard Routes: admin API requests
- Operations Management → Product, Order & User Routes: catalog and order requests
- Express Server → Product, Order & User Routes: serves
- Express Server → Dashboard Routes: serves
- Product, Order & User Routes → Auth & Role Gates: protects operations
- Dashboard Routes → Auth & Role Gates: admin protection
- Auth & Role Gates → Commerce Controllers: authorizes
- Product, Order & User Routes → Commerce Controllers: dispatches
- Dashboard Routes → Commerce Controllers: dispatches
- Multipart Uploads → Commerce Controllers: provides uploaded media
- Commerce Controllers → Commerce Records: reads and writes
- Commerce Records → MongoDB: persists in
- Commerce Controllers → Cloudinary: stores media