How vishwaraj-636/wearth works
WEARTH is a MERN e-commerce platform. Buyers browse products, authenticate, manage a cart, and check out through Razorpay; sellers authenticate to create and manage products and inventory. The frontend routes pages and feature hooks through API services to the Express backend, whose routes dispatch to controllers and Mongo-backed models. README capabilities include Google OAuth and ImageKit uploads; payment and upload integrations are visible in sampled code. Several frontend pages and backend modules were not sampled, so those links are omitted or documented without asserting unsampled calls.
Main entry points: cart.controller.js Cart and order controller · app.routes.jsx Feature routes · app.js Express app · auth.middleware.js JWT access middleware
Components 29
Frontend experience
- App bootstrap
frontend/src/app/App.jsx - Feature routes
frontend/src/app/app.routes.jsx - Auth pages and hook
frontend/src/features/auth - Auth API client
frontend/src/features/auth/services/auth.api.js - Cart pages and hook
frontend/src/features/cart - Cart API client
frontend/src/features/cart/services/cart.api.js - Catalog and seller pages
frontend/src/features/products - Product API client
frontend/src/features/products/sevices/product.api.js
Identity and access
- Auth routes
backend/src/routes/auth.routes.js - Auth controller
backend/src/controllers/auth.controller.js - JWT access middleware
backend/src/middleware/auth.middleware.js - User records
backend/src/models/user.model.js
Product catalog
- Product routes
backend/src/routes/product.routes.js - Product controller
backend/src/controllers/product.controller.js - Product records
backend/src/models/product.model.js - Image storage service
backend/src/services/storage.service.js
Cart and payments
- Cart routes
backend/src/routes/cart.routes.js - Cart and order controller
backend/src/controllers/cart.controller.js - Cart detail DAO
backend/src/dao/cart.dao.js - Cart records
backend/src/models/cart.model.js - Payment records
backend/src/models/payment.model.js - Payment order service
backend/src/services/payment.service.js
Backend platform
- HTTP server
backend/server.js - Express app
backend/src/app.js - Mongo connection
backend/src/config/database.js
Other components
- Buyer
- Seller
- ImageKit
- Razorpay
Connections 32
- Buyer → Feature routes: browses and shops
README.md - Seller → Feature routes: manages listings
README.md - App bootstrap → Feature routes: provides routes
frontend/src/app/App.jsx - App bootstrap → Auth pages and hook: loads user
frontend/src/app/App.jsx - Feature routes → Auth pages and hook: routes to
- Feature routes → Cart pages and hook: routes to
- Feature routes → Catalog and seller pages: routes to
- Auth pages and hook → Auth API client: calls
frontend/src/features/auth/hook/useAuth.js - Cart pages and hook → Cart API client: calls
frontend/src/features/cart/hook/useCart.js - Catalog and seller pages → Product API client: calls
frontend/src/features/products/hook/useProduct.js - Auth routes → Auth controller: dispatches
backend/src/routes/auth.routes.js - Auth routes → JWT access middleware: protects
backend/src/routes/auth.routes.js - Auth controller → User records: reads and writes
backend/src/controllers/auth.controller.js - JWT access middleware → User records: loads user
backend/src/middleware/auth.middleware.js - Product routes → Product controller: dispatches
backend/src/routes/product.routes.js - Product routes → JWT access middleware: protects seller routes
backend/src/routes/product.routes.js - Product controller → Product records: reads and writes
backend/src/controllers/product.controller.js - Product controller → Image storage service: uploads images
backend/src/controllers/product.controller.js - Image storage service → ImageKit: uploads files
backend/src/services/storage.service.js - Cart routes → Cart and order controller: dispatches
backend/src/routes/cart.routes.js - Cart routes → JWT access middleware: protects routes
backend/src/routes/cart.routes.js - Cart and order controller → Cart detail DAO: gets cart details
backend/src/controllers/cart.controller.js - Cart and order controller → Cart records: reads and writes
backend/src/controllers/cart.controller.js - Cart and order controller → Product records: checks products
backend/src/controllers/cart.controller.js - Cart and order controller → Payment records: records payment
backend/src/controllers/cart.controller.js - Cart and order controller → Payment order service: creates order
backend/src/controllers/cart.controller.js - Payment order service → Razorpay: creates payment order
README.md - HTTP server → Mongo connection: connects
backend/server.js - HTTP server → Express app: serves
backend/server.js - Express app → Auth routes: mounts
backend/src/app.js - Express app → Product routes: mounts
backend/src/app.js - Express app → Cart routes: mounts
backend/src/app.js