A full-stack e-commerce application built with React, Node.js, Express, and MongoDB featuring a modern UI, user authentication, shopping cart, wishlist, order management, and order tracking.
- Premium Design: Gradient backgrounds, glassmorphism effects, and smooth animations
- Responsive Layout: Mobile-first design that works seamlessly on all devices
- Dark Mode Ready: Modern color scheme with CSS variables
- Micro-interactions: Hover effects, transitions, and animated elements
- User registration and login
- JWT-based authentication
- Protected routes
- User-specific data storage
- Product Catalog: Browse products with images, prices, and ratings
- Search & Filter: Find products easily
- Product Details: Detailed product information
- Hero Section: Banner slider with featured categories
- Add/remove items
- Update quantities
- Real-time total calculation
- User-specific cart (persists per user)
- Cart badge showing item count
- Save favorite products
- Move items to cart
- User-specific wishlist
- Wishlist badge showing item count
- Place Orders: Seamless checkout process
- Order History: View all past orders
- Order Details: Complete order information with items and totals
- Order Status: Track order progress (Processing, Shipped, Delivered)
- User-specific Orders: Each user has their own order history
- Visual Delivery Map: Animated route from warehouse to delivery location
- Moving Truck Animation: Real-time delivery visualization
- 5-Stage Timeline:
- Order Placed
- Order Confirmed
- Shipped
- Out for Delivery
- Delivered
- Status Indicators: Color-coded progress with animations
- Delivery ETA: Expected delivery date display
- Responsive Layout: Desktop (3-column) and mobile (stacked) views
- Toast notifications for user feedback
- Empty states with call-to-action buttons
- Loading states
- Error handling
- LocalStorage persistence per user
- React 18.x - UI library
- React Router - Client-side routing
- Context API - State management
- Vite - Build tool and dev server
- CSS3 - Modern styling with variables and animations
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- JWT - Authentication
- bcrypt - Password hashing
- CORS - Cross-origin resource sharing
collegebackend/
βββ backend/
β βββ app.js # Express server setup
β βββ models/
β β βββ productmodel.js # Product schema
β β βββ usermodel.js # User schema
β βββ package.json
β
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ Navbar.jsx # Navigation bar
β β β βββ Hero.jsx # Hero section with slider
β β β βββ Products.jsx # Product card component
β β β βββ Footer.jsx # Footer component
β β β βββ Toast.jsx # Toast notifications
β β β
β β βββ pages/
β β β βββ Home.jsx # Home page
β β β βββ Cart.jsx # Shopping cart
β β β βββ Wishlist.jsx # Wishlist page
β β β βββ Orders.jsx # Order history
β β β βββ OrderSuccess.jsx # Order confirmation
β β β βββ OrderTracking.jsx # Order tracking
β β β βββ Profile.jsx # User profile
β β β βββ Login.jsx # Login page
β β β βββ Register.jsx # Registration page
β β β
β β βββ context/
β β β βββ AuthContext.jsx # Authentication state
β β β βββ CartContext.jsx # Cart state (user-specific)
β β β βββ WishlistContext.jsx # Wishlist state (user-specific)
β β β βββ OrderContext.jsx # Orders state (user-specific)
β β β βββ ToastContext.jsx # Toast notifications
β β β
β β βββ App.jsx # Main app component
β β βββ App.css # Global styles
β β βββ main.jsx # Entry point
β β
β βββ package.json
- Node.js (v18 or higher)
- MongoDB (local or Atlas)
- npm or yarn
- Navigate to frontend directory
cd frontend- Install dependencies
npm install- Create
.envfile
VITE_API_URL=http://localhost:3000For production (Render):
VITE_API_URL=https://your-backend-url.onrender.com- Start development server
npm run devFrontend will run on http://localhost:5173
- Push code to GitHub
- Create new Web Service on Render
- Connect GitHub repository
- Set build command:
npm install - Set start command:
node app.js - Add environment variables
- Deploy
- Push code to GitHub
- Import project on Vercel
- Set framework preset: Vite
- Set root directory:
frontend - Add environment variable:
VITE_API_URL - Deploy
POST /register- Register new userPOST /login- Login user
GET /products- Get all productsPOST /products- Add new product (admin)
Each user has isolated data stored in localStorage:
- Cart:
cart_{username} - Wishlist:
wishlist_{username} - Orders:
orders_{username}
Data automatically loads on login and clears on logout.
- Mobile: < 640px
- Tablet: 640px - 1024px
- Desktop: > 1024px
- Visual map with warehouse and delivery location
- Animated truck moving along route
- 5-stage progress timeline with status indicators
- Responsive layout (row on desktop, column on mobile)
- Real-time status updates with color coding
- JWT tokens stored in localStorage
- Protected routes requiring authentication
- Automatic token validation on mount
- Logout clears all user data
- Context API for global state
- Separate contexts for different features
- User-specific data isolation
- Automatic persistence to localStorage
Ensure backend has CORS enabled:
app.use(cors());Check VITE_API_URL in frontend .env file matches backend URL
Verify MongoDB is running and connection string is correct
Clear node_modules and reinstall:
rm -rf node_modules package-lock.json
npm installThis project is open source and available under the MIT License.
Contributions, issues, and feature requests are welcome!
For support, email srivastavaharsh1108@gmail.com or create an issue in the repository.
Happy Shopping! ποΈ