Inspiration
Most modern communication apps force you to compromise: either you get slick features with closed, surveillance-heavy servers, or you get open privacy that feels clunky and neglected. I wanted to see how far edge computing and modern cryptography could be pushed on the web—building an application where real-time speed, dynamic personalization, and verifiable cryptographic guarantees coexist without relying on bloated, expensive cloud setups.
What It Does
Sphurja is a secure communication platform built from scratch to deliver end-to-end encrypted messaging, voice, video, and media sharing entirely in the browser:
- Zero-Knowledge Encryption: End-to-end encrypted signaling and message storage ensure neither intermediate servers nor edge workers can read communications.
- Low-Latency Real-Time Pipeline: Instant message delivery and state synchronization handled over lightweight edge WebSockets.
- Peer-to-Peer & SFU Media: Seamless encrypted voice and video calling powered by WebRTC and LiveKit.
- Granular UI Personalization: Fully custom themes, typography, and layout settings that persist locally without leaking metadata to central servers.
How I Built It
I designed Sphurja to run on a modern, cost-effective serverless architecture:
- Frontend: Built with React, TypeScript, and modern component tooling for a responsive, desktop-grade web experience.
- Edge Backend & APIs: High-performance, distributed REST and WebSocket endpoints built with Hono and deployed globally on Cloudflare Workers.
- Data Layer: Cloudflare D1 (SQLite) and Neon PostgreSQL managed through Drizzle ORM, with Upstash Redis handling distributed session states, caching, and rate limiting.
- Media & Storage: Cloudflare R2 for encrypted payload uploads and LiveKit for real-time WebRTC streams.
Challenges I Ran Into
- E2EE Handshakes in Distributed Runtimes: Handling key ratchets, session state reconciliations, and prekey bundles in ephemeral serverless edge workers without central lock contention required strict, idempotent database logic.
- Building on Hardware Constraints: Developing the entire distributed stack on a modest Ryzen 3 machine with 4 GB RAM meant aggressive resource management, optimizing local build pipelines, and debugging memory leaks in both code and tooling.
- WebRTC Negotiation Resiliency: Designing clean peer connection fallbacks under strict NATs while ensuring encrypted state transitions never fall out of sync.
Accomplishments That I'm Proud Of
- Successfully built a fully functional cryptographic pipeline and edge-routed real-time platform end-to-end as a solo developer.
- Achieved ultra-low latency globally by shifting heavy server infrastructure to lightweight, zero-maintenance edge workers.
- Proved that deep technical architecture—cryptography, low-level networking, and distributed state—can be tackled independently through first-principles problem solving.
What I Learned
- How to balance client-side cryptographic compute with serverless edge databases without sacrificing UI responsiveness.
- The nuances of WebRTC signaling state machines, ICE candidate trickling, and SFU pipeline orchestration.
- Practical system architecture trade-offs when optimizing for scale and zero idle costs.
What's Next for Sphurja
- Implementing distributed multi-device key synchronization with offline session re-negotiation.
- Expanding group calling mesh capabilities and adding encrypted multi-party rooms.
- Open-sourcing protocol specifications to make the encryption models independently auditable.
Built With
- cloudflare
- drizzle
- expo.io
- firebase
- hono
- livekit
- postgresql
- react
- redis
- sqlite
- typescript
- webrtc
Log in or sign up for Devpost to join the conversation.