LuxeMart β Premium E-Commerce Platform
A full-stack marketplace with glassmorphism UI, role-based access, real-time notifications, Razorpay payments, and a seller analytics dashboard.
- JWT-based auth with bcrypt password hashing β 30-day token expiry
- Three role types: Buyer, Seller, Admin (only one admin allowed per platform)
- Profile management with avatar upload, editable email + name, address book (Home/Office/Other)
- Product discovery with category filter, price range filter, and 4-way sort (price, newest, top-rated)
- Live search bar with debounced autocomplete, image previews, and highlighted matches
- Full search results page with server-side pagination, sorting, and price filters
- Product comparison β select up to 3 products and compare price, stock, category, description side-by-side
- Recently viewed products persisted via localStorage on each product detail page
- Wishlist toggle per product, viewable from profile
- Multi-image product gallery with thumbnail selector
- Add to cart with stock validation, quantity increase/decrease, item removal
- Coupon system β admin creates discount codes with expiry, usage limits, and enable/disable toggle
- Checkout flow: Cart β Select Address β Order Confirmation β Payment
- Razorpay integration for online payment with HMAC signature verification
- COD (Cash on Delivery) as alternative payment method
- Buyer order history with a 4-step progress stepper (Pending β Processing β Shipped β Delivered)
- Timestamped status history per step
- Order cancellation by buyer (creates notification)
- Seller order management with status update dropdown
- Revenue, order count, product count, average rating stats
- CSS bar chart of top-selling products (no chart library β pure CSS animations)
- Recent orders list with status badges
- Top products table with units sold and revenue generated per product
- In-app notification bell with unread badge counter
- Auto-generated notifications on order status changes and cancellations
- Mark individual or all notifications as read; click to navigate to relevant page
- Polling every 60 seconds for fresh data
- Platform-wide stats: users, products, orders, total revenue
- User role management table (promote/demote any user)
- Full coupon CRUD: create, list, enable/disable
- Glassmorphism design system with dark/light theme toggle (persisted to localStorage)
- CSS variable token system (
--color-accent,--surface,--border, etc.) Outfitdisplay font +Interbody fontfadeInUp,spin,growUpkeyframe animations throughout- Responsive down to 480px β mobile-first cart and navbar
Browser
β
βββ React 18 + Vite (SWC)
β βββ Redux Toolkit (user auth, compare state)
β βββ React Router v7
β βββ Axios (API calls)
β βββ react-hot-toast (notifications)
β
βββ Express.js Backend
βββ JWT + Bcrypt (auth)
βββ Multer (image uploads β /uploads/)
βββ Razorpay SDK (payments)
βββ express-rate-limit (100 req/15min per IP)
βββ MongoDB + Mongoose ODM
βββ backend/
β βββ controllers/
β β βββ userControllers.js # Auth, profile, wishlist, admin stats
β β βββ productControllers.js # CRUD, reviews, search + filter
β β βββ cartControllers.js # Add, update quantity, remove
β β βββ orderControllers.js # Place order, seller stats, status updates
β β βββ couponControllers.js # Create, apply, toggle coupons
β β βββ notificationControllers.js
β β βββ razorpayController.js # Create order + verify HMAC signature
β βββ models/ # User, Product, Order, Coupon, Notification
β βββ routes/ # userRoutes, productRoutes, orderRoutes...
β βββ middlewares/
β β βββ authMiddleware.js # protect, adminOnly, sellerOrAdmin
β β βββ multer.js # diskStorage config
β βββ server.js # Express entry, MongoDB connect, CORS
β
βββ frontend/
β βββ src/
β β βββ components/ # 20+ feature components
β β βββ homepage/ # Home, Card, ProductForm
β β βββ store/
β β β βββ userSlice.js # email, role, token (persisted to localStorage)
β β β βββ compareSlice.js # Up to 3 products for comparison
β β β βββ store.js
β β βββ index.css # Design tokens, CSS variables, animations
β β βββ App.css # Component-level styles
β βββ vite.config.js
- Node.js 20+, npm
- MongoDB (Atlas or local)
- Razorpay account (test keys work)
cd backend
npm installCreate .env:
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
RAZORPAY_KEY_ID=rzp_test_xxxxxxxxxxxx
RAZORPAY_KEY_SECRET=your_razorpay_secret
PORT=3001npm run dev # nodemon
npm start # productioncd frontend
npm installCreate .env:
VITE_BACKEND_URL=http://localhost:3001
VITE_RAZORPAY_KEY_ID=rzp_test_xxxxxxxxxxxxnpm run dev # Vite dev server
npm run build # Production build| Resource | Base Route | Auth Required |
|---|---|---|
| Users | /api/users |
Mixed |
| Products | /api |
Public GET, protected POST/PUT/DELETE |
| Orders | /api/orders |
protect |
| Cart | /api/users/cart |
protect |
| Coupons | /api/coupons |
protect + adminOnly (create/list/toggle) |
| Notifications | /api/notifications |
protect |
Key middleware: protect (validates JWT), adminOnly, sellerOrAdmin
1. Frontend β POST /api/orders/create-order (amount in paise)
2. Razorpay Checkout opens in browser
3. User pays β Razorpay calls handler with { razorpay_order_id, razorpay_payment_id, razorpay_signature }
4. Frontend β POST /api/orders/verify-payment (HMAC SHA256 verification)
5. On success β POST /api/orders/place-order (clears cart, decrements stock)
User β name, email, password (hashed), role (buyer/seller/admin), profilePicture, addresses[], cart[], wishlist[]
Product β name, description, price, stock, category, imageUrl[], userEmail, reviews[], rating, numReviews
Order β user, products[], address, totalPrice, status, couponCode, discountAmount, statusHistory[]
Coupon β code (uppercase), discountPercent, maxUses, usedCount, expiresAt, isActive
Notification β user, title, message, isRead, link
Deployed on Render (both frontend static site and backend web service).
CORS is configured to allow:
https://luxemart-ayw6.onrender.comhttps://luxemart-frontend-final.onrender.comhttp://localhost:5173(local dev)
React + Express + MongoDB Β· Razorpay Β· Redux Toolkit Β· Deployed on Render