Skip to content

Keerthana040/ecommerce-mern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ecommerce-MERN

Welcome to the ecommerce-mern project.
This documentation serves as a technical guide for engineers, providing an in-depth understanding of the codebase, architecture, and integration points.

This project leverages the MERN stack:

  • MongoDB for the database
  • Express.js for the backend framework
  • React for the frontend
  • Node.js as the runtime environment

πŸ“‚ Project Structure

ecommerce-mern/
│── client/   # React frontend (UI, routing, pages, components)
│── server/   # Node.js backend (API, models, controllers, middleware)
│── .env      # Environment variables
│── package.json

✨ Features

πŸ”‘ Authentication & Authorization

  • User registration & login with hashed passwords
  • JWT-based authentication
  • Role-based access (User & Admin)

πŸ‘¨β€πŸ’Ό Admin Features

  • Category CRUD (Create, Read, Update, Delete)
  • Product CRUD with image upload
  • Manage orders & update order status

πŸ‘€ User Features

  • Browse products by category & price filters
  • Search & pagination
  • View product details & similar products
  • Add to cart & checkout
  • Manage profile & orders

πŸ”’ Security

  • Encrypted passwords with bcrypt
  • JWT-protected routes
  • Admin-only access controls

πŸ’³ Payment Integration

  • Online payment gateway support

πŸ—οΈ Project Setup

1️⃣ Clone the Repository

git clone https://github.com/your-username/ecommerce-mern.git
cd ecommerce-mern

2️⃣ Setup Backend (server/)

cd server
npm install
  • Create a .env file in server/:
PORT=8080
MONGO_URL=your_mongo_connection_url
JWT_SECRET=your_jwt_secret
  • Start the backend server:
npm start

3️⃣ Setup Frontend (client/)

cd client
npm install
npm start
  • Frontend will run on β†’ http://localhost:3000
  • Backend will run on β†’ http://localhost:8080

πŸ”‘ Authentication Flow

  1. Register β†’ User submits details β†’ Password hashed β†’ Saved in MongoDB
  2. Login β†’ JWT generated & returned β†’ Stored in local storage
  3. Protected Routes β†’ Token verified by middleware (requireSignIn, isAdmin)

Architecture: Screenshot 2025-09-22 165206

πŸ“Έ Screenshots (Optional)

Screenshot 2025-09-16 144020 Screenshot 2025-09-16 142615 Screenshot 2025-09-26 130452 Screenshot 2025-09-26 125914 Screenshot 2025-09-26 125944 Screenshot 2025-09-26 124058

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published