MCPayStream π β Real-Time YouTube SuperChat on Solana
Live Blockchain Analytics Platform for Solana
A real-time dashboard for monitoring Solana wallet transactions, earnings, and analytics with live blockchain data integration.
- Live Blockchain Data - Real-time SOL balance and transaction monitoring
- Daily Analytics - Track daily SOL received and transaction counts
- Top Senders/Wallets - See who's sending SOL and transaction details
- Earnings Charts - Visualize earnings over time with live data
- Real-time Updates - WebSocket-powered live updates without page refresh
- Devnet Testing - Full Solana Devnet integration for testing
- Modern UI - Sleek black theme with responsive design
- Frontend: React + Vite + Tailwind CSS
- Backend: Node.js + Express + Socket.IO
- Database: PostgreSQL with Prisma ORM
- Blockchain: Solana Web3.js integration
- Real-time: WebSocket connections for live updates
- Deployment: Ready for production deployment
- Node.js 18+
- PostgreSQL database
- Solana CLI (optional, for testing)
git clone <your-repo-url>
cd MCPayStream
# Install frontend dependencies
npm install
# Install backend dependencies
cd backend
npm install
cd ..
Copy the environment template and configure:
cd backend
cp env.template .env
Update .env
with your configuration:
# Server Configuration
NODE_ENV=development
PORT=5001
JWT_SECRET=your-super-secret-jwt-key-change-in-production
# CORS Configuration
CORS_ORIGIN=http://localhost:5173
# Database Configuration (Supabase/PostgreSQL)
DATABASE_URL="postgresql://postgres:password@localhost:5432/mcpaystream?schema=public"
# Solana Configuration (Devnet)
SOLANA_RPC_URL=https://api.devnet.solana.com
SOLANA_WS_URL=wss://api.devnet.solana.com
SOLANA_NETWORK=devnet
SOLANA_KEYPAIR_PATH=~/.config/solana/mcpaystream.json
# CoinGecko API
COINGECKO_API_URL=https://api.coingecko.com/api/v3
COINGECKO_API_KEY=your-coingecko-api-key-optional
# Webhook Configuration
WEBHOOK_URL=your-webhook-url-here
WEBHOOK_SECRET=your-webhook-secret-here
# Logging
LOG_LEVEL=info
LOG_FILE=logs/app.log
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
- Create a Supabase project at supabase.com
- Get your database connection string
- Update
DATABASE_URL
in.env
- Run database migrations:
cd backend
npx prisma migrate deploy
npx prisma generate
# Install PostgreSQL locally
brew install postgresql # macOS
sudo apt-get install postgresql # Ubuntu
# Create database
createdb mcpaystream
# Run migrations
cd backend
npx prisma migrate deploy
npx prisma generate
# Terminal 1: Start Backend
cd backend
npm run dev
# Terminal 2: Start Frontend
npm run dev
Visit: http://localhost:5173 (or the port Vite assigns)
# Install Solana CLI
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
# Restart terminal or reload shell
source ~/.bashrc # or source ~/.zshrc
# Switch to Devnet
solana config set --url https://api.devnet.solana.com
# Verify configuration
solana config get
# Generate main test wallet
solana-keygen new --outfile ~/.config/solana/mcpaystream.json --no-bip39-passphrase
# Generate additional sender wallet
solana-keygen new --outfile ~/.config/solana/sender.json --no-bip39-passphrase
# Generate random test wallet
solana-keygen new --outfile ~/.config/solana/random1.json --no-bip39-passphrase
cd backend
npm run devnet:keypair
# Airdrop to main wallet
solana airdrop 2 -k ~/.config/solana/mcpaystream.json
# Airdrop to sender wallet
solana airdrop 1 -k ~/.config/solana/sender.json
# Airdrop to random wallet
solana airdrop 1 -k ~/.config/solana/random1.json
Visit Solana Devnet Faucet and enter your wallet address.
# View wallet address
solana address -k ~/.config/solana/mcpaystream.json
solana address -k ~/.config/solana/sender.json
# Check wallet balance
solana balance -k ~/.config/solana/mcpaystream.json
solana balance -k ~/.config/solana/sender.json
# Check any wallet balance (without keypair)
solana balance AWnVcuqiHSXxe4vLZVBxHPhKc6kzZWaCBTAvBqY5iDeQ
# Send 0.5 SOL to a specific address
solana transfer AWnVcuqiHSXxe4vLZVBxHPhKc6kzZWaCBTAvBqY5iDeQ 0.5 -k ~/.config/solana/mcpaystream.json
# Send 0.3 SOL to another address
solana transfer 9B5XszUGdMaxCZ7uSQhPzdks5ZQSmWxrmzCSvtJ6Ns6g 0.3 -k ~/.config/solana/mcpaystream.json
# Send from sender wallet to main wallet
solana transfer AWnVcuqiHSXxe4vLZVBxHPhKc6kzZWaCBTAvBqY5iDeQ 0.2 -k ~/.config/solana/sender.json
# Send to random address 1
solana transfer 9B5XszUGdMaxCZ7uSQhPzdks5ZQSmWxrmzCSvtJ6Ns6g 0.1 -k ~/.config/solana/mcpaystream.json
# Send to random address 2
solana transfer 56UjHEdHADpgc4Eqdzbk2HEVxpQQ2tdCwGptYAgTfXGe 0.2 -k ~/.config/solana/mcpaystream.json
# Send to random address 3
solana transfer D8FL9VwTjXgyLfvGwEZNyxUxyCTPXzcVnjhWPAZcgsS9 0.3 -k ~/.config/solana/mcpaystream.json
# Send to your own wallet (self-transfer)
solana transfer AWnVcuqiHSXxe4vLZVBxHPhKc6kzZWaCBTAvBqY5iDeQ 0.1 -k ~/.config/solana/mcpaystream.json
# View transaction history for a wallet
solana transaction-history AWnVcuqiHSXxe4vLZVBxHPhKc6kzZWaCBTAvBqY5iDeQ -k ~/.config/solana/mcpaystream.json
# Confirm a specific transaction
solana confirm -v 5xb8GeKpiaHS6TpLYPWjhhDCgdVbGAfpnCsPK1deUtxHbf2S4B2LdNzFnNgNk6kEKqaG5eb5bsaxC8zp61aH92ef
cd backend
# Generate keypair using our script
npm run devnet:keypair
# View wallet address
npm run devnet:address
# Check balance
npm run devnet:balance
# Send SOL (if you have our send script)
node test/send.mjs <RECIPIENT_ADDRESS> <AMOUNT>
- Input any Solana wallet address in the dashboard
- The system will fetch live blockchain data
- Real-time monitoring begins automatically
- Daily Received: Today's SOL received
- Total Received: All-time earnings
- Current Balance: Live wallet balance
- SOL Price: Current market price
- Transactions: Total transaction count
- Live transaction updates via WebSocket
- Automatic balance refresh
- Real-time earnings chart updates
- Live leaderboard updates
MCPayStream/
βββ src/ # Frontend React app
β βββ components/ # React components
β βββ context/ # React context providers
β βββ pages/ # Page components
β βββ utils/ # Utility functions
βββ backend/ # Node.js backend
β βββ src/ # Backend source code
β βββ prisma/ # Database schema & migrations
β βββ scripts/ # Utility scripts
β βββ logs/ # Application logs
βββ shared/ # Shared utilities
βββ README.md # This file
backend/src/index.js
- Express server setupbackend/src/socket.js
- WebSocket configurationbackend/src/controllers/
- API controllersbackend/src/models/
- Database modelsbackend/src/blockchain/
- Solana integrationbackend/src/services/
- Business logic services
src/pages/Dashboard.jsx
- Main dashboardsrc/context/WalletContext.jsx
- Wallet state managementsrc/components/
- Reusable componentssrc/utils/
- Utility functions
The application uses Prisma with the following main models:
- Creator - Wallet owners and their metadata
- Transaction - All blockchain transactions
- Analytics - Computed statistics and metrics
Update .env
for production:
NODE_ENV=production
DATABASE_URL=your-production-postgresql-url
JWT_SECRET=your-production-jwt-secret
CORS_ORIGIN=your-frontend-domain
# Frontend
npm run build
# Backend
cd backend
npm run build
-
CORS Errors
- Ensure
CORS_ORIGIN
matches your frontend URL - Check backend is running on correct port
- Ensure
-
Database Connection
- Verify
DATABASE_URL
is correct - Ensure PostgreSQL is running
- Run
npx prisma migrate deploy
- Verify
-
Solana Connection
- Check
SOLANA_RPC_URL
is accessible - Verify network is set to
devnet
- Test with
npm run devnet:balance
- Check
-
Real-time Updates Not Working
- Check WebSocket connection in browser console
- Verify Socket.IO server is running
- Check for firewall/network issues
-
Airdrop Rate Limited
- Use web faucet: https://faucet.solana.com
- Wait a few minutes between airdrops
- Try smaller amounts (0.5 SOL instead of 2 SOL)
-
Transaction Not Appearing
- Check if transaction is incoming (not outgoing)
- Verify wallet address is correct
- Check transaction status with
solana confirm
# Backend with debug logging
cd backend
LOG_LEVEL=debug npm run dev
# Frontend with debug info
npm run dev
GET /api/wallets/:address
- Get wallet dataPOST /api/wallets
- Create wallet
GET /api/transactions/:address
- Get transactionsGET /api/transactions/:address/stats
- Get transaction statsPOST /api/transactions/refresh/:address
- Refresh transactions
GET /api/stats/earnings/:address
- Get earnings dataGET /api/stats/top-senders
- Get top sendersGET /api/stats/leaderboard
- Get leaderboard
transaction-update
- New transaction receivedbalance-update
- Balance changedearnings-update
- Earnings updatedleaderboard-update
- Leaderboard changed
# Setup
solana config set --url https://api.devnet.solana.com
solana-keygen new --outfile ~/.config/solana/mcpaystream.json --no-bip39-passphrase
# Get SOL
solana airdrop 2 -k ~/.config/solana/mcpaystream.json
# Check balance
solana balance -k ~/.config/solana/mcpaystream.json
# Send SOL
solana transfer <RECIPIENT> <AMOUNT> -k ~/.config/solana/mcpaystream.json
# View address
solana address -k ~/.config/solana/mcpaystream.json
# Generate sender wallet
solana-keygen new --outfile ~/.config/solana/sender.json --no-bip39-passphrase
# Send from sender to main wallet
solana transfer <MAIN_WALLET_ADDRESS> 0.5 -k ~/.config/solana/sender.json
# Check transaction
solana confirm -v <TRANSACTION_SIGNATURE>
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request