A modern, role-based E-Commerce Web Application with authentication, cart management, coupon system, payment integration (Stripe), analytics, and admin controls. Built with MERN Stack, Tailwind, Zustand, Stripe, and image handling via Cloudinary + Sharp.
- Node.js & Express.js – Server-side framework
- MongoDB + Mongoose – NoSQL database
- JWT – Auth with refresh tokens
- bcryptjs – Password hashing
- ioredis – Caching (optional)
- cookie-parser – Cookie-based sessions
- Stripe – Payment processing
- Multer + Sharp – Image upload and compression
- Cloudinary – Media storage
- CORS, dotenv, cross-env – Environment setup and security
- Role-based middleware – Admin vs. user access control
- React (v19) – UI components
- React Router DOM (v7) – Routing
- Zustand – Global state
- Tailwind CSS + DaisyUI – Styling
- Axios – API client
- @stripe/stripe-js – Frontend Stripe integration
- Recharts – Analytics & chart visualizations
- Framer Motion + React Hot Toast + Confetti – Animations & UX
- 🔐 User Auth with JWT (access + refresh tokens)
- 🛒 Cart system with quantity, remove, and full clear
- 💳 Stripe Checkout with real-time success handling
- 📦 Product filtering by category & recommendations
- 🎯 Admin-only routes for product creation, deletion, and analytics
- 🎉 Coupon creation and validation
- 📈 Sales Analytics API with daily/weekly data
- 🖼️ Image Upload using Multer, Sharp & Cloudinary
- 📤 Role-based access: Users vs. Admins
Base URL:
/api
| Method | Endpoint | Description |
|---|---|---|
| POST | /signup |
Register user |
| POST | /login |
Login and issue tokens |
| POST | /logout |
Invalidate session |
| POST | /refresh |
Refresh token logic |
| GET | /getProfile |
Get authenticated user profile |
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Get items in cart |
| POST | / |
Add item to cart |
| PUT | /:id |
Update item quantity |
| DELETE | / |
Remove all cart items |
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Get all coupons |
| POST | /validate |
Validate a coupon code |
| Method | Endpoint | Description |
|---|---|---|
| POST | /create-checkout-session |
Stripe checkout integration |
| POST | /checkout-success |
Stripe post-payment webhook |
| Method | Endpoint | Access | Description |
|---|---|---|---|
| GET | / |
Admin only | Get all products |
| GET | /featured |
Public | Get featured products |
| GET | /recommendtion |
Public | Get recommended items |
| GET | /category/:category |
Public | Filter products by category |
| POST | / |
Admin only | Create product (with image) |
| PATCH | /:id |
Admin only | Toggle featured state |
| DELETE | /:productId |
Admin only | Delete a product |
| Method | Endpoint | Access | Description |
|---|---|---|---|
| GET | /analytics |
Admin only | Get full sales + daily analytics |
git clone https://github.com/ExploreInsight/supperFastShop.git
cd supperFastShop
Backend
npm install
Frontend:
cd client
npm install
In the /server folder, create a .env file and add the following:
PORT=7001
MONGO_URI=your-mongodb-uri
JWT_SECRET=your-jwt-secret
CLOUDINARY_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_SECRET=your-secret
ACCESS_TOKEN_SECRET=your-token-secret
REFRESH_TOKEN_SECRET=your-refresh-secret
STRIPE_SECRET_KEY=your-stripe-secret
CLIENT_URL=your-client-url
UPSTASH_REDIS_URL=your-upstash-secretnpm run devThe backend (API) should be running at: http://localhost:7001
cd client
npm run devThe frontend should be running at: http://localhost:5173
Chirag
