Skip to content

Latest commit

Β 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ E-Commerce Management System

Full-Stack MERN E-Commerce Platform

A modern full-stack e-commerce platform built using the MERN stack, featuring secure authentication, role-based authorization, product and inventory management, customer management, order tracking, coupons, reviews, wishlist, email verification, password recovery, cloud-based image uploads, and admin analytics.

🌐 Live Demo: https://e-commerce-shop-proj.vercel.app


✨ Features

πŸ” Authentication & Security

  • User Registration & Login
  • JWT-based Authentication
  • Role-Based Authorization for Admin and Customers
  • Password Hashing using bcrypt
  • Email Verification using Brevo
  • Forgot Password functionality
  • Secure Password Reset using token-based verification
  • Protected Frontend and Backend Routes
  • CORS Configuration
  • Helmet Security Middleware
  • API Rate Limiting
  • Centralized Error Handling

πŸ‘€ User Management

  • Customer Registration and Login
  • Customer Profile Management
  • Profile Image Upload
  • Admin Customer Management
  • Admin/User Role Management
  • Account Verification Status

πŸ›οΈ Product Management

  • Product Creation, Updating and Deletion
  • Product Categories
  • Product Pricing
  • Product Stock Management
  • Product Image Upload
  • Cloudinary-based Image Storage
  • Product Search and Filtering
  • Product Details
  • Product Ratings and Review Count

πŸ›’ Shopping & Orders

  • Add Products to Cart
  • Update Cart Quantity
  • Remove Products from Cart
  • Wishlist Management
  • Checkout System
  • Order Placement
  • Order History
  • Order Status Tracking
  • Shipping Address Management
  • Stock Availability Validation
  • Automatic Inventory Deduction after Order Placement
  • Payment Method and Payment Status Tracking
  • Transaction ID Tracking

⭐ Reviews & Ratings

  • Add Product Reviews
  • Product Rating System
  • Review Management
  • Average Product Rating Calculation
  • Review Count Aggregation

🎟️ Coupon Management

  • Create Coupons
  • Update Coupons
  • Delete Coupons
  • Coupon Validation
  • Discount Management
  • Admin Coupon Management

πŸ“Š Admin Dashboard

  • Total Users
  • Total Products
  • Total Orders
  • Total Revenue
  • Low Stock Products
  • Order Status Analytics
  • Product Management
  • Customer Management
  • Order Management
  • Coupon Management

🎨 UI & User Experience

  • Responsive Design
  • Modern React UI
  • Tailwind CSS
  • Dark Mode
  • Reusable Components
  • Protected Routes
  • User-Friendly Error Pages

☁️ Cloud & Email Integration

Cloudinary

Used for cloud-based image storage instead of storing uploaded images locally on the backend.

  • Product Image Uploads
  • User Profile Image Uploads
  • In-memory file processing using Multer
  • Cloudinary-hosted image URLs
  • Separate Cloudinary folders for products and user profiles

Brevo

Used for transactional email functionality.

  • Account Verification Emails
  • Forgot Password Emails
  • Password Reset Links

πŸ›  Tech Stack

Frontend

  • React.js
  • Vite
  • Tailwind CSS
  • Axios
  • React Router
  • Context API
  • Recharts

Backend

  • Node.js
  • Express.js
  • REST APIs
  • JWT
  • bcrypt
  • Multer
  • Helmet
  • Morgan
  • Express Rate Limit
  • CORS

Database

  • MongoDB
  • Mongoose

Cloud Services

  • Cloudinary β€” Image Storage
  • Brevo β€” Transactional Emails

Deployment

  • Vercel

πŸ—οΈ System Architecture

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚      React + Vite    β”‚
                         β”‚    Tailwind Frontend β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
                                  Axios
                                    β”‚
                                    β–Ό
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚   Express REST API   β”‚
                         β”‚      Node.js         β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚                   β”‚                   β”‚
                β–Ό                   β–Ό                   β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   MongoDB    β”‚    β”‚  Cloudinary  β”‚    β”‚    Brevo     β”‚
        β”‚   Database   β”‚    β”‚    Images    β”‚    β”‚    Emails    β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‚ Project Structure

