A peer-to-peer video streaming platform built with modern web technologies. Stream and share videos directly between peers using WebTorrent technology.
The main dashboard with a dark gaming-inspired UI featuring:
- Featured Videos - Hero section showcasing top content
- Trending Grid - Browse all available P2P videos
- P2P Status Bar - Real-time network status and peer count
- Category Filters - Filter videos by type
Full-featured video player with:
- Custom controls (play/pause, volume, fullscreen)
- Progress bar with seek functionality
- P2P network statistics (peers, download/upload speed)
- Like, Share, Download buttons
- Copy Magnet URI for P2P sharing
Easy drag-and-drop video upload:
- Supports all major video formats
- Automatic P2P seeding after upload
- Progress tracking
- File size validation (max 500MB)
- Open the homepage to see all available videos
- Click on any video card to see details in the sidebar
- Use category filters to narrow down content
- Click "Watch Now" on any video
- The video streams via P2P if available
- Monitor peer connections in the P2P stats panel
- Click the "Upload" button in the header
- Drag & drop your video or click to browse
- Wait for upload and P2P seeding to complete
- Your video is now available to all peers!
- On the watch page, click "Copy Magnet"
- Share the magnet URI with anyone
- They can stream directly from peers without a central server
- P2P Video Streaming - Stream videos directly between peers using WebTorrent
- Video Upload - Upload videos that automatically get seeded to the P2P network
- Real-time P2P Stats - Monitor active peers, download/upload speeds
- Dark Gaming UI - Modern dark theme with glassmorphism effects
- Responsive Design - Works on desktop and mobile devices
- Magnet URI Support - Share videos via magnet links
- React 18 + TypeScript
- Vite (build tool)
- TailwindCSS (styling)
- TanStack Query (data fetching)
- Wouter (routing)
- Zustand (state management)
- Node.js + Express
- MongoDB (database)
- WebTorrent (P2P streaming)
- Multer (file uploads)
- Node.js 18+
- MongoDB (running locally or connection string)
- npm or yarn
-
Clone the repository
git clone https://github.com/Sonuolikkara/PeerFlix.git cd PeerFlix -
Install frontend dependencies
npm install
-
Install backend dependencies
cd p2pStreaming-backend npm install -
Configure environment
Create
.envfile inp2pStreaming-backend/:MONGO_URI=mongodb://localhost:27017/p2pStreaming PORT=3000
-
Start MongoDB
mongod
-
Start the backend
cd p2pStreaming-backend node index.js -
Start the frontend (in a new terminal)
npm run dev
-
Open in browser
- Frontend: http://localhost:5000
- Backend API: http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/videos |
Get all videos |
| GET | /api/videos/:id |
Get video by ID |
| POST | /api/videos/upload |
Upload a new video |
| GET | /api/stats |
Get P2P network stats |
- Upload - When you upload a video, WebTorrent creates a torrent and starts seeding
- Magnet URI - Each video gets a unique magnet URI for P2P sharing
- Peers - Other users can connect as peers to download/stream the video
- Trackers - Public WebTorrent trackers help peers discover each other
PeerFlix/
βββ client/ # Frontend React app
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Page components
β β βββ lib/ # Utilities & API
β β βββ stores/ # Zustand stores
β βββ public/ # Static assets
βββ p2pStreaming-backend/ # Backend Express server
β βββ config/ # DB & Multer config
β βββ controllers/ # Route controllers
β βββ models/ # MongoDB models
β βββ router/ # API routes
β βββ utils/ # WebTorrent utilities
βββ server/ # Vite dev server
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
This project is licensed under the MIT License - see the LICENSE file for details.
Sonu Olikkara Sabu
- GitHub: @Sonuolikkara
Made with β€οΈ using React, Node.js & WebTorrent