Important
This is a fork of Sha, modified and modernized with a clearer UI, cleaner codebase, and faster transfer behavior. It exists as a separate project to maintain a clean separation from the clunkiness of the old project while preserving the original idea.
cd is a direct browser-to-browser file sharing app. Pick files, get a friendly receive code, share the code or QR link, and keep both browser tabs open while the transfer runs.
Sender Browser -> WebRTC Data Channel -> Receiver Browser
| ^
| |
+-- PeerJS signaling for connection setup
| Link | Purpose |
|---|---|
| cd Repository | Modernized fork and active codebase |
| Original Sha Repository | Source project this fork split from |
| New main website | Main Cd website, New UI, and Upgraded memes |
| Vite | Local dev server and production build tool |
| PeerJS | WebRTC signaling library |
| QRCode | Sender QR generation |
| html5-qrcode | Receiver camera QR scanning |
| Cloudflare Workers Static Assets | Deployment target configured by wrangler.jsonc |
| Feature | Details |
|---|---|
| Direct P2P Transfer | Files transfer between browsers over WebRTC data channels |
| No Server Storage | The hosted app does not intentionally store transferred file contents |
| Multi-File Batches | Send one file or many files in a single session |
| Friendly Codes | Human-readable receive words with compact joining |
| Share Links | Receiver links support ?receive=code deep linking |
| QR Handoff | Sender generates a QR code for quick joining |
| Area | What Changed |
|---|---|
| UI | Rebuilt into a sharper, clearer brutalist workbench |
| Codebase | Moved from loose static scripts into a Vite ES module app |
| Speed | Uses binary chunks, file streams, and data-channel backpressure |
| Safety | Avoids CDN script injection and keeps file handling in browser APIs |
| Deployment | Builds to dist/ for cleaner Cloudflare static asset hosting |
npm installnpm run devOpen the local Vite URL in two browser windows or on two devices.
- Choose or drop one or more files.
- Share the generated code, copy the join link, or show the QR code.
- Keep the sender tab open until the receiver connects.
- Switch to Receive, open a receive link, or scan the QR code.
- Connect with the code.
- Save streamed files when prompted, or let the browser download Blob fallbacks.
- Node.js 18 or newer
- npm 9 or newer
- Git
- A modern Chromium, Firefox, or Safari browser for WebRTC testing
git clone https://github.com/YashasVM/cd.git
cd cdnpm installnpm run devVite prints a local URL, usually http://127.0.0.1:5173/. Open it in two browser windows to test send and receive on one machine.
npm run buildThe production build is written to dist/.
npm run auditnpm run previewwrangler.jsonc points Cloudflare at ./dist, so deploy after running npm run build. The repo is structured for static asset hosting; no server-side file storage process is required.
- Send one small file.
- Send multiple files in one batch.
- Receive with manual code entry.
- Receive with a copied receive link.
- Receive by scanning the generated QR code.
- Try an invalid code and an unavailable sender.
- Test at least one large file to watch speed and backpressure behavior.
+-------------------+ PeerJS signaling +-------------------+
| Sender Browser | <----------------------------> | Receiver Browser |
| | | |
| File picker/drop | | Code/QR scanner |
| Manifest builder | | Manifest reader |
| Stream reader | | Save/download |
+---------+---------+ +---------+--------+
| ^
| WebRTC data channel |
+----------------------------------------------------+
Raw binary chunks
| Parameter | Value |
|---|---|
| App Runtime | Vite vanilla JavaScript with ES modules |
| Signaling | peerjs@1.5.5 |
| QR Generation | qrcode@1.5.4 |
| QR Scanning | html5-qrcode@2.3.8 |
| Hosting Target | Cloudflare static assets from dist/ |
| Buffer Guard | Data channel backpressure before large buffered queues build up |
/
|-- index.html App shell and accessible transfer views
|-- src/
| |-- main.js Sender, receiver, WebRTC, QR, and transfer logic
| `-- style.css Brutalist responsive interface
|-- favicon.svg App icon
|-- package.json Scripts and dependencies
|-- package-lock.json Locked dependency graph
|-- wrangler.jsonc Cloudflare static asset config
`-- README.md Project documentation
npm run build
npm run auditCloudflare serves the production build from dist/, as configured in wrangler.jsonc.
- File contents are sent over WebRTC data channels between connected browsers.
- The hosted app serves static assets and does not intentionally store transferred files.
- PeerJS signaling helps establish the connection, but it is not a file storage layer.
- Share codes are temporary secrets. Send them only to the intended receiver.
- The sender should keep the tab open until the transfer completes.
- Browser support, NAT behavior, VPNs, and local network policies can affect peer connectivity.
Made by @yashas.vm
A modernized split from Sha: clearer UI, cleaner code, faster handoffs.