E_COMMERCE_SHOP_PROJ/
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   └── main.jsx
β”‚   └── package.json
β”‚
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ cloudinary.js
β”‚   β”‚   └── db.js
β”‚   β”‚
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ adminController.js
β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”œβ”€β”€ couponController.js
β”‚   β”‚   β”œβ”€β”€ orderController.js
β”‚   β”‚   β”œβ”€β”€ productController.js
β”‚   β”‚   β”œβ”€β”€ reviewController.js
β”‚   β”‚   └── wishlistController.js
β”‚   β”‚
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”œβ”€β”€ authMiddleware.js
β”‚   β”‚   β”œβ”€β”€ errorMiddleware.js
β”‚   β”‚   β”œβ”€β”€ profileUploadMiddleware.js
β”‚   β”‚   └── roleMiddleware.js
β”‚   β”‚
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ Coupon.js
β”‚   β”‚   β”œβ”€β”€ Order.js
β”‚   β”‚   β”œβ”€β”€ Product.js
β”‚   β”‚   β”œβ”€β”€ Review.js
β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   └── Wishlist.js
β”‚   β”‚
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ adminRoutes.js
β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”œβ”€β”€ couponRoutes.js
β”‚   β”‚   β”œβ”€β”€ orderRoutes.js
β”‚   β”‚   β”œβ”€β”€ productRoutes.js
β”‚   β”‚   β”œβ”€β”€ reviewRoutes.js
β”‚   β”‚   β”œβ”€β”€ uploadRoutes.js
β”‚   β”‚   β”œβ”€β”€ userRoutes.js
β”‚   β”‚   └── wishlistRoutes.js
β”‚   β”‚
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── sendEmail.js
β”‚   β”‚
β”‚   β”œβ”€β”€ server.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ screenshots/
β”‚
└── README.md

πŸ”„ Authentication Flow

User Registration
        β”‚
        β–Ό
Create User
        β”‚
        β–Ό
Hash Password using bcrypt
        β”‚
        β–Ό
Generate Verification Token
        β”‚
        β–Ό
Send Verification Email via Brevo
        β”‚
        β–Ό
User Verifies Account
        β”‚
        β–Ό
Login using Email + Password
        β”‚
        β–Ό
Generate JWT
        β”‚
        β–Ό
Access Protected Resources

πŸ”‘ Password Reset Flow

Forgot Password
       β”‚
       β–Ό
Generate Reset Token
       β”‚
       β–Ό
Send Reset Email via Brevo
       β”‚
       β–Ό
User Opens Reset Link
       β”‚
       β–Ό
Validate Token
       β”‚
       β–Ό
Set New Password
       β”‚
       β–Ό
Hash Password using bcrypt
       β”‚
       β–Ό
Update User

☁️ Image Upload Flow

Product Images

Product Image
     β”‚
     β–Ό
Multer Memory Storage
     β”‚
     β–Ό
Image Buffer
     β”‚
     β–Ό
Cloudinary Upload
     β”‚
     β–Ό
Secure Cloudinary URL
     β”‚
     β–Ό
Store Image URL with Product

User Profile Images

Profile Image
     β”‚
     β–Ό
Multer Memory Storage
     β”‚
     β–Ό
Cloudinary
     β”‚
     β–Ό
Secure Image URL
     β”‚
     β–Ό
User Profile

πŸš€ Installation

1. Clone Repository

git clone https://github.com/ARADHYA200/E_COMMERCE_SHOP_PROJ.git

cd E_COMMERCE_SHOP_PROJ

2. Frontend Setup

cd frontend

npm install

npm run dev

Frontend will run on:

http://localhost:5173

3. Backend Setup

Open another terminal:

cd server

npm install

npm start

Backend will run on:

http://localhost:5000

πŸ” Environment Variables

Create a .env file inside the server directory.

PORT=5000

MONGO_URI=your_mongodb_connection_string

JWT_SECRET=your_jwt_secret

CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

BREVO_API_KEY=your_brevo_api_key

Never commit .env files or API keys to the repository.


πŸ“Έ Screenshots

Home

Home


Admin Dashboard

Admin Dashboard


Login

Login


Products

Products


🧩 Core Backend Modules

Module Functionality
Authentication Registration, Login, JWT, Verification, Password Reset
Authorization Role-based Admin/User access
Products Product CRUD, Categories, Stock, Images
Orders Checkout, Orders, Status, Inventory
Coupons Coupon Creation, Validation, Discounts
Reviews Ratings and Product Reviews
Wishlist Add/Remove Wishlist Products
Users Customer and Profile Management
Admin Dashboard and Business Analytics
Uploads Cloudinary Product Image Uploads
Email Brevo Verification and Password Reset

πŸ”’ Security Practices

  • Passwords hashed using bcrypt
  • JWT-based authentication
  • Role-based authorization
  • Protected API routes
  • Environment variables for secrets
  • CORS configuration
  • Helmet security headers
  • Express rate limiting
  • Centralized error handling
  • Input validation and authorization checks

πŸš€ Future Improvements

  • Online Payment Gateway Integration
  • Advanced Admin Reports
  • Order Invoice Generation
  • Product Recommendation System
  • Dockerization
  • Automated Testing
  • CI/CD Pipeline
  • Advanced Search and Filtering

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

Aradhya Agarwal

B.Tech β€” Electronics & Communication Engineering Dr. B. R. Ambedkar National Institute of Technology, Jalandhar

GitHub: https://github.com/ARADHYA200

About

Full-stack MERN e-commerce platform with authentication, admin dashboard, inventory management, customer management, order tracking and coupon system.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages