How root-ilyas/rootshare works
RootShare is a self-hosted file and clipboard sharing app. Users create or join password-optional rooms in a browser, then share files and clipboard updates with connected devices; they can use LAN links or, when available, a temporary Cloudflare Tunnel. The CLI and desktop app can start a server and create sharing links automatically. Room data is process-local and uploaded files use temporary disk storage. The sampled server and client code shows the main API and realtime flows; some UI behavior and HTML are unsampled, so those details are represented only where the README documents them.
Main entry points: index.js HTTP and realtime API · share.js CLI launcher · main.js Desktop launcher · tunnel.js Tunnel manager
Components 12
Browser experience
- Room entry
public/js/home.js - Room workspace
public/js/room.js
Sharing runtime
- HTTP and realtime API
server/index.js - Room state
server/rooms.js - Temporary file storage
server/index.js
App launchers
- CLI launcher
bin/share.js - Desktop launcher
electron/main.js - Desktop webview bridge
electron/preload.js
Network access
- LAN discovery
server/network.js - Tunnel manager
server/tunnel.js
Other components
- User
- Cloudflare Tunnel
Connections 18
- User → Room entry: creates or joins
README.md - Room entry → HTTP and realtime API: requests room
public/js/home.js - User → Room workspace: shares in room
README.md - Room workspace → HTTP and realtime API: uploads and syncs
public/js/room.js - HTTP and realtime API → Room state: reads and updates
server/index.js - HTTP and realtime API → Temporary file storage: writes and serves
server/index.js - HTTP and realtime API → LAN discovery: gets LAN address
server/index.js - HTTP and realtime API → Tunnel manager: imports tunnel controls
server/index.js - Room workspace → HTTP and realtime API: requests QR data
public/js/room.js - CLI launcher → HTTP and realtime API: starts server
bin/share.js - CLI launcher → Room state: creates room
bin/share.js - CLI launcher → LAN discovery: gets LAN address
bin/share.js - CLI launcher → Tunnel manager: starts tunnel
bin/share.js - Desktop launcher → HTTP and realtime API: starts server
electron/main.js - Desktop launcher → LAN discovery: gets LAN address
electron/main.js - Desktop launcher → Tunnel manager: starts tunnel
electron/main.js - Tunnel manager → Cloudflare Tunnel: spawns binary
server/tunnel.js - Desktop launcher → Desktop webview bridge: loads preload bridge
electron/main.js