StreamChain is a Twitch-like live streaming platform featuring real-time video streaming, chat, viewer tracking, follow system, and NFT-based achievements.
Built using MERN + WebSockets + RTMP + Blockchain, this project explores real-time systems, Web3 integration, and scalable backend architecture.
- 🔴 Live video streaming via RTMP + HLS
- 💬 Real-time chat using Socket.IO
- 👥 Viewer count tracking
- ⭐ Follow / Unfollow streamers
- 🖼️ Custom stream thumbnails
- 🧑💻 Profile management (avatar, bio, phone)
- 🏅 NFT achievements (First Viewer, OG Supporter, Super Fan)
- 🔐 JWT-based authentication
- 🦊 MetaMask wallet connection
- ⚙️ Stream creation dashboard
streamchain/
├── client/ # React frontend (Vite + Tailwind)
├── server/ # Express backend + RTMP + WebSockets
├── contracts/ # Foundry smart contracts (NFT badges)
├── README.md
└── .gitignore1️⃣ Clone the Repository
git clone https://github.com/YOUR_USERNAME/streamchain.git
cd streamchain
2️⃣ Backend Setup
cd server
npm install
Create a .env file inside server/:
PORT=8000
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
Start the backend server:
npm start
3️⃣ RTMP + HLS Server In another terminal (inside server/):
node rtmp-server.js
This starts: • RTMP server on port 1935 • HLS server on port 8001
4️⃣ Frontend Setup
cd client
npm install
npm run dev
Frontend will run at:
http://localhost:5173
5️⃣ Smart Contracts (NFT Badges)
cd contracts
forge install
forge build
• Server URL: rtmp://localhost:1935/live
• Stream Key: (generated per stream)
• HLS Playback: http://localhost:8001/live/{streamKey}/index.m3u8