A modern live streaming platform where users can broadcast video/audio content and earn money through tips and donations.
- Live Video/Audio Streaming - Broadcast live content to your audience
- Real-time Viewer Count - See how many people are watching
- Earning System - Receive tips and donations during streams
- User Authentication - Google OAuth via Emergent Auth
- Payment Processing - Secure payments via Stripe
- User Profiles - Track earnings, streams, and transactions
- Stream Discovery - Browse live and available streams
- Viewers - Watch streams, send tips
- Streamers - Create and broadcast streams, earn money
- FastAPI - Modern Python web framework
- MongoDB - NoSQL database
- Socket.IO - Real-time WebSocket communication
- Stripe - Payment processing
- Emergent Auth - Google OAuth integration
- React 19 - UI framework
- Socket.IO Client - Real-time communication
- Axios - HTTP client
- Tailwind CSS - Styling
- WebRTC - Video/audio streaming
- MongoDB running on localhost:27017
- Node.js and Yarn installed
- Python 3.8+ installed
Backend (.env)
MONGO_URL="mongodb://localhost:27017"
DB_NAME="test_database"
CORS_ORIGINS="*"
STRIPE_API_KEY=sk_test_emergent
Frontend (.env)
REACT_APP_BACKEND_URL=https://instant-view-7.preview.emergentagent.com
WDS_SOCKET_PORT=443
ENABLE_HEALTH_CHECK=false
- Install Backend Dependencies
cd /app/backend
pip install -r requirements.txt- Install Frontend Dependencies
cd /app/frontend
yarn install- Start Services
sudo supervisorctl restart all-
Sign In
- Visit the landing page
- Click "Get Started with Google"
- Authenticate with your Google account
-
Browse Streams
- View live streams on the dashboard
- Click on any live stream to watch
-
Send Tips
- While watching a stream, click "Send Tip"
- Choose or enter an amount (minimum $1)
- Complete payment via Stripe
-
Become a Streamer
- Sign in as a viewer
- Click "Become a Streamer" on the dashboard
-
Create a Stream
- Click "Create Stream" button
- Enter stream title and description
- Submit to create
-
Go Live
- Navigate to your stream
- Click "π΄ Go Live"
- Allow camera and microphone access
- Start broadcasting!
-
Manage Stream
- View real-time viewer count
- Monitor earnings
- End stream when done
-
Track Earnings
- Check balance in the navbar
- View detailed transaction history in Profile
users
{
user_id: "user_xxx",
email: "user@example.com",
name: "User Name",
picture: "https://...",
role: "viewer" | "streamer",
balance: 0.0,
total_earned: 0.0,
created_at: ISODate
}user_sessions
{
user_id: "user_xxx",
session_token: "token_xxx",
expires_at: ISODate,
created_at: ISODate
}streams
{
stream_id: "stream_xxx",
streamer_id: "user_xxx",
streamer_name: "Streamer Name",
title: "Stream Title",
description: "Description",
status: "offline" | "live" | "ended",
viewers: 0,
total_earnings: 0.0,
started_at: ISODate,
ended_at: ISODate,
created_at: ISODate
}transactions
{
transaction_id: "txn_xxx",
from_user_id: "user_xxx",
to_user_id: "user_xxx",
stream_id: "stream_xxx",
amount: 5.0,
currency: "usd",
type: "tip",
status: "pending" | "completed" | "failed",
stripe_session_id: "cs_xxx",
payment_status: "paid",
created_at: ISODate
}POST /api/auth/session- Exchange session_id for user dataGET /api/auth/me- Get current userPOST /api/auth/logout- Logout
GET /api/user/profile- Get user profile with statsPOST /api/user/become-streamer- Upgrade to streamer
POST /api/streams- Create new streamGET /api/streams/live- Get all live streamsGET /api/streams/all- Get all streamsGET /api/streams/{stream_id}- Get stream by IDPOST /api/streams/{stream_id}/start- Start streamingPOST /api/streams/{stream_id}/stop- Stop streaming
POST /api/payments/tip/checkout- Create tip checkout sessionGET /api/payments/status/{session_id}- Check payment statusPOST /api/webhook/stripe- Stripe webhook handler
Client β Server
join_stream- Join a stream roomleave_stream- Leave a stream roomwebrtc_offer- Send WebRTC offerwebrtc_answer- Send WebRTC answerwebrtc_ice_candidate- Send ICE candidate
Server β Client
stream_started- Stream went livestream_ended- Stream endedviewer_count- Updated viewer counttip_received- New tip notificationwebrtc_offer- Forward WebRTC offerwebrtc_answer- Forward WebRTC answerwebrtc_ice_candidate- Forward ICE candidate
- Google OAuth via Emergent Auth
- HTTPOnly cookies for session management
- 7-day session expiration
- Server-side session validation
- Stripe for secure payment processing
- Server-side amount validation (prevent frontend manipulation)
- Transaction status tracking
- Webhook verification
- Peer-to-peer video streaming
- Socket.IO for signaling
- STUN/TURN server support ready
- Dark theme - Modern, eye-friendly interface
- Responsive design - Works on all devices
- Real-time updates - Live viewer counts and notifications
- Smooth animations - Professional UI transitions
- Gradient accents - Beautiful purple/pink gradient theme
- Hero section with clear value proposition
- Feature highlights
- Single CTA button for Google sign-in
- User balance prominently displayed
- Quick access to profile and logout
- Role-specific sections (streamer/viewer)
- Live stream discovery grid
- Clean video player
- Stream controls
- Real-time stats sidebar
- Viewer interaction
- Immersive watch page
- Easy tipping interface
- Stream information sidebar
- Real-time viewer count
- Chat functionality
- Stream recording and replay
- Subscription tiers
- Advanced analytics
- Mobile app
- Stream scheduling
- Multi-streaming
- Emotes and reactions
- Follower system
- Notifications
# Check backend logs
tail -f /var/log/supervisor/backend.err.log
# Restart backend
sudo supervisorctl restart backend# Check frontend logs
tail -f /var/log/supervisor/frontend.err.log
# Clear cache and restart
cd /app/frontend
rm -rf node_modules/.cache
sudo supervisorctl restart frontend# Check MongoDB status
sudo supervisorctl status mongodb
# Check database collections
mongosh --eval "use('test_database'); db.getCollectionNames()"- Ensure STRIPE_API_KEY is set in backend/.env
- Check Stripe webhook URL is accessible
- Verify payment status polling is working
- Ensure camera/microphone permissions are granted
- Check browser WebRTC support
- Verify Socket.IO connection
This project is created for demonstration and educational purposes.
- Emergent Platform for authentication and infrastructure
- Stripe for payment processing
- Socket.IO for real-time communication
- WebRTC for video streaming
Built with β€οΈ using FastAPI + React + MongoDB