Skip to content

Latest commit

Β 

History

11 Commits

Folders and files

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

Repository files navigation

πŸ›οΈ ReactStore β€” Full-Stack E-Commerce Platform

A modern, full-stack e-commerce web application built with React, Node.js, Express, MongoDB, and Clerk Authentication. ReactStore delivers a complete shopping experience for customers alongside a protected admin dashboard for managing products and orders.

React Node.js MongoDB Clerk Deployment License

Live Demo Β· Features Β· Tech Stack Β· Getting Started Β· API Β· Roadmap


🌐 Live Demo

Resource Link
πŸ›’ Website react-ecommerce-nine-lyart.vercel.app
πŸš€ Backend API react-ecommerce-backend-0tqa.onrender.com
πŸ“¦ Repository github.com/MrGaurav695/react-ecommerce

Note: The backend is hosted on Render's free tier, so the first request after a period of inactivity may take a few seconds to spin up.


✨ Features

πŸ‘€ Customer

  • πŸ” Secure registration and login via Clerk
  • πŸ›οΈ Browse the full product catalog
  • πŸ”Ž Detailed product view pages
  • 🏷️ Filter products by category
  • πŸ›’ Add to cart, adjust quantities, and remove items
  • πŸ’³ Streamlined checkout flow
  • πŸ“¦ Place orders and track order history
  • πŸ” View individual order details
  • πŸ“± Fully responsive design across mobile, tablet, and desktop

πŸ‘‘ Admin

  • πŸ” Protected, role-gated admin dashboard
  • πŸ“¦ View, add, edit, and delete products
  • πŸ“‹ View all customer orders
  • πŸ”„ Update order status
  • πŸ“Š Centralized store and order management

πŸ” Authentication & Authorization

ReactStore uses Clerk for authentication, with role-based access control enforced on both the frontend and backend.

Role Access
Customer (authenticated) Products, Product Details, Cart, Checkout, Orders, Order Details
Admin (authorized) Admin Dashboard, Product Management, Order Management

Backend routes are additionally guarded by authentication and admin-authorization middleware, so protection isn't reliant on the frontend alone.


πŸ› οΈ Tech Stack

Frontend React.js Β· React Router Β· Redux Β· Bootstrap Β· Axios Β· React Hot Toast Β· React Loading Skeleton Β· Clerk Authentication

Backend Node.js Β· Express.js Β· MongoDB Β· Mongoose Β· Clerk Express Β· CORS Β· dotenv

Deployment Vercel (Frontend) Β· Render (Backend) Β· MongoDB Atlas (Database) Β· GitHub (Source Control)


πŸ—οΈ Project Structure

react-ecommerce/
β”œβ”€β”€ Client/                 # React frontend
β”‚   β”œβ”€β”€ public/
β”‚   └── src/
β”‚       β”œβ”€β”€ api/            # Axios API calls
β”‚       β”œβ”€β”€ components/     # Reusable UI components
β”‚       β”œβ”€β”€ pages/          # Route-level pages
β”‚       └── redux/          # State management
β”‚
β”œβ”€β”€ Server/                 # Express backend
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ middleware/         # Auth & admin guards
β”‚   β”œβ”€β”€ models/             # Mongoose schemas
β”‚   β”œβ”€β”€ routes/
β”‚   └── server.js
β”‚
└── README.md

πŸ”„ Architecture

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚     User     β”‚
                 β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚  React Frontend   β”‚
              β”‚     (Vercel)      β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚ Axios (REST API)
                        β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚  Express Backend  β”‚
              β”‚     (Render)      β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό                           β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚  Clerk Auth    β”‚         β”‚  MongoDB Atlas   β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Product Management

Admins have full CRUD control over the product catalog:

Create β†’ Read β†’ Update β†’ Delete

All products are stored in MongoDB Atlas and served through REST APIs.

πŸ›’ Order Management

Customers place orders through the checkout flow. Each order captures:

  • Customer information
  • Products and quantities
  • Shipping address & method
  • Payment method
  • Subtotal, shipping cost, and total price
  • Order status

Order statuses: Pending β†’ Confirmed β†’ Shipped β†’ Delivered (or Cancelled)

Admins can update order status directly from the dashboard.


🌐 API Endpoints

Products

Method Endpoint Description
GET /api/products Get all products
GET /api/products/:id Get a single product
POST /api/products Create a product (admin)
PUT /api/products/:id Update a product (admin)
DELETE /api/products/:id Delete a product (admin)

Orders

Method Endpoint Description
POST /api/orders Place a new order
GET /api/orders Get all orders (admin)
GET /api/orders/user/:userId Get a user's order history
GET /api/orders/:id Get order details
PUT /api/orders/:id/status Update order status (admin)

βš™οΈ Environment Variables

Client β€” Client/.env

REACT_APP_API_URL=your_backend_api_url
REACT_APP_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key

Server β€” Server/.env

PORT=5000
MONGODB_URI=your_mongodb_connection_string
CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
CLIENT_URL=your_frontend_url

⚠️ Never commit .env files or secret keys to GitHub. Make sure both are listed in .gitignore.


πŸš€ Getting Started

Prerequisites

  • Node.js (v16+)
  • npm or yarn
  • A MongoDB Atlas account
  • A Clerk account (for API keys)

1. Clone the repository

git clone https://github.com/MrGaurav695/react-ecommerce.git
cd react-ecommerce

2. Start the backend

cd Server
npm install
npm start

Runs at β†’ http://localhost:5000

3. Start the frontend

Open a new terminal:

cd Client
npm install
npm start

Runs at β†’ http://localhost:3000


🌍 Deployment

GitHub
 β”œβ”€β”€ Client ──► Vercel
 └── Server ──► Render ──► MongoDB Atlas
Layer Platform
Frontend Vercel
Backend Render
Database MongoDB Atlas
Auth Clerk

πŸ”’ Security

  • Clerk-based authentication
  • Protected frontend and admin routes
  • Backend authentication & admin-authorization middleware
  • CORS configuration
  • Environment-variable-based secret management
  • Protected API operations

πŸ“Έ Screenshots

🏠 Home Page

Home Page

πŸ›οΈ Products Page

Products Page

πŸ›’ Shopping Cart

Shopping Cart

πŸ“¦ Orders

Orders

πŸ‘‘ Admin Dashboard

Admin Dashboard

πŸ“‹ Admin Orders

Admin Orders


🎯 What I Learned

Building ReactStore helped me strengthen skills in:

  • React component architecture & React Router
  • Redux state management
  • REST API design and Node.js/Express development
  • MongoDB & Mongoose data modeling
  • Clerk authentication and role-based authorization
  • Full CRUD implementation and Axios integration
  • Responsive UI development
  • Environment variable & secrets management
  • Git/GitHub workflows and production deployment (Vercel, Render, MongoDB Atlas)

🚧 Roadmap

  • πŸ’³ Real payment gateway integration
  • ⭐ Product reviews and ratings
  • ❀️ Wishlist
  • πŸ” Advanced product search & filters
  • πŸ“Š Advanced admin analytics
  • 🎟️ Coupon and discount system
  • πŸ“§ Order confirmation emails
  • πŸ–ΌοΈ Product image upload management
  • πŸ“ˆ Sales analytics dashboard

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

Gaurav Shirsath
Computer Engineering Student

GitHub


⭐ Support

If you found this project useful or interesting, consider giving the repository a ⭐ on GitHub β€” it helps a lot!

πŸ“„ License

This project was created for learning, development, and portfolio purposes.

About

Full-stack e-commerce platform built with React, Node.js, Express, MongoDB, Redux, and Clerk Authentication.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages