Skip to content

Abdul-Rakib/Ecart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ E-Cart - Modern E-Commerce Platform

A full-stack e-commerce application built with the MERN stack (MongoDB, Express.js, React, Node.js) featuring a modern, minimal design with smooth animations and mobile-responsive UI.

🌐 Live Demo: ecart.gammerce.in


πŸ“Ή Demo Video

Watch Demo Video on YouTube

1-2 minute walkthrough demonstrating the complete application functionality


πŸ“Έ Screenshots

Homepage

Homepage

Cart Page

Cart Page

Authentication Page

Authentication Page


✨ Features

πŸ” Authentication & Authorization

  • User registration with Google Auth & OTP verification
  • Secure login with JWT tokens
  • Protected routes for authenticated users

πŸ›οΈ Shopping Experience

  • Browse products with category filtering
  • Featured products showcase on homepage
  • Integrated quantity selector in "Add to Cart" button
  • Real-time cart updates without page refresh

πŸ›’ Shopping Cart

  • Add/remove products with instant UI updates

πŸ’³ Checkout & Orders

  • Simple checkout form with customer details
  • Order confirmation with unique Order ID
  • Order success/failure pages
  • Order history page for users

🎨 UI/UX Features

  • Mobile Responsive: Optimized for all screen sizes
  • Accessibility: Clear navigation and user-friendly forms

πŸ› οΈ Tech Stack

Frontend

  • React 18+ - UI library
  • Tailwind CSS - Utility-first styling
  • Vite - Build tool and dev server

Backend

  • Node.js - Runtime environment
  • Express.js - Web framework
  • MongoDB - NoSQL database

πŸ“ Project Structure

E-Cart/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ middlewares/
β”‚   β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ server.js            # Entry point
β”‚   └── package.json
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ App.jsx          
β”‚   β”‚   β”œβ”€β”€ main.jsx         # Entry point
β”‚   β”‚   └── index.css       
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js


πŸš€ Setup Instructions

1. Clone the Repository

git clone https://github.com/Abdul-Rakib/Ecart.git
cd Ecart

2. Backend Setup

# Navigate to backend directory
cd backend

# Install dependencies
npm install

# Create .env file
touch .env

Add the following environment variables to .env:

EXAMPLES
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret_key
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number
NODE_ENV=development
# Start the backend server
npm start
# Server runs on http://localhost:5000

3. Frontend Setup

# Navigate to frontend directory (from root)
cd ../frontend

# Install dependencies
npm install

# Create .env file
touch .env

Add the following environment variables to .env:

VITE_API_URL=http://localhost:5000
# Start the development server
npm run dev
# App runs on http://localhost:5173

4. Database Seeding (Optional)

To populate the database with sample products:

# From backend directory
node data/seedProducts.js

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/send-otp - Send OTP to phone
  • POST /api/auth/verify-otp - Verify OTP
  • POST /api/auth/register - Register new user
  • POST /api/auth/login - User login
  • GET /api/auth/verify - Verify JWT token

Products

  • GET /api/products - Get all products
  • GET /api/products/:id - Get product by ID

Cart

  • GET /api/cart - Get user cart
  • POST /api/cart - Add item to cart
  • PUT /api/cart/:itemId - Update cart item quantity
  • DELETE /api/cart/:itemId - Remove item from cart
  • DELETE /api/cart - Clear cart

Checkout & Orders

  • POST /api/cart/checkout - Place order
  • GET /api/cart/orders/all - Get user orders
  • GET /api/cart/orders/:orderId - Get order by ID

User

  • GET /api/user/profile - Get user profile
  • PUT /api/user/profile - Update user profile

🎨 Design Decisions

Minimal Aesthetic

  • Clean white cards with subtle borders
  • Reduced padding and margins for compact layout
  • Smaller, readable font sizes
  • Subtle hover effects without transform animations

Mobile Optimization

  • Responsive grid layouts (1/2/4 columns)
  • Fixed bottom checkout bar on mobile
  • Collapsible order details
  • Touch-friendly button sizes
  • Stacked forms on small screens

Animation Philosophy

  • Smooth fade-in/fade-out (0.3-0.4s ease)
  • No bouncy or "shocky" effects
  • Subtle hover transitions
  • Infinite scrolling feature banners

πŸ”’ Security Features

  • JWT-based authentication
  • OTP verification for registration
  • Input validation on frontend and backend
  • CORS configuration

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


πŸ“ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Abdul Rakib


⭐ If you found this project helpful, please give it a star!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors