This is a full-stack e-commerce web application built using the MERN stack (MongoDB, Express, React, Node.js). It also integrates Cloudinary for image uploads and Razorpay for payment processing.
- ✅ Register/Login with JWT authentication
- 👕 Browse products by categories/subcategories
- 🛒 Add to cart
- 💳 Place orders with Razorpay
- 📦 View past orders
- 🔐 Admin Login with protected route (env configured credentials)
- 📦 Add new products with multiple image uploads via Cloudinary
- 📃 View all products
- 📬 View all orders
- 🔄 Auto token-based session management
- React.js
- React Router
- Axios
- Tailwind CSS
- React Toastify
- Node.js
- Express.js
- MongoDB (via Mongoose)
- Cloudinary (image hosting)
- Razorpay (payment integration)
- JWT (admin authentication)
📸 Add screenshots here after running locally.
git clone https://github.com/safak/youtube.git
cd youtube
git checkout mern-ecommerce-appcd backend
npm installPORT=4000
JWT_SECRET=greatstack
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=greatstack123
MONGODB_URI=your_mongodb_connection_string
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_SECRET_KEY=your_secretnpm startThere are two frontend apps:
cd frontend
npm installCreate .env in frontend:
VITE_BACKEND_URL=http://localhost:4000npm run devVisit http://localhost:5173
cd admin
npm installCreate .env in admin:
VITE_BACKEND_URL=http://localhost:4000npm run devVisit http://localhost:5174 (or whatever port is shown)
- Razorpay is used for payment processing on the frontend (Checkout).
- No Firebase or Stripe is used in this project.
- Admin panel uses Cloudinary to upload product images via API.
- Images are previewed before upload using
URL.createObjectURL.
- Add validation and error boundaries
- Add filtering and search
- Add user profile page
- Add delivery address and shipping logic
PRs welcome. Fork and raise a pull request 🚀