Skip to content

xaden1/vendorpay

Repository files navigation

πŸ’³ VendorPay

Instant QR Payments for Street Vendors & Small Businesses β€” Built on Stellar

Live Demo Stellar Testnet Tests License


"Get paid in seconds. No bank required."


πŸš€ Live Demo

https://stellarmind-azure.vercel.app


πŸ“Έ Screenshots

Wallet Connected State

image

Payment Dashboard

image

Analytics Dashboard

image

Transaction Id

image

πŸ“– What is VendorPay?

VendorPay is a 100% frontend dApp on the Stellar Testnet that gives any small business β€” street vendors, freelancers, market stalls, local shops β€” a complete digital point-of-sale system in under 60 seconds.

No bank account. No card machine. No backend server. Just a Stellar wallet and a QR code.

The flow is simple:

  1. Connect your Freighter wallet
  2. Build your product catalog with local currency prices
  3. Tap a product β†’ a dynamic QR code is generated
  4. Customer scans the QR β†’ pays with their Stellar wallet
  5. Payment appears on your screen in real time
  6. Digital receipt generated automatically

VendorPay is built for the 1.4 billion people globally who live without access to traditional banking infrastructure β€” but have a smartphone.



✨ Features

Feature Description
πŸ“² Smart QR Codes SEP-0007 payment URI with amount + memo baked in β€” not just a static address
⚑ Live Payment Stream Horizon EventSource streams payments in real time β€” screen flashes green instantly
πŸͺ Product Catalog Build a full menu/catalog with local currency pricing (INR/USD/NGN/KES/EUR)
πŸ’± Live FX Conversion XLM price fetched from Stellar DEX; prices shown in local currency automatically
πŸ“ˆ Analytics Dashboard 30-day revenue chart, peak hours heatmap, unique customer count
πŸ† Business Score On-chain credit score (0–100) from payment volume, consistency, and reach
🧾 Digital Receipts Auto-generated printable receipt for every payment with Stellar Explorer link
πŸŽ‰ Payment Celebrations Ripple animation + confetti burst the moment payment is confirmed

πŸ—οΈ Architecture

VendorPay has zero backend. Every call goes directly from the React app running in the browser:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      User's Browser                          β”‚
β”‚                                                              β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚   β”‚   Freighter  β”‚    β”‚        React App (VendorPay)     β”‚  β”‚
β”‚   β”‚  Extension   │◄──►│                                  β”‚  β”‚
β”‚   β”‚  (Wallet)    β”‚    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  β”‚  Horizon   β”‚ β”‚  Soroban    β”‚  β”‚  β”‚
β”‚                        β”‚  β”‚  Hook      β”‚ β”‚  Contract   β”‚  β”‚  β”‚
β”‚                        β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚               β”‚
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚    Stellar    β”‚   β”‚    Soroban RPC     β”‚
                     β”‚  Horizon API  β”‚   β”‚  (testnet.stellar) β”‚
                     β”‚  (testnet)    β”‚   β”‚                    β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Layer Technology
Frontend React 18 + Vite
Styling Tailwind CSS + custom CSS animations
Animations Framer Motion
Charts Recharts
Wallet @stellar/freighter-api
Blockchain @stellar/stellar-sdk + Stellar Horizon Testnet API
Smart Contract Soroban (Rust) on Stellar Testnet
QR Codes qrcode.react
Testing Vitest + @testing-library/react
Routing React Router v6
Deployment Vercel

πŸš€ Getting Started

Prerequisites

Get a Testnet Wallet (5 minutes)

  1. Install Freighter β†’ create a wallet
  2. In Freighter settings β†’ switch network to Testnet
  3. Go to Stellar Laboratory Friendbot
  4. Click "Generate Keypair" β†’ copy your Public Key
  5. Click "Fund with Friendbot" β†’ you now have 10,000 testnet XLM
  6. Import this address into Freighter

Installation

# Clone the repository
git clone https://github.com/YOUR_USERNAME/vendorpay
cd vendorpay

# Install dependencies
npm install

# Copy environment variables
cp .env.example .env

# Start development server
npm run dev

Environment Variables

VITE_HORIZON_URL=https://horizon-testnet.stellar.org
VITE_SOROBAN_RPC=https://soroban-testnet.stellar.org
VITE_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
VITE_CONTRACT_ID=your_deployed_contract_id_here

πŸ§ͺ Tests

# Run all tests
npm run test

# Run with visual UI
npm run test:ui

# Run once (CI mode)
npm run test:run

Test Output

