Problem & Constraints
Running OBS, Clone Hero, and real-time audio routing leaves little CPU or frame-time headroom for heavy Electron-based stream bots. I needed a native desktop overlay capable of rendering animated Twitch emotes, international Unicode song titles, and album art—paired with a public web song list (songs.hababot2.com) that other streamers could use without ever sharing OAuth client secrets locally.
Architecture & Tradeoffs
[ Twitch IRC / EventSub ] <---> [ C++20 Desktop Client (Win32 / DX11 / ImGui) ]
|
WSS (TLS)
v
[ Browser Viewers ] <--- Push --- [ Nginx -> Boost.Beast Relay (Linux / systemd) ]
- Native Win32 + DX11 + Dear ImGui Client: Built custom title-bar controls, a tabbed settings panel, detachable song-queue pop-out windows, theme customization, and optional always-on-top pinning. Separated queue controls from chat configuration and persisted both queue state and user settings across restarts.
- Twitch IRC & EventSub Ingestion: Handles chat commands (
!sr, custom commands), gigantified emotes, and rich EventSub notifications (subscriptions, gifted subs, hype trains, and early-bird alerts). Decodes animated GIF emotes natively via Windows Imaging Component (WIC) and scans local song libraries at runtime with fuzzy matching and album-art extraction. - Multi-Tenant Boost.Beast WebSocket Relay: Replaced client-side polling with an event-driven C++ Boost.Beast relay running under
systemdbehind Nginx. Streamer clients authenticate through server-managed OAuth flows and push live queue updates directly to connected viewers, keeping credentials off user machines.
Debugging & Production Fixes
- TLS, Reverse-Proxy & OAuth Isolation: Resolved OpenSSL build mismatches, Nginx WebSocket upgrade
502errors, and handshake drops between the reverse proxy and Boost.Beast. Fixed OAuth redirect edge cases and stalled initial song-list loads so viewers receive immediate state on connect. - Windowing & Resize Stability: Eliminated DirectX 11 resize rendering glitches when detaching and re-docking the live song queue window, and added built-in ImGui debug triggers to reproduce alert animations and EventSub edge cases without waiting for live chat events.
| Engineering Metric | Details / Target |
|---|---|
| Idle Desktop Footprint | 200 MB RAM / 0.1% CPU |
| Queue Update Delivery | Immediate WebSocket push on mutation |
| Deployment Stack | Linux VPS · systemd · Nginx · OpenSSL |