Skip to content

MRSE435/ecomfrontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ ShopEase

Full Stack E-Commerce Platform with Web3 Crypto Payments

Live Demo Frontend Backend


A production-deployed full stack e-commerce platform featuring session authentication, dynamic product catalogue, shopping cart with cross-tab sync, and a dual payment system β€” pay with RazorPay or directly with Solana crypto wallet.


πŸ“Έ Screenshots

πŸ” Login

Login


πŸ“ Register

Register


🏠 Home β€” Product Catalogue

Home


πŸ“± Home β€” Mobile Responsive

Home Responsive


πŸ›’ Shopping Cart

Cart


πŸ“± Cart β€” Mobile Responsive

Cart Responsive


πŸ’° Checkout β€” Dual Payment System

Checkout


⛓️ Web3 Solana Payment Flow

The most unique feature of ShopEase β€” real blockchain crypto payments in a standard e-commerce app

Step 1 β€” Connect Your Wallet

Select Wallet

User clicks "Connect Wallet" β†’ modal shows Phantom (Detected) and Solflare options


Step 2 β€” Confirm Transaction in Phantom

Pay Phantom

Phantom extension opens β†’ displays network, fee, and domain β†’ user clicks Confirm to sign and broadcast the transaction on Solana


Step 3 β€” Payment Confirmed On-Chain βœ…

Transaction is signed, sent to Solana Devnet, confirmed by validators β†’ unique signature returned as receipt


✨ Full Feature List

Feature Details
πŸ” Authentication Session-based register/login/logout with secure httpOnly cookies
πŸ›οΈ Product Catalogue Products fetched dynamically from MongoDB
πŸ›’ Shopping Cart Add, increment, decrement, delete items with live total
πŸ”„ Cross-Tab Sync Cart updates instantly across all open browser tabs via BroadcastChannel API
πŸ’³ RazorPay Traditional payment gateway integration
⛓️ Solana Web3 Connect Phantom or Solflare β€” pay with real SOL on blockchain
πŸ”’ Protected Routes Auth guard redirects unauthenticated users to login
πŸ“± Fully Responsive Tested on mobile, tablet, and desktop
🌐 Custom Domain Live at shopease.mrse435.world with DNS configured on GoDaddy

πŸš€ Tech Stack

Frontend

React TailwindCSS React Router Vite

Backend

Node.js Express MongoDB

Web3 / Blockchain

Solana

@solana/web3.js @solana/wallet-adapter-react PhantomWalletAdapter SolflareWalletAdapter

DevOps & Deployment

Render GoDaddy


πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      FRONTEND                        β”‚
β”‚            React + Vite + Tailwind CSS               β”‚
β”‚        shopease.mrse435.world  (Render CDN)          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚  HTTP REST API
                      β”‚  credentials: include  (cookies)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      BACKEND                         β”‚
β”‚               Node.js + Express.js                   β”‚
β”‚           ecombackend-gso3.onrender.com              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚  Mongoose ODM
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    DATABASE                          β”‚
β”‚                 MongoDB Atlas                        β”‚
β”‚       Collections: users β”‚ products β”‚ carts          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               WEB3 PAYMENT LAYER                     β”‚
β”‚                                                      β”‚
β”‚  1. User connects Phantom or Solflare wallet         β”‚
β”‚  2. Transaction built using @solana/web3.js          β”‚
β”‚  3. User signs in Phantom browser extension          β”‚
β”‚  4. Transaction broadcast to Solana Devnet           β”‚
β”‚  5. Confirmed by network validators                  β”‚
β”‚  6. Signature returned as payment receipt            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⛓️ Solana Payment β€” Code

// Step 1 β€” Wrap app with Solana providers
const network = WalletAdapterNetwork.Devnet
const endpoint = useMemo(() => clusterApiUrl(network), [network])
const wallets = useMemo(() => [
  new PhantomWalletAdapter(),
  new SolflareWalletAdapter()
], [])

// Step 2 β€” Build and send transaction
const transaction = new Transaction()
transaction.add(
  SystemProgram.transfer({
    fromPubkey: publicKey,                          // user's wallet
    toPubkey: new PublicKey("MERCHANT_ADDRESS"),    // store wallet
    lamports: 0.01 * LAMPORTS_PER_SOL              // 0.01 SOL
  })
)

