Real-Time Peer-to-Peer File Transfer using WebRTC
Transfer files directly between devices without uploading them to a cloud server.
- About DropNova
- Why I Built This
- Features
- Screenshots
- System Architecture
- WebRTC Connection Flow
- File Transfer Flow
DropNova is a browser-based peer-to-peer file sharing application that allows users to securely transfer files directly between two devices using WebRTC DataChannels.
Unlike traditional file sharing services, files are never uploaded to the server. The backend is used only for signaling, while the actual file travels directly from one browser to another.
This provides:
- Faster transfers
- Better privacy
- Lower server bandwidth
- Zero cloud storage
- Cross-platform compatibility
The application works directly inside the browser without requiring software installation.
The idea came from a real-world problem.
During a hackathon, I frequently needed to share files with teammates and mentors using different laptops.
The common options were surprisingly inconvenient:
- Connect my phone through a USB cable
- Upload files to Google Drive
- Send files through WhatsApp
- Share my personal phone number
- Install a common file-sharing application on both devices
None of these felt quick or practical, especially when sharing files with someone I had just met.
I wanted something much simpler.
Open a website.
Generate a pairing code.
Connect two devices.
Transfer the files.
Done.
No login.
No registration.
No account.
No cloud upload.
No phone number.
No installation.
That idea became DropNova.
- β‘ Direct Peer-to-Peer file transfer using WebRTC
- π Secure browser-to-browser communication
- π FastAPI WebSocket signaling server
- π± QR Code based device pairing
- π’ 6-digit pairing code
- π Multiple file transfer support
- π Live transfer progress
- π« Transfer cancellation
- π Resume support for interrupted transfers
- πΎ Native File System Access API support
- π OPFS fallback for browsers without File System Access API
- π± Mobile browser compatibility
- π Dark theme UI
- π Cross-network support using STUN
- β‘ Same-network optimized transfers
- π§Ή Automatic memory cleanup
- π Automatic session cleanup
- π Automatic disconnect handling
- π₯ One sender and one receiver per session
- π¦ Chunk-based file transfer
- π Browser-based application (no installation required)
- π Files never pass through the backend server
DropNova follows a hybrid architecture.
The backend only performs signaling between peers.
Once signaling is complete, both browsers establish a direct WebRTC DataChannel and communicate without routing file data through the server.
This significantly reduces backend bandwidth while increasing transfer speed and privacy.
Connection Establishment:
- Sender generates a 6-digit pairing code.
- Receiver joins using the code or QR Code.
- Both devices connect to the FastAPI signaling server.
- SDP Offer and Answer are exchanged.
- ICE Candidates are exchanged.
- WebRTC DataChannel is established.
- The signaling server is no longer involved in the file transfer.
Each file transfer follows this sequence:
- Sender selects one or more files.
- Receiver receives a transfer request.
- Receiver accepts the transfer.
- Files are divided into chunks.
- Chunks are streamed over the WebRTC DataChannel.
- Progress is synchronized in real time.
- Receiver acknowledges successful completion.
- Both devices clean temporary resources automatically.
DropNova follows a lightweight hybrid architecture that separates the responsibilities of connection establishment and file transfer.
The backend is responsible only for signaling. It creates temporary communication rooms where two peers exchange the information required to establish a direct WebRTC connection.
Once the WebRTC DataChannel is established, the backend is no longer involved in the transfer process. Every file travels directly between the sender and receiver, reducing server bandwidth while improving speed and privacy.
The application consists of four major components:
- Frontend (HTML, CSS & JavaScript) β Handles the user interface, routing, QR code generation, progress tracking, and file management.
- FastAPI Signaling Server β Exchanges SDP Offers, Answers, and ICE Candidates through WebSockets.
- WebRTC DataChannel β Creates the secure peer-to-peer connection used to transfer file data.
- Browser Storage APIs β Uses the Native File System Access API where supported and OPFS as a fallback for compatible browsers.
The sender opens DropNova and chooses Send File.
The receiver opens the same website and chooses Receive File.
The sender generates:
- A unique 6-digit pairing code
- A QR Code containing the pairing information
The receiver can either:
- Enter the 6-digit code manually
- Scan the QR code
This creates a temporary signaling room.
Both browsers establish a WebSocket connection with the FastAPI signaling server.
The server is responsible only for exchanging:
- SDP Offer
- SDP Answer
- ICE Candidates
No file data passes through the backend.
After signaling completes, both browsers establish a secure WebRTC DataChannel.
At this point:
- The connection becomes peer-to-peer.
- The signaling server is no longer involved.
- Files travel directly between both devices.
The sender selects one or multiple files.
DropNova supports:
- Single file transfer
- Multi-file transfer
- Different file types
- Batch transfers
Before any file is transferred, the receiver receives a confirmation prompt displaying:
- File names
- File sizes
- Number of files
The receiver can:
- Accept
- Decline
This prevents unwanted transfers.
Instead of sending an entire file at once, DropNova divides every file into smaller chunks.
Chunk-based transfer provides several advantages:
- Lower browser memory usage
- Better transfer stability
- Accurate progress tracking
- Resume capability
- Improved handling of large files
Each chunk is streamed through the WebRTC DataChannel until the entire file has been transferred.
During transfer, both devices display:
- Transfer percentage
- Live progress bar
- Current transfer status
The sender and receiver remain synchronized throughout the transfer.
Once the final chunk is received:
- The receiver reconstructs the original file.
- The sender receives an acknowledgement.
- Temporary resources are cleaned automatically.
- Both users can immediately transfer another file without reconnecting.
- HTML5
- CSS3
- Tailwind CSS
- JavaScript (ES6 Modules)
- WebRTC
- WebSocket
- File System Access API
- Origin Private File System (OPFS)
- QRCode.js
- Python
- FastAPI
- WebSockets (Starlette)
- Netlify (Frontend)
- Render (Backend)
- Git
- GitHub
- VS Code
DropNova
β
βββ backend
β βββ main.py
β βββ requirements.txt
β
βββ frontend
β βββ screens
β β βββ home.js
β β βββ send.js
β β βββ receive.js
β β βββ connected.js
β β βββ sending.js
β β βββ receiving.js
β β βββ completed.js
β β βββ reconnect.js
β β
β βββ app.js
β βββ router.js
β βββ transfer.js
β βββ fileTransfer.js
β βββ webrtc.js
β βββ style.css
β βββ index.html
β
βββ screenshots
βββ docs
βββ README.md
βββ LICENSE
βββ .gitignore
git clone https://github.com/mayanksingh05/dropnova.git
cd dropnovacd backend
pip install -r requirements.txt
uvicorn main:app --reloadThe signaling server will start on:
http://localhost:8000
Open another terminal.
cd frontend
python -m http.server 5500or
npx serveOpen:
http://localhost:5500
Update the WebSocket URL inside:
frontend/screens/send.js
frontend/screens/receive.js
Replace:
wss://your-backend-url/ws/with
ws://localhost:8000/ws/for local development.
Deploy the frontend on Netlify.
Deploy the FastAPI signaling server on Render.
After deployment, update the frontend WebSocket endpoint to point to your deployed backend.
While developing DropNova, the primary focus was to keep the user experience as simple as possible.
The application was designed with the following goals:
- No login required
- No account creation
- No phone number sharing
- No cloud uploads
- No software installation
- Fast device pairing
- Cross-platform compatibility
- Minimal user interaction
- Secure peer-to-peer communication
The objective was to make transferring files between laptops and phones as quick as scanning a QR code or entering a six-digit pairing code.
Although DropNova is designed to be simple to use, privacy and security were important considerations throughout development.
Once a WebRTC connection is established, files are transferred directly between the sender and receiver.
The backend does not relay file data.
Files are never uploaded, stored, or cached on the backend server.
The FastAPI server is responsible only for exchanging signaling information required to establish the WebRTC connection.
Each transfer creates a temporary room for exactly two participants:
- One Sender
- One Receiver
After the transfer is complete or either user disconnects, the room is automatically cleaned up.
Before any transfer begins, the receiver must explicitly accept the incoming files.
This prevents unwanted or accidental file transfers.
Temporary objects and browser resources are released after every transfer to reduce memory usage and avoid unnecessary storage consumption.
DropNova is designed to provide a fast and responsive file sharing experience.
Some performance-focused design decisions include:
- Direct browser-to-browser communication
- Chunk-based file transfer
- No backend file relay
- Minimal server bandwidth usage
- Low latency after connection establishment
- Multi-file transfer support
- Automatic resource cleanup
- Responsive interface for desktop and mobile browsers
Since file data does not pass through the backend, transfer speeds primarily depend on:
- Internet connection quality
- Device performance
- Browser capabilities
- WebRTC connection quality
Like any project, DropNova has some current limitations.
The deployed backend uses Render's free tier.
If the backend has been idle, the first connection may take a few seconds while the service wakes up.
DropNova currently relies on STUN servers for NAT traversal.
In some restrictive corporate networks or strict NAT environments, establishing a direct peer-to-peer connection may not be possible.
Adding a TURN server would improve compatibility.
Some browser APIs used by DropNova are not supported equally across all browsers.
When available, the application uses the Native File System Access API.
Otherwise, compatible browsers fall back to OPFS.
Each session supports exactly:
- One Sender
- One Receiver
Multi-user file sharing is not currently supported.
Very large files may be limited by:
- Browser memory
- Mobile device resources
- Browser implementation differences
Performance may vary depending on the user's device.
Several improvements are planned for future versions of DropNova.
- TURN server integration for improved connectivity
- Pause and Resume controls
- Drag-and-drop file uploads
- Folder transfer support
- Clipboard sharing
- Transfer history
- Transfer speed analytics
- End-to-end encryption enhancements
- Progressive Web App (PWA)
- Native desktop application
- Native Android application
- Improved accessibility
- Multi-language support
- Unit testing
- Integration testing
- GitHub Actions CI/CD pipeline
- Custom STUN/TURN server configuration
- Device discovery on local networks
- File integrity verification using checksums
Building DropNova provided valuable experience with modern web technologies and real-world software engineering concepts.
Some of the key areas explored during development include:
- WebRTC peer-to-peer communication
- FastAPI backend development
- WebSocket-based signaling
- Browser File System APIs
- Chunk-based file transfer
- State management
- Session lifecycle management
- Responsive UI development
- Cross-device compatibility
- Deployment using Netlify and Render
- Debugging real-time networking issues
- Working with asynchronous JavaScript
- Building modular and maintainable project structures
This project significantly strengthened my understanding of full-stack web development and real-time communication systems.
Contributions, suggestions, and feedback are always welcome.
If you'd like to improve DropNova:
- Fork the repository.
- Create a new feature branch.
- Commit your changes.
- Push the branch.
- Open a Pull Request.
This project was made possible thanks to several amazing open-source technologies.
Special thanks to:
- WebRTC
- FastAPI
- Starlette
- Tailwind CSS
- QRCode.js
- Netlify
- Render
- GitHub
Their excellent tools and documentation made the development of this project significantly easier.
This project is licensed under the MIT License.
See the LICENSE file for more information.












