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.
The most unique feature of ShopEase β real blockchain crypto payments in a standard e-commerce app
User clicks "Connect Wallet" β modal shows Phantom (Detected) and Solflare options
Phantom extension opens β displays network, fee, and domain β user clicks Confirm to sign and broadcast the transaction on Solana
Transaction is signed, sent to Solana Devnet, confirmed by validators β unique signature returned as receipt
| 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 |
@solana/web3.js @solana/wallet-adapter-react PhantomWalletAdapter SolflareWalletAdapter
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// 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// 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())| 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 | β |
Node.js v18+
MongoDB Atlas account (free tier works)
Phantom wallet browser extension
git clone https://github.com/MRSE435/ecomfrontend
git clone https://github.com/MRSE435/ecombackendcd ecombackend
npm installCreate .env file:
DATABASE_URL=your_mongodb_atlas_uri
PORT=3000
NODE_ENV=developmentnode index.js
# β
Server running at http://localhost:3000
# β
database connection successfullycd ecomfrontend
npm installCreate .env file:
VITE_API_URL=http://localhost:3000npm run dev
# β
App running at http://localhost:51731. 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
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
β 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