// Step 3 β€” Sign in Phantom and confirm on-chain
const signature = await sendTransaction(transaction, connection)
await connection.confirmTransaction(signature, 'confirmed')
// signature = unique blockchain receipt for this payment

πŸ”„ Cross-Tab Cart Sync β€” Code

// After every cart change β€” broadcast to all open tabs
const cartChannel = new BroadcastChannel('cart_sync')
cartChannel.postMessage('update')

// Every open tab listens and re-fetches cart automatically
cartChannel.addEventListener('message', () => fetchcart())

🌐 API Endpoints

Method Endpoint Description Auth Required
POST /api/register Register new user ❌
POST /api/login Login and create session ❌
POST /api/logout Destroy session ❌
GET /api/checkauth Verify session status ❌
GET /api/products Get all products βœ…
GET /api/fetchcart Get user's cart (populated) βœ…
POST /api/handlecart Add / increment cart item βœ…
POST /api/decrementcart Decrement item quantity βœ…
POST /api/deleteitemfromcart Remove item from cart βœ…

βš™οΈ Local Setup Guide

Prerequisites

Node.js v18+
MongoDB Atlas account (free tier works)
Phantom wallet browser extension

1. Clone Both Repos

git clone https://github.com/MRSE435/ecomfrontend
git clone https://github.com/MRSE435/ecombackend

2. Backend Setup

cd ecombackend
npm install

Create .env file:

DATABASE_URL=your_mongodb_atlas_uri
PORT=3000
NODE_ENV=development
node index.js
# βœ… Server running at http://localhost:3000
# βœ… database connection successfully

3. Frontend Setup

cd ecomfrontend
npm install

Create .env file:

VITE_API_URL=http://localhost:3000
npm run dev
# βœ… App running at http://localhost:5173

4. Test Solana Payments Locally

1. Install Phantom from https://phantom.app
2. Create a new wallet
3. Go to Settings β†’ Developer Settings β†’ Switch to Devnet
4. Get free test SOL from https://faucet.solana.com
5. Connect wallet on the checkout page and test payment

πŸ“ Project Structure

ecomfrontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx           ← navigation bar
β”‚   β”‚   β”œβ”€β”€ CardsComponent.jsx   ← product grid
β”‚   β”‚   β”œβ”€β”€ cart.jsx             ← shopping cart
β”‚   β”‚   β”œβ”€β”€ Checkout.jsx         ← checkout + dual payments
β”‚   β”‚   β”œβ”€β”€ login.jsx            ← login form
β”‚   β”‚   β”œβ”€β”€ register.jsx         ← register form
β”‚   β”‚   β”œβ”€β”€ Solbutton.jsx        ← Solana wallet providers wrapper
β”‚   β”‚   └── protectedroute.jsx   ← auth guard
β”‚   β”œβ”€β”€ App.jsx                  ← global state + routes
β”‚   └── main.jsx
β”œβ”€β”€ .env                         ← never commit this
└── .gitignore

ecombackend/
β”œβ”€β”€ index.js      ← Express server + all API routes + MongoDB schemas
β”œβ”€β”€ public/       ← product images served statically
β”œβ”€β”€ .env          ← never commit this
└── .gitignore

🌟 What Makes This Project Stand Out

⭐ Real Solana Web3 payments    β€” most students never touch blockchain
⭐ Dual payment system          β€” RazorPay + Solana in same app
⭐ Cross-tab cart sync          β€” production-level BroadcastChannel pattern
⭐ Secure cookie auth           β€” httpOnly + secure + sameSite configured
⭐ Custom domain live           β€” shopease.mrse435.world with DNS setup
⭐ Fully responsive             β€” mobile and desktop tested
⭐ Protected routes             β€” proper auth guards on frontend
⭐ Production deployed          β€” real live app, not just localhost

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

Mohammed Owais

*BCA Student β€” Presidency College, Bangalore |

GitHub LinkedIn Portfolio


If you found this project interesting, please consider giving it a ⭐

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors