A modern, full-stack e-commerce web application built with React, Node.js, Express, and PostgreSQL.
- ποΈ Product Browsing - Search, filter by category, view detailed product information
- π Shopping Cart - Add/remove items, adjust quantities, persistent cart storage
- π User Authentication - Secure JWT-based login and registration with bcrypt password hashing
- π³ Payment Processing - Integrated Stripe Checkout for secure transactions
- π± Responsive Design - Mobile-first UI built with Tailwind CSS
- π¨ Modern UI/UX - Clean, professional interface with smooth animations
- React 18 - Component-based UI library
- Vite - Fast build tool and dev server
- React Router - Client-side routing
- Zustand - Lightweight state management
- Tailwind CSS - Utility-first styling
- Axios - HTTP client
- Lucide React - Icon library
- Node.js - JavaScript runtime
- Express.js - Web framework
- PostgreSQL - Relational database
- JWT - Token-based authentication
- bcrypt - Password hashing
- Stripe API - Payment processing
- express-validator - Input validation
shophub-complete/
βββ backend/ # Node.js/Express backend
β βββ routes/ # API route handlers
β βββ middleware/ # Auth & validation middleware
β βββ db.js # Database connection
β βββ server.js # Server entry point
β βββ schema.sql # Database schema
β
βββ frontend/ # React frontend
βββ src/
β βββ components/ # Reusable components
β βββ pages/ # Page components
β βββ services/ # API services
β βββ store/ # Zustand stores
βββ public/ # Static assets
- Node.js (v16 or higher)
- PostgreSQL (v12 or higher)
- npm or yarn
- Stripe account (for payments)
git clone https://github.com/Munun/shophub.git
cd shophub# Create PostgreSQL database
createdb shophub
# Run schema
psql shophub < backend/schema.sqlBackend (.env):
cd backend
cp .env.example .envEdit .env:
PORT=5001
DB_USER=your_db_user
DB_HOST=localhost
DB_NAME=shophub
DB_PASSWORD=your_db_password
DB_PORT=5432
JWT_SECRET=your_super_secret_jwt_key_change_this
STRIPE_SECRET_KEY=your_stripe_secret_key
CLIENT_URL=http://localhost:5173
Frontend (.env):
cd frontend
cp .env.example .envEdit .env:
VITE_API_URL=http://localhost:5001/api
VITE_STRIPE_PUBLIC_KEY=your_stripe_public_key
Backend:
cd backend
npm installFrontend:
cd frontend
npm installBackend (Terminal 1):
cd backend
npm run devServer runs on http://localhost:5001
Frontend (Terminal 2):
cd frontend
npm run devApp runs on http://localhost:5173
-
Register/Login - Create an account or use demo credentials:
- Email:
test@example.com - Password:
password123
- Email:
-
Browse Products - Search and filter by category
-
Add to Cart - Select size (if applicable) and quantity
-
Checkout - Complete purchase with Stripe test card:
- Card:
4242 4242 4242 4242 - Expiry: Any future date
- CVC: Any 3 digits
- Card:
users
βββ id (PRIMARY KEY)
βββ email (UNIQUE)
βββ password_hash
βββ full_name
βββ created_at
products
βββ id (PRIMARY KEY)
βββ name
βββ description
βββ price
βββ category
βββ stock_quantity
βββ sizes (ARRAY)
orders
βββ id (PRIMARY KEY)
βββ user_id (FOREIGN KEY)
βββ total_amount
βββ status
βββ stripe_payment_id
order_items
βββ id (PRIMARY KEY)
βββ order_id (FOREIGN KEY)
βββ product_id (FOREIGN KEY)
βββ quantity
βββ price_at_purchase- β Password hashing with bcrypt (10 salt rounds)
- β JWT authentication with HTTP-only recommendations
- β SQL injection prevention with parameterized queries
- β Input validation with express-validator
- β CORS configuration
- β Stripe handles all sensitive payment data
Munun Patel
- Email: Patel.mun25@gmail.com
- LinkedIn: linkedin.com/in/munun
- GitHub: @Munun
- Stripe for payment processing
- Tailwind CSS for styling
- Lucide for icons
- PostgreSQL community
β If you found this project helpful, please give it a star!