PulseRTC
Architecture // LiveKit SFU + Coturn TURN

Real-Time Media Plane & Control Plane Separation

Why we avoid P2P mesh for group calls and traditional HTTP CDNs for voice: CDNs add multi-second buffering latency, while P2P degrades rapidly beyond 2 users. A dedicated SFU + TURN mesh keeps glass-to-glass latency sub-second while keeping billing isolated in your control plane.

STEP 01

Client SDK (@pulsertc/sdk)

Runs in browser/web apps. Captures 48kHz Opus audio and simulcast VP8/H.264 video, requests a short-lived room token from your backend, and connects over WebRTC.

STEP 02

Control Plane API (Fastify + Postgres/Redis)

Authenticates tenant App ID + App Secret, enforces non-zero prepaid balance (403 ZERO_BALANCE cutoff), mints LiveKit JWT grants, and generates HMAC-SHA1 Coturn TURN credentials.

STEP 03

LiveKit SFU + Coturn TURN Mesh

Selective Forwarding Unit routes encrypted DTLS-SRTP media packets in volatile RAM without disk persistence, while Coturn relays symmetric-NAT traffic over UDP/TCP/TLS.

STEP 04

Webhook Metering & CDR Ledger

LiveKit emits signed participant_left webhooks back to the Control Plane, deducting participant-minutes atomically and writing immutable Call Detail Records.

LiveKit SFU Cluster

Redis-backed horizontal clustering (`infra/livekit.yaml`) with UDP media ports 50000–50100, TCP fallback on 7881, and adaptive dynacast.

Coturn Ephemeral Auth

Configured with use-auth-secret so every room join receives time-bounded HMAC credentials—no static TURN passwords exposed to browsers.

Zero-Retention Media

Media packets are encrypted end-to-transport via DTLS-SRTP and forwarded strictly in volatile memory unless a tenant explicitly enables cloud recording.

Live Edge Latency Probe

Real-Time Control Plane & Signaling RTT

Measures 5 sequential HTTPS timing samples from your browser to https://pulse.amiyogroup.com/v1/network/ping.

Production deployment files are ready in infra/docker-compose.yml (PostgreSQL 16 + Redis 7 + Coturn + LiveKit Server). Local dev runs zero-config with Node built-in SQLite.