FileSpread is a browser-first peer-to-peer file sharing web app. It enables direct device-to-device file, link, and text transfer using WebRTC, without sending shared content through a cloud storage service.
FileSpread is designed for fast, private local sharing across devices on the same network or grid. It uses a lightweight signaling server only for discovery and WebRTC connection setup. After peers connect, file and message traffic flows directly between browsers.
- Peer discovery via WebSocket signaling
- Direct peer-to-peer WebRTC data channels
- Send text messages, links, and files
- Chunked file transfer with backpressure handling
- Local message and pinned device storage using IndexedDB
- QR code scanning and sharing for quick pairing
- Clean single-page app experience with a modern UI
The project is split into two parts:
FileSpread/— React + TypeScript frontend applicationFileSpread-signaling/— lightweight Node.js signaling server using WebSocket
App.tsx— main application UI and state managementDiscoveryService.ts— signaling client for peer discovery and message forwardingwebrtcService.ts— WebRTC peer connection and file/data transfer logicdb.ts— IndexedDB wrapper for local persistencetypes.ts— shared TypeScript model definitionscomponents/Icons.tsx— custom SVG icon components
FileSpread-signaling/index.js— a minimal WebSocket server that tracks peers by grid and forwards pairing and ICE signaling messages.
- Each browser instance joins a shared grid via the signaling server.
- The server broadcasts the list of available peers in the same grid.
- When a user connects to another peer, the app exchanges WebRTC offers, answers, and ICE candidates through the signaling server.
- Once the WebRTC data channel is established, peers send text, link, and file packets directly.
- File transfers are sent in chunks with flow control to avoid browser memory issues.
- Open a terminal in
FileSpread/FileSpread - Install dependencies:
npm install
- Start the app:
npm run dev
- Open the local Vite URL shown in the terminal.
- Open a terminal in
FileSpread/FileSpread-signaling - Install dependencies:
npm install
- Start the server:
node index.js
- The server listens on port
8080by default.
- Update the signaling URL in
DiscoveryService.tsif you want to run your own server. - The grid ID is derived from
window.location.pathname, so peers on the same path join the same discovery grid.
- The signaling server does not store files or chat content.
- File transfer happens directly between peers using browser WebRTC.
- The app stores pinned devices and message history locally in the browser.
Use and modify the project as needed for local sharing experiments and browser-based P2P prototypes.
- Support us if u find it valuable