Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🛒 Full-Stack eCommerce App

React Redux Node Express MongoDB JWT

A full-stack eCommerce platform demonstrating secure authentication, role-based authorization, scalable state management, and clean REST API architecture.


🌐 API Overview

Example endpoints:

  • GET /api/products
  • POST /api/auth/login
  • POST /api/products (Admin only)
  • GET /api/orders (Protected)

✨ Features

  • 🔐 JWT Authentication (Login / Register)
  • 👥 Role-based authorization (Admin / User)
  • 🛍 Product CRUD (Admin only)
  • 🛒 Shopping cart system
  • 📦 Order management
  • 🧠 Global state management using Redux Toolkit
  • 🌐 RESTful API
  • 🔒 Protected routes (Frontend & Backend)
  • 🗄 MongoDB database integration

🏗 Architecture

Client → React SPA
Server → REST API (Express)
Database → MongoDB
Authentication → JWT
State Management → Redux Toolkit + RTK Query


🛠 Tech Stack

Frontend

  • React
  • Redux Toolkit
  • RTK Query
  • React Router

Backend

  • Node.js
  • Express
  • MongoDB
  • Mongoose
  • JWT
  • bcrypt
  • dotenv

⚙️ Local Installation

1️⃣ Clone

git clone https://github.com/yt314/git-node-react.git
cd git-node-react

2️⃣ Setup Server

cd server
npm install

Create .env:

MONGO_URI=
JWT_SECRET=
PORT=5000

Run:

npm run dev

3️⃣ Setup Client

cd ../client
npm install
npm start

Frontend: http://localhost:3000\ Backend: http://localhost:5000


🔐 Authentication Flow

  1. User registers / logs in\
  2. Server returns JWT\
  3. Token stored client-side\
  4. Protected routes verified using middleware\
  5. Admin routes restricted by role

📂 Project Structure

git-node-react/
│
├── client/
│   ├── src/
│   │   ├── app/
│   │   ├── features/
│   │   ├── components/
│   │   └── pages/
│
├── server/
│   ├── controllers/
│   ├── models/
│   ├── routes/
│   ├── middleware/
│   ├── config/
│   └── public/
│
└── README.md

📸 Screenshots

🏠 Home – Hero Section

Hero

🛍 Product Listing – Grid View

Product Grid

🛠 Admin – Product Management

Admin Dashboard

🔐 Authentication – Login

Login


🧠 What This Project Demonstrates

  • JWT-based authentication with role-based access control
  • Clean separation of concerns (controllers, routes, middleware)
  • Centralized API state management using RTK Query
  • Secure password hashing with bcrypt
  • Scalable project structure for full-stack applications

👩‍💻 Author

Yehudit Pollock GitHub Email

About

Fullstack MERN online store platform with authentication, product management and shopping cart.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages