Skip to content
ii2dPublic

About

Serverless peer-to-peer web application for real-time room communication and chunked multi-peer file sharing via WebRTC and Nostr

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

PeerBox Logo

PeerBox

Serverless, zero-login peer-to-peer workspace for real-time messaging and chunked file sharing via WebRTC & Nostr.

peer-box.ii2d.com »

Live Demo CI Status CodeQL License: MIT Svelte 5 WebRTC


⚡ Highlights

PeerBox enables private, instant, browser-to-browser collaboration with no accounts, no backend servers, and no tracking:

  • 🔒 Zero Servers & Intermediaries: Direct browser-to-browser WebRTC DataChannels. No central server inspects, relays, or stores messages.
  • 🔑 URL Hash Encryption: The secret Room Key resides exclusively in the URL hash fragment (#key=...), which web browsers never transmit over HTTP.
  • 📦 Large File Streaming (OPFS): Slices and streams files of any size directly to disk using the Origin Private File System (OPFS), bypassing browser memory limits.
  • 🧹 Ephemeral State: All active state lives in volatile browser memory—closing the tab erases everything.

✨ Features

  • Direct Messaging: Low-latency room broadcasts or 1-to-1 targeted whispers.
  • OPFS File Transfers: Chunked direct transfers with backpressure control and live throughput/ETA telemetry.
  • Voice Notes: In-browser audio recording with Opus compression and interactive waveform preview.
  • Screen Grabs: Capture a display or window frame instantly without video call overhead.
  • Connection Telemetry: Live metrics for connection type (Direct LAN vs Direct P2P) and round-trip latency.
  • Instant Pairing: 1-click room link copying and built-in offline QR code generation for mobile devices.
  • PWA & Mobile Ready: Responsive edge-to-edge layout with safe-area support and offline PWA caching.

🚀 Quick Start

Prerequisites

  • Node.js (≥ 18.0.0, Node 22 recommended)
  • pnpm (≥ 12.0.0)

Installation

# Clone the repository
git clone https://github.com/ii2d/peer-box.git
cd peer-box

# Install dependencies
pnpm install

# Start development server
pnpm dev

Open http://localhost:5173 in your browser.


📜 Available Scripts

Command Description
pnpm dev Start Vite local development server
pnpm build Compile production bundle to dist/
pnpm preview Preview production build locally
pnpm test Run Vitest test suite
pnpm test:watch Run Vitest in interactive watch mode
pnpm check Run svelte-check and TypeScript diagnostics
pnpm lint Run ESLint across codebase
pnpm lint:fix Automatically fix ESLint errors
pnpm format Format code with Prettier
pnpm format:check Check code formatting with Prettier

🛡️ Trust & Privacy Architecture

PeerBox is built around four verifiable guarantees:

  1. Zero Central Relays: No central TURN servers relay your content (ADR-0001).
  2. Decentralized Signaling: Discovery operates over public Nostr relays without a custom backend (ADR-0002).
  3. Key in Hash Fragment: The Room Key is never sent in HTTP request headers or query strings (ADR-0003).
  4. Transparent IP Disclosure: Direct WebRTC connections exchange IP addresses directly between peers; PeerBox discloses this transparently (ADR-0004).

📚 Documentation


🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository and create your feature branch: git checkout -b feature/my-feature
  2. Ensure tests and typechecks pass:
    pnpm check
    pnpm test
    pnpm lint
    pnpm format:check
  3. Commit your changes and push to your fork.
  4. Open a Pull Request detailing the changes made.

📄 License

This project is licensed under the MIT License.

About

Serverless peer-to-peer web application for real-time room communication and chunked multi-peer file sharing via WebRTC and Nostr

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages