This project is a fully functional e-commerce website built using the MERN (MongoDB, Express, React, Node.js) stack. It features user authentication, product management, a shopping cart, order placement, and payment gateway integration. The admin dashboard allows for efficient store management, including order tracking and product uploads.
- Frontend: Built with Vite React, including pages for home, collections, product details, cart, orders, login, about, and contact.
- Backend: Node.js and Express handle APIs, user authentication, and database management.
- Authentication: Secure user and admin authentication using JWT.
- Product Management: Upload, edit, and delete products via an admin dashboard.
- Cart & Order Management: Add products to the cart, place orders, and track them in the admin panel.
- Payment Integration: Supports Stripe and Razorpay for secure transactions.
- Image Uploads: Uses Cloudinary and Multer for efficient image storage and handling.
- Deployment: Fully deployed on Vercel for easy access.
- Frontend: Vite React setup, routing, and UI components.
- Backend: API development with Express and MongoDB.
- Authentication: User registration and admin verification.
- Product Features: Uploading and displaying products.
- Cart & Orders: Managing user purchases and tracking orders.
- Admin Dashboard: Overview and control over website operations.
- Payments: Secure integration with Stripe and Razorpay.
- Image Uploads: Implemented using Cloudinary and Multer.
- Deployment: Final hosting on Vercel.
- Clone the repository:
git clone https://github.com/yourusername/mern-ecommerce.git
- Navigate to the project directory:
cd mern-ecommerce - Configure environment variables:
- backend: create
backend/.envwithMONGODB_URI(must start withmongodb://ormongodb+srv://),JWT_SECRET,ADMIN_EMAIL,ADMIN_PASSWORD, and Cloudinary keys. Seebackend/config/mongodb.jsand related config. - frontend and admin: set
VITE_BACKEND_URLin each app’s.env(e.g.http://localhost:4000/). A trailing slash is optional; the app normalizes the base URL and uses paths likeapi/....
- backend: create
- Install dependencies (from the repository root, where
frontend,backend, andadminare sibling folders):cd frontend npm install cd ../backend npm install cd ../admin npm install
- Start the development servers — use three terminals, each opened at the repository root:
Opens the shop at
cd frontend npm run devhttp://localhost:5173/.Same ascd backend npm run devnpm run server(nodemon). API athttp://localhost:4000/by default.Same ascd admin npm run startnpm run dev. Admin UI athttp://localhost:5174/.
- Frontend: React, Redux, React Router
- Backend: Node.js, Express, MongoDB
- Authentication: JWT
- Payment: Stripe, Razorpay
- Image Uploads: Cloudinary, Multer
- Deployment: Vercel
To deploy the project on Vercel:
- Push the code to GitHub.
- Connect the repository to Vercel.
- Deploy both the frontend and backend separately.
Credits : https://youtu.be/7E6um7NGmeE?si=3tdDDz2_2CrXqJwe
- Divanshi Jain - GitHub Profile
This project is licensed under the MIT License.