AirShare — Serverless P2P File Sharing & Encrypted Chat

Created: August 2026

A browser-based peer-to-peer communication tool for sending files, messages, and making voice/video calls directly between devices — with no server storing your data.

Live demo: airshare.yufajjiru.work

Pair via QR code or 6-digit room code

AirShare — Pair Device modal

Encrypted chat with file transfer

AirShare — Chat view

Incoming video call — desktop

AirShare — Incoming call

Mobile: live P2P video connected

AirShare — Mobile video call


The Problem

Most file sharing and messaging tools route your data through a server. That server sees your files, stores your messages, and becomes a single point of failure (and trust). For casual local transfers between your own devices, there's no real reason for that.

AirShare removes the server from the picture entirely.


How It Works

Every device gets a 6-digit room code that maps to a unique WebRTC peer identity. To connect, you enter the other device's code — no accounts, no QR scanning required (though QR is supported too).

Once connected, an ECDH key exchange runs automatically. Each pair of devices derives a unique AES-GCM shared secret. All messages and files are encrypted on your device before being sent, and decrypted only on the other end.

Your Device ──── PeerJS (signaling only) ────► Their Device
        │                                           │
        └────── WebRTC P2P (E2E encrypted) ─────────┘

PeerJS brokers the initial handshake (just peer IDs — no message content). After that, traffic is direct device-to-device.


Features

  • End-to-end encryption — ECDH + AES-GCM, unique keypair per connection
  • File transfer — Send any file type with progress tracking
  • Encrypted chat — Text messaging with 7-day local history per room
  • Voice & video calls — WebRTC media streams between paired devices
  • Multi-device pairing — Connect multiple devices simultaneously; each isolated
  • Persistent identity — Your room code survives page refreshes via IndexedDB
  • Mobile support — TURN relay servers for mobile-to-mobile through NAT

Stack

LayerTechnology
TransportWebRTC (PeerJS)
EncryptionWeb Crypto API (ECDH + AES-GCM)
PersistenceIndexedDB
FrontendTypeScript + Vite
StylingVanilla CSS
HostingFirebase Hosting

Architecture Notes

The most interesting engineering challenge was multi-peer isolation. The original design used a single connection and a single crypto engine — fine for one-to-one, but it meant a second device connecting would overwrite the first connection entirely.

The fix: each peer gets its own DataConnection, CryptoEngine (separate ECDH keypair), and message history scope in IndexedDB (keyed by roomCode). Incoming messages from background peers show unread badges on their sidebar card without disrupting the current conversation. Sends always route to whichever room is currently open.


Links