React/Vite frontend for VendorsOnline, a MERN e-commerce marketplace with vendor storefronts, customer carts, simulated escrow payments, OTP delivery confirmation, and admin dispute handling.
Clone the repository:
git clone https://github.com/kushalprasadjoshi-bachelor/vendors-online-client.git
cd vendors-online-clientInstall dependencies:
npm installThis project requires environment variables to run properly.
Create a .env file in the root directory:
touch .envThen add the following variables:
VITE_APP_NAME=VendorsOnline
VITE_API_BASE_URL=http://localhost:8000/
VITE_ENABLE_MOCKS=true
VITE_ESCROW_SIMULATION=trueSet VITE_ENABLE_MOCKS=false when the Express.js backend is ready.
VITE_APP_NAME: The display name for the frontend application. It is used by the app to label the UI and can be customized for branding.VITE_API_BASE_URL: The base URL for the backend API. All client requests are sent to this endpoint, so set it to your Express.js server address.VITE_ENABLE_MOCKS: Whentrue, the app uses mock data insrc/datainstead of calling the real backend. Set tofalseonce your backend is available.VITE_ESCROW_SIMULATION: Whentrue, escrow payments and delivery confirmation flows are simulated for development. Set tofalsewhen using a real escrow/payment integration.
npm run devUse npm.cmd run dev on Windows PowerShell if script execution blocks npm.ps1.
/customer homepage/storesvendor store listing/stores/:storeSlugstore product listing/stores/:storeSlug/products/:productSlugproduct detail and reviews/cart,/checkout,/orderscart, escrow checkout, and OTP delivery confirmation/login,/registercustomer/vendor/admin access screens/vendorshop panel with product, order, and storefront management/adminadmin panel with users, escrow transactions, and dispute queues
src/configapp env, route, and navigation configsrc/dtosrequest/response DTO factories for users, auth, stores, products, carts, orders, escrow, reviews, and disputessrc/servicesAPI client plus catalog/auth/order service adapterssrc/pluginsapp providers for auth and cart statesrc/utilsformatting, storage, slug, rating, and role helperssrc/datamock MERN-shaped data used while backend APIs are not connected
The client expects an Express.js API under VITE_API_BASE_URL with JWT auth and role-based access control for customer, vendor, and admin.
Suggested API groups:
POST /auth/login,POST /auth/registerGET /stores,GET /stores/:slug,GET /stores/:slug/productsGET /products/:slug,GET /products/:id/reviewsGET /orders,POST /orders,POST /orders/:id/confirm-deliveryGET /escrowGET /disputes
MongoDB collections should align with the DTOs in src/dtos.
Happy Coding!