Skip to content

A comprehensive eCommerce web application built with a modern tech stack, featuring product listings, shopping cart, order management, user authentication, and secure payment integration. Designed for scalability, performance, and an intuitive shopping experience for both customers and administrators.

Notifications You must be signed in to change notification settings

chapi1234/ShopHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ ShopHub – Full-Stack E-Commerce Platform

React Backend Database Deployment

A modern, scalable, and feature-rich e-commerce platform for buyers and sellers built with React (TypeScript), Node.js, Express, MongoDB, and ShadCN UI.


🧠 Overview

ShopHub enables buyers and sellers to interact seamlessly on a secure, scalable platform.
The project is divided into two main parts the client (frontend) and the server (backend), both connected through RESTful APIs and a shared MongoDB database.


🌐 Live Demo

πŸ”— ShopHub Live Website


πŸš€ Key Features

πŸ‘€ Buyer Features

  • Browse and search products by category, price, or popularity
  • Add products to cart and wishlist
  • Secure checkout with order tracking
  • Integrated payment gateway (Stripe/PayPal)
  • Review and rate purchased items
  • Real-time chat with sellers
  • Responsive dark mode interface

πŸͺ Seller Features

  • Seller account registration and verification
  • Manage products (create, update, delete)
  • Access a detailed sales dashboard
  • Track orders and fulfillment
  • Chat directly with buyers
  • View analytics and manage promotions

βš™οΈ Admin Features (if implemented)

  • Manage users, sellers, and products
  • Approve new sellers
  • Monitor platform transactions
  • Access reports and system logs

🧠 Tech Stack

Layer Technology
Frontend React (TypeScript), Vite, ShadCN UI, Tailwind CSS
Backend Node.js, Express.js
Database MongoDB (Mongoose)
Authentication JWT-based Auth + Role-Based Access Control (RBAC)
Payment Integration Stripe / PayPal
State Management Context API / Redux Toolkit
Image Uploads Cloudinary
Email Notifications Nodemailer
Deployment Vercel (Frontend), Render / Railway (Backend), MongoDB Atlas

🧩 Project Structure

ShopHub/

β”œβ”€β”€ Frontend/
β”‚ β”œβ”€β”€ index.html
β”‚ β”œβ”€β”€ package.json
β”‚ β”œβ”€β”€ vite.config.ts
β”‚ β”œβ”€β”€ README.md
β”‚ β”œβ”€β”€ public/
β”‚ └── src/
β”‚ β”œβ”€β”€ App.tsx
β”‚ β”œβ”€β”€ main.tsx
β”‚ β”œβ”€β”€ index.css
β”‚ β”œβ”€β”€ components/
β”‚ β”‚ └── pages/
β”‚ β”œβ”€β”€ lib/
β”‚ └── styles/
β”œβ”€β”€ Backend/
β”‚ β”œβ”€β”€ index.js
β”‚ β”œβ”€β”€ package.json
β”‚ β”œβ”€β”€ .env.example
β”‚ β”œβ”€β”€ models/
β”‚ β”œβ”€β”€ controllers/
β”‚ β”œβ”€β”€ routes/
β”‚ β”œβ”€β”€ config/
β”‚ └── middleware/
└── README.md


🧩 Explanation

client/

Handles everything related to the user interface. Built with React, TypeScript, TailwindCSS, and ShadCN.
It includes reusable UI components, page views, and global state management through context or Redux.

server/

Manages all backend operations β€” authentication, database interactions, and API routes.
Built using Node.js, Express, and MongoDB with Mongoose ODM.

.env.example

Template for environment variables required to run the app. Copy this file to .env and fill in your own credentials.

README.md

Contains project overview, setup instructions, and documentation.

package.json (root)

Defines project-level scripts and dependencies for managing both client and server together (optional).


βš™οΈ Typical Development Workflow

  1. Frontend:

    • Navigate to /client
    • Run npm run dev to start the React development server
  2. Backend:

    • Navigate to /server
    • Run npm run dev to start the Express server
  3. Environment Setup:

    • Create a .env file in /server using the .env.example template
    • Add your database connection string, JWT secret, Stripe key, etc.
  4. Access App:

    • Open frontend in browser β†’ http://localhost:8080
    • Backend runs on β†’ http://localhost:5000

πŸ“¦ Notes

  • Frontend and backend are independent but communicate through REST APIs.
  • MongoDB Atlas is used as the main database.
  • Environment variables control configuration and secrets.
  • The code is modular and scalable, suitable for enterprise-level e-commerce solutions.


βš™οΈ Installation

1️⃣ Clone the repository

git clone https://github.com/yourusername/shophub.git
cd shophub

2️⃣ Install dependencies

Frontend

cd frontend
npm install

Backend

cd Backend
npm install

3️⃣ Environment configuration

Create a .env file in the backend/ directory with the following:

MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
STRIPE_SECRET_KEY=your_stripe_key
CLOUDINARY_URL=your_cloudinary_url
PORT=5000

4️⃣ Run the app locally

both frontend and backend

npm run dev

App runs on:

πŸ‘‰ Frontend: http://localhost:3000

πŸ‘‰ Backend: http://localhost:5000

πŸ’³ Payment Flow

1️⃣ Buyer adds items to cart

2️⃣ Checkout initializes a Stripe/PayPal payment session

3️⃣ Backend verifies transaction and updates order status

5️⃣ Confirmation email sent after successful payment

πŸ” Security Highlights

1️⃣ JWT-based authentication

2️⃣ Role-based access control (RBAC)

3️⃣ Input validation and sanitization

4️⃣ Secure HTTP headers and CORS configuration

5️⃣ Centralized error handling middleware

πŸ“ˆ Future Enhancements

1️⃣ AI-powered product recommendation system

2️⃣ Multi-language and multi-currency support

3️⃣ Seller verification system

4️⃣ Mobile app (React Native)

5️⃣ Advanced analytics dashboard

🀝 Contributing

Contributions are welcome and appreciated!

To contribute:

Fork the repo

Create your feature branch (git checkout -b feature-name)

Commit changes (git commit -m "Add new feature")

Push to branch (git push origin feature-name)

Submit a pull request

πŸ§‘β€πŸ’» Developed By

Metasebiyaw Asfaw

Software Engineer | Full-Stack Developer

πŸ“§ metasebiyawasfaw@gmail.com 🌐 Portifolio

πŸͺͺ License

This project is licensed under the MIT License see the LICENSE file for details.

⭐ If you found this project useful, please give it a star it helps others discover it!

About

A comprehensive eCommerce web application built with a modern tech stack, featuring product listings, shopping cart, order management, user authentication, and secure payment integration. Designed for scalability, performance, and an intuitive shopping experience for both customers and administrators.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published