PeerShare is a peer-to-peer file sharing tool. No uploads to server is required, files are transfered directly between devices. A direct WebRTC connection is created between two devices using STUN servers from Google and Cloudflare. Files are sent in chunks over DataChannel and saved into IndexedDB on the receiver’s side. The chunks are finally assembled together to form the complete file at the end.
This project was made for Midnight Hackathon organized by Hack Club.
- Direct P2P file transfer using WebRTC
- Live speed, progress and transfer status
- Chunked sending (for fast, less memory usage and stable throughput)
- Chunks are saved in IndexedDB and assembled at the end
- Modal based connection request
- Live peer nickname updates
- Uses socket.io for initial communication between devices
- Files do not go through servers
git clone https://github.com/realBoltDev/peer-share.git- Rename
.env.exampleto.env.developmentor.env.productionas needed and add ENVIORNMENT variable values.
cd frontend
npm install
npm run dev- Rename
.env.exampleto.env.developmentor.env.productionas needed and add ENVIORNMENT variable values. - If you want to run in production mode, you'll need to pass
NODE_ENV=productionin command.
cd backend
npm install
npm run devIf you don’t have Redis installed, the easiest way is running through Docker:
docker run -p 6379:6379 redis- Open home and connect pages in same or different devices.
- Get the peer id and connect from other device.
- Accept the request. It should create an RTCPeerConnection and open DataChannel.
- Select or drag-and-drop the files you would like to send.
- Click the upload button and watch it transfer live.
- Receiver gets file data in chunks and is written into IndexedDB
- When done, chunks are assembled and file is available to save to device.

