The hosted url is PeerLink
PeerLink is a modern web application that enables secure peer-to-peer file sharing and video calls using WebRTC technology. Built with Next.js and Firebase, it offers a seamless experience for real-time communication and file transfer without server intermediaries.
-
P2P File Sharing
- Direct peer-to-peer file transfer
- Stream-based transfer for large files
- Progress tracking for uploads/downloads
- No file size limits
- Efficient memory usage with chunks
-
Video Calls
- HD video and audio calls
- Screen sharing capability
- Camera/microphone controls
- Fullscreen mode
- Real-time chat during calls
-
Real-time Chat
- Draggable chat window
- Instant messaging
- Timestamp display
- Message history
The application uses WebRTC for peer-to-peer connections:
- Establishes data channels for file transfer and chat
- Uses STUN servers for NAT traversal
- Handles ICE candidates for connection establishment
- Manages media streams for video/audio
- Uses
streamsaverfor efficient file handling - Implements chunk-based streaming (216KB chunks)
- Handles backpressure for large files
- Progress tracking for both sender and receiver
Firebase Firestore is used for:
- Signaling server for WebRTC
- Storing and exchanging ICE candidates
- Managing call metadata
- Temporary storage of connection information
app/
├── components/
│ ├── LandingPage/ # Landing page components
│ ├── SharePage/ # File sharing components
│ └── Navbar.tsx # Navigation component
├── video/ # Video call implementation
├── share/ # File sharing implementation
├── groupchat/ # Group chat feature
└── firebase.ts # Firebase configuration
/- Landing page/share- File sharing interface/video- Video call interface/groupchat- Group chat interface (in development)
- Sender creates a WebRTC offer
- Connection established via Firebase signaling
- File is read as a stream
- Data is chunked and sent through WebRTC data channel
- Receiver saves chunks using streamsaver
- Progress is tracked in real-time
- Local media stream is acquired
- WebRTC peer connection is established
- Video/audio tracks are exchanged
- Additional data channel for chat is created
- Real-time communication begins
- End-to-end encryption via WebRTC
- Direct P2P connections
- No server storage of files
- Secure signaling through Firebase
- Clone the repository
- Install dependencies:
npm install-
Set up Firebase:
- Create a Firebase project
- Add your Firebase config to
firebase.ts
-
Run the development server:
npm run dev- Modern web browser with WebRTC support
- Node.js 16+
- Firebase account
- The application uses stream-based file transfer instead of loading entire files into memory, making it suitable for transferring large files
- Firebase is used only for signaling; all data transfers are peer-to-peer
- The project uses Next.js 15.3.1 with the new app router