Webchat is not just a messaging app; it is a demonstration of extreme client-side engineering. By pushing WebRTC data channels, the Web Audio API, Canvas 2D, and File System APIs to their absolute limits, this application functions entirely without a backend database or messaging server.
|
Connect completely offline. The app slices connection keys into dynamic animated QR carousels (15+ chunks) streaming at 400ms for frictionless optical pairing. |
Switch between Draw on Chat (overlay) and Draw on Canvas (solid isolation). Includes live multi-peer syncing, high-res downloads, and Web Share API. |
Bypass RAM limits. Using the File System Access API, incoming files stream directly to a designated local folder, allowing infinite gigabyte transfers without crashing. |
|
Maintains PWA background connection using a 1-sample inaudible audio loop hack, tricking mobile OS limiters into keeping WebRTC active when minimized. |
Dynamic |
Single emojis automatically scale 300%. Features WhatsApp-style targeted replies, smart scroll-down badges, and ghost-typing text previews. |
How exactly does a serverless app connect? Webchat utilizes two distinct architectural bridges, mapped out below in zero-dependency ASCII flowcharts.
Uses an ephemeral Google Apps Script solely for an initial 5-second handshake.
[ Peer A (Host) ] [ Signaling Script ] [ Peer B (Guest) ]
│ │ │
│ 1. Generate WebRTC Offer (SDP) │ │
│──────────────────────────────────────────────>│ │
│ POST Offer with PIN (e.g. "secret45") │ │
│ │ (Holds data for 5s) │
│ │<─────────────────────────────────────────────│
│ │ GET Offer using PIN │
│ │ │
│ │ 2. Apply Offer, Generate Answer│
│ │<─────────────────────────────────────────────│
│ │ POST Answer to PIN │
│<──────────────────────────────────────────────│ │
│ GET Answer │ │
│ X (Connection Abandoned) │
│ │
│====================== 3. Secure P2P DTLS Pipe Established ===================================│
│<────────────────────────────────────────────────────────────────────────────────────────────>│
│ Direct Encrypted Chat & Files │