1. System Architecture & Clean Design SPEC
ApliArte Directo is built on the principles of clean architecture, minimal resource footprint, strict service decoupling, and security by design. It decouples the broadcast rendering layer from the ingest streamer, enabling reliable live streaming directly to Twitch without heavy OBS host instances.
2. Service Topology Diagram
[ INTERNET / USERS ]
│
┌─────────────────────────┴─────────────────────────┐
│ │
[ Ports 80 / 443 ] [ Port 7979 ]
(Optional: Profile ssl) (Direct Access / Proxy)
▼ ▼
┌───────────────────────┐ ┌───────────────────────┐
│ caddy (proxy) │──────────(HTTP)──────────>│ overlay (Node 22) │
│ (Caddy 2 Auto SSL) │ │ - Three.js 3 Diorama │
└───────────────────────┘ │ - Twitch Chat (IRC) │
│ - Digital Audio Relay │
│ - Mobile Cockpit UI │
│ - Layer Persistence │
└───────────┬───────────┘
│
Private Bridge Network: directo-network
(Internal HTTP Requests :3000)
│
▼
┌───────────────────────┐
│ whip (Node/Web) │
│ - Headless Chromium │
│ - VDO.ninja WebRTC │
│ - WHIP Push to Twitch │
│ - Internal Control API│
└───────────┬───────────┘
│ (WHIP WebRTC)
▼
[ TWITCH INGEST ]
3. Docker Compose Services
overlay(Node 22 Alpine): Serves the real-time 3D diorama (Three.js), avatars, Twitch IRC listener, mini-games (!traidor), mobile audio PCM relay, and the cockpit control dashboard on port7979.whip(Debian Bookworm / Chromium Headless): Loads the VDO.ninja audio/video mixer and broadcasts via WHIP (WebRTC HTTP Ingestion Protocol) directly to Twitch. Consumes only 300–500 MB RAM. Exposes an internal HTTP control plane on port3000.caddy(Caddy 2 Alpine): Optional reverse proxy with automated ACME Let's Encrypt TLS certificate provisioning, active underprofiles: ["ssl"].
4. WHIP Headless WebRTC Streamer
WHIP eliminates the legacy dependency on Xvfb, PulseAudio virtual sinks, and FFmpeg software transcoding. Chromium sends encoded H.264/AAC WebRTC streams directly to Twitch Ingest points, resulting in zero generation loss and drastically lower CPU/RAM consumption.
5. Internal Control API (Port 3000)
Accessible strictly inside the private Docker bridge network (never exposed to host or internet):
| Method | Endpoint | Access | Description |
|---|---|---|---|
GET |
http://whip:3000/status |
Internal Docker | Returns current broadcast state: { ok: true, streaming: boolean } |
POST |
http://whip:3000/start |
Internal Docker | Launches headless browser capture and initiates Twitch broadcast. |
POST |
http://whip:3000/stop |
Internal Docker | Terminates the live broadcast and frees browser memory. |