βœ“ src/tests/formatters.test.js (6 tests)
  βœ“ truncates a Stellar address correctly
  βœ“ formats XLM amounts correctly
  βœ“ converts local currency to XLM
  βœ“ formats USD from XLM amount
  βœ“ generates a valid payment memo
  βœ“ handles empty address gracefully

βœ“ src/tests/businessScore.test.js (4 tests)
  βœ“ returns zero score for empty data
  βœ“ calculates a positive score for active wallet
  βœ“ has correct breakdown structure
  βœ“ score does not exceed 100

βœ“ src/tests/errorHandler.test.js (6 tests)
  βœ“ identifies wallet not found error
  βœ“ identifies insufficient funds error
  βœ“ identifies network error
  βœ“ identifies user rejection
  βœ“ handles unknown errors gracefully
  βœ“ handles null/undefined errors

Test Files  3 passed (3)
Tests       16 passed (16)
Duration    1.23s

πŸ“œ Smart Contract

VendorPay uses a VendorRegistry Soroban smart contract deployed on Stellar Testnet.

What the contract does:

  • register_vendor(address, name, category) β€” registers a vendor on-chain
  • record_payment(vendor, amount, memo) β€” logs each payment to the ledger
  • get_vendor(address) β€” retrieves vendor info and stats
  • is_registered(address) β€” checks if a vendor exists
  • vendor_count() β€” returns total registered vendors


πŸ“ Project Structure

vendorpay/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/        # UI components (QRModal, PaymentNotification, etc.)
β”‚   β”œβ”€β”€ pages/             # Route pages (Dashboard, Catalog, Analytics, etc.)
β”‚   β”œβ”€β”€ hooks/             # Custom React hooks (useWallet, useBalance, etc.)
β”‚   β”œβ”€β”€ utils/             # Utilities (horizonClient, stellarTx, errorHandler, etc.)
β”‚   β”œβ”€β”€ tests/             # Vitest test files
β”‚   └── context/           # Global app state (AppContext)
β”œβ”€β”€ contracts/
β”‚   └── vendor_registry/   # Soroban smart contract (Rust)
β”œβ”€β”€ public/
β”œβ”€β”€ .env.example
β”œβ”€β”€ README.md
└── ARCHITECTURE.md

πŸ—ΊοΈ Pages

Route Page Description
/ Landing Hero, features, how it works
/dashboard Dashboard QR generator, balance, live stream
/catalog Catalog Product/service catalog manager
/analytics Analytics Revenue chart, business score
/transactions Transactions Full payment history
/send Send Payment Direct XLM send with full feedback

πŸ”„ Transaction Flow

User clicks "Send" / "Generate QR"
         β”‚
         β–Ό
  useTransaction hook
         β”‚
         β–Ό
  Status: SIGNING ──► "Waiting for Freighter..."
         β”‚
         β–Ό (user approves in extension)
  Status: SUBMITTING ──► Progress bar animation
         β”‚
         β–Ό (Horizon confirms)
  Status: SUCCESS ──► tx hash + confetti
         β”‚
         └──► (on error) Status: FAILED ──► specific error + action

🚒 Deployment

Deploy to Vercel

# Push to GitHub
git push origin main

# On vercel.com:
# New Project β†’ Import from GitHub β†’ Configure:

# Environment Variables:
VITE_HORIZON_URL = https://horizon-testnet.stellar.org
VITE_SOROBAN_RPC = https://soroban-testnet.stellar.org
VITE_NETWORK_PASSPHRASE = Test SDF Network ; September 2015
VITE_CONTRACT_ID = your_contract_id

# Deploy β†’ Live URL ready in ~30 seconds

No server configuration needed. Vercel serves VendorPay as a static site.


🀝 Contributing

  1. Fork the repo
  2. Create a feature branch: git checkout -b feat/amazing-feature
  3. Commit: git commit -m 'feat: add amazing feature'
  4. Push: git push origin feat/amazing-feature
  5. Open a Pull Request

🌍 Real World Impact

VendorPay targets markets where:

  • 40%+ of adults are unbanked (Sub-Saharan Africa, South Asia)
  • Card terminals cost $200–$500 to set up
  • Payment processor fees eat 2–5% of every transaction
  • Remittance fees run 5–10% per transfer

With VendorPay + Stellar, a street vendor needs only:

  • A smartphone (any Android/iOS)
  • A printed QR code (or screen)
  • A Stellar wallet (free, 1 minute to set up)

Transaction fees on Stellar: 0.00001 XLM (~$0.000001). That's it.


πŸ“„ License

MIT License β€” see LICENSE for details.


About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors