A modern, responsive, full-stack e-commerce platform built with React.js, Node.js/Express, and MongoDB.
This is a production-ready e-commerce application featuring:
- Modern responsive UI with Tailwind CSS
- Redux state management
- User authentication and authorization
- Product browsing with filtering and search
- Shopping cart management
- Checkout with multiple payment options
- Order tracking
- Admin dashboard
- Mobile-first responsive design
- RESTful API architecture
- JWT authentication
- MongoDB integration with Mongoose
- Role-based access control (User/Admin)
- Product and inventory management
- Cart and order management
- Payment processing (Stripe/Razorpay)
- Input validation and error handling
- Security best practices
- User management
- Product catalog
- Order tracking
- Cart management
- Payment records
- Wishlist
Ecommerce/
├── frontend/
│ ├── src/
│ ├── public/
│ ├── package.json
│ ├── vite.config.js
│ ├── tailwind.config.js
│ └── README.md
├── backend/
│ ├── src/
│ ├── uploads/
│ ├── package.json
│ ├── .env.example
│ └── README.md
└── README.md (this file)
- Node.js v14+
- MongoDB
- npm or yarn
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Create
.envfile from.env.example:
cp .env.example .env- Update
.envwith your configuration:
MONGODB_URI=mongodb://localhost:27017/ecommerce
JWT_SECRET=your_secret_key
STRIPE_SECRET_KEY=your_stripe_key
RAZORPAY_KEY_ID=your_razorpay_key
- Start the server:
npm run devBackend will run on http://localhost:5000
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devFrontend will run on http://localhost:3000
- ✅ User Registration & Login
- ✅ JWT Authentication
- ✅ Profile Management
- ✅ Password Change
- ✅ Browse Products
- ✅ Product Search & Filtering
- ✅ Add to Cart
- ✅ Checkout
- ✅ Order Tracking
- ✅ Wishlist
- ✅ Product Reviews & Ratings
- ✅ Dashboard Analytics
- ✅ Product Management (CRUD)
- ✅ Category Management
- ✅ Order Management
- ✅ User Management
- ✅ Sales Analytics
- ✅ Revenue Reports
- ✅ Cash on Delivery
- ✅ Stripe Integration
- ✅ Razorpay Integration
- ✅ Responsive Design (Mobile, Tablet, Desktop)
- ✅ Real-time Notifications
- ✅ Error Handling
- ✅ Input Validation
- ✅ Security (JWT, CORS, Password Hashing)
- ✅ Database Indexing
- ✅ Pagination
- ✅ Sorting & Filtering
- ✅ SEO-friendly URLs
POST /api/auth/register - Register new user
POST /api/auth/login - Login user
POST /api/auth/logout - Logout user
POST /api/auth/refresh-token - Refresh token
GET /api/auth/profile - Get user profile
PUT /api/auth/profile - Update profile
POST /api/auth/change-password - Change password
GET /api/products - Get all products
GET /api/products/:id - Get product details
GET /api/products/featured - Get featured products
GET /api/products/new-arrivals - Get new arrivals
GET /api/products/search - Search products
GET /api/products/:id/related - Get related products
POST /api/products/:id/reviews - Add review
POST /api/products - Create product (Admin)
PUT /api/products/:id - Update product (Admin)
DELETE /api/products/:id - Delete product (Admin)
GET /api/cart - Get cart
POST /api/cart/add - Add to cart
PUT /api/cart/:productId - Update quantity
DELETE /api/cart/:productId - Remove item
DELETE /api/cart - Clear cart
POST /api/orders - Create order
GET /api/orders/my-orders - Get user orders
GET /api/orders/:id - Get order details
POST /api/orders/:id/cancel - Cancel order
GET /api/orders/all-orders - Get all orders (Admin)
PUT /api/orders/:id/status - Update status (Admin)
- React 18
- Redux Toolkit
- React Router DOM
- Tailwind CSS
- Axios
- React Icons
- React Toastify
- Chart.js
- Vite
- Node.js
- Express.js
- MongoDB
- Mongoose ODM
- JWT
- bcryptjs
- Multer
- Nodemailer
- Stripe
- Razorpay
- MongoDB
PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/ecommerce
JWT_SECRET=your_secret_key
JWT_EXPIRE=7d
FRONTEND_URL=http://localhost:3000
STRIPE_SECRET_KEY=your_key
RAZORPAY_KEY_ID=your_key
EMAIL_USER=your_email
EMAIL_PASSWORD=your_password
VITE_API_URL=http://localhost:5000/api
git clone <repository-url>
cd Ecommerce- Install MongoDB locally OR
- Create account on MongoDB Atlas and get connection string
- Copy
.env.exampleto.env - Update MongoDB connection string
- Add Stripe and Razorpay keys
- Run:
npm install&&npm run dev
- Run:
npm install&&npm run dev - Application opens at
http://localhost:3000
- Register a new user
- Browse products
- Add items to cart
- Complete checkout
- Access admin panel (use admin account)
- ESLint configured for code consistency
- Input validation on all endpoints
- Error handling with custom error middleware
- Security headers configured
- CORS properly configured
- Rate limiting recommended
- Push code to GitHub
- Connect GitHub to Vercel
- Configure environment variables
- Deploy
- Push code to GitHub
- Connect to Render/deploy to AWS
- Configure environment variables
- Configure MongoDB connection
- Deploy
- ✅ HTTPS in production
- ✅ JWT for authentication
- ✅ Password hashing with bcryptjs
- ✅ CORS configured
- ✅ Input validation
- ✅ Error messages don't leak sensitive info
- ✅ Secure password storage
- ✅ Protected admin routes
- Database indexing
- Pagination for large datasets
- Image optimization
- Lazy loading components
- Redux for state management
- Efficient API calls
Run tests:
npm test- Fork the repository
- Create feature branch
- Commit changes
- Push to branch
- Open pull request
- See
/backend/README.mdfor backend documentation - See
/frontend/README.mdfor frontend documentation - API documentation in route files
MIT License - feel free to use this project
- Email notifications
- SMS notifications
- Advanced analytics
- Recommendation engine
- Inventory management
- Return management
- Customer support chat
- Multiple languages support
- Dark mode
- PWA support
For questions or issues, please refer to the documentation in backend and frontend README files.