A full-stack e-commerce platform built with the MERN stack, featuring separate user and admin dashboards, multiple payment methods, and a modern, responsive interface.
Try Live Demo at: ShopSphere Live Demo
- π User authentication (Register/Login)
- ποΈ Browse products with search and filter options
- π Shopping cart management
- π³ Multiple payment methods:
- Stripe integration
- Razorpay integration
- Cash on Delivery
- π¦ Order tracking and history
- π€ User profile management
- π± Fully responsive design
- π Admin dashboard with analytics
- β Add/Edit/Delete products
- π¦ Order management
- π₯ User management
- πΌοΈ Image upload with Cloudinary integration
- π Sales tracking
- React - UI Library
- React Router DOM - Navigation
- Tailwind CSS - Styling
- Axios - HTTP Client
- React Toastify - Notifications
- Vite - Build Tool
- Node.js - Runtime Environment
- Express.js - Web Framework
- MongoDB - Database
- Mongoose - ODM
- JWT - Authentication
- bcrypt - Password Hashing
- Cloudinary - Image Hosting
- Stripe & Razorpay - Payment Processing
- Multer - File Upload Middleware
ecommerce-app/
βββ frontend/ # User-facing React application
βββ admin/ # Admin dashboard React application
βββ backend/ # Node.js/Express API server
βββ README.md
- Node.js (v14 or higher)
- MongoDB Atlas account
- Cloudinary account
- Stripe account (for payment)
- Razorpay account (for payment)
-
Clone the repository
git clone <repository-url> cd ecommerce-app
-
Install dependencies for all three parts
# Backend cd backend npm install # Frontend cd ../frontend npm install # Admin cd ../admin npm install
-
Environment Variables Setup
Create
.envfiles in each directory:Backend (.env)
MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key CLOUDINARY_NAME=your_cloudinary_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_SECRET_KEY=your_cloudinary_secret_key STRIPE_SECRET_KEY=your_stripe_secret_key RAZORPAY_KEY_ID=your_razorpay_key_id RAZORPAY_KEY_SECRET=your_razorpay_key_secret ADMIN_EMAIL=admin@example.com ADMIN_PASSWORD=your_admin_password PORT=4000
Frontend (.env)
VITE_BACKEND_URL=http://localhost:4000
Admin (.env)
VITE_BACKEND_URL=http://localhost:4000
You need to run three separate servers simultaneously:
-
Backend Server (Terminal 1)
cd backend npm run serverServer runs on:
http://localhost:4000 -
Frontend (Terminal 2)
cd frontend npm run devRuns on:
http://localhost:5173 -
Admin Panel (Terminal 3)
cd admin npm run devRuns on:
http://localhost:5174
Each directory (frontend, admin, and backend) contains a vercel.json configuration file for deployment.
-
Install Vercel CLI
npm install -g vercel
-
Deploy Backend
cd backend vercel --prod -
Deploy Frontend
cd frontend vercel --prod -
Deploy Admin
cd admin vercel --prod -
Update Environment Variables
- Go to Vercel Dashboard > Project > Settings > Environment Variables
- Add all required environment variables for each project
- Update
VITE_BACKEND_URLin frontend and admin to point to your deployed backend URL
- Make sure MongoDB Atlas allows connections from anywhere (
0.0.0.0/0) or add Vercel's IP ranges - Update CORS settings in backend to allow your frontend and admin domains
- Set all environment variables in Vercel dashboard
- Backend will need serverless function configuration for API routes
POST /api/user/register- Register new userPOST /api/user/login- User loginGET /api/user/profile- Get user profile
GET /api/product/list- Get all productsPOST /api/product/add- Add new product (Admin)PUT /api/product/update- Update product (Admin)DELETE /api/product/remove- Delete product (Admin)
POST /api/cart/add- Add to cartGET /api/cart/get- Get user cartPOST /api/cart/update- Update cart item
POST /api/order/place- Place orderGET /api/order/user- Get user ordersGET /api/order/list- Get all orders (Admin)PUT /api/order/status- Update order status (Admin)
Email: admin@forever.com
Password: admin@123
We welcome contributions from the community. If you want to help improve ShopSphere, follow this simple workflow:
-
Find an issue
- Browse the issues list and pick something you can work on.
- If possible, comment on the issue before starting so others know it is being handled.
-
Fork the repository
- Create your own copy of the project on GitHub.
- Clone your fork to your local machine.
-
Create a branch
- Make a new branch for your fix or feature.
- Use a clear branch name related to the task.
-
Make your changes
- Follow the existing code style and keep changes focused.
- Test your changes locally before submitting.
-
Commit your work
- Write a clear commit message that explains what you changed.
- Keep commits small and meaningful when possible.
-
Push and open a Pull Request
- Push your branch to your fork.
- Open a PR against the main branch of the original repository.
- Include a short description of the change and any relevant screenshots or notes.
-
Review feedback
- Respond to review comments if any changes are requested.
- Update your branch and push again until the PR is ready to merge.
This project is licensed under the MIT License.
Kallappa Murasiddh Kabboor
- MongoDB Atlas for database hosting
- Cloudinary for image hosting
- Stripe and Razorpay for payment processing
- Vercel for deployment platform