How dannovikov/tts works
Project Type and Purpose
• This is a lightweight full‑stack web application whose single goal is to take Twitch chat messages and play them as text‑to‑speech in a streaming overlay.
• The “frontend” is a static HTML/JS page loaded via a browser source (e.g., OBS). The “backend” is a Node.js server that (a) connects to Twitch’s chat API, (b) optionally filters/augments messages (e.g., via OpenAI), and (c) pushes events down to the frontend.
File Structure Analysis
• Top‑level files:
• server.js → the Express (or HTTP) server entry point
• package.json/.gitignore/.prettierrc → Node.js tooling & config
• todo.txt → developer notes
• public/ directory:
• index.html → the overlay page you drop into OBS
• app.js → client‑side logic (connects back to server, invokes browser TTS)
• No separate “src” vs “dist”—it’s a simple static+server layout.
Insights from README
• The server runs on port 3000 by default, serving both static assets and a stream endpoint at /?username=….
• Consumers add a Browser Source pointing at your server URL; the JS code in app.js opens a WebSocket or SSE to receive chat payloads.
• The server optionally uses an OpenAI API key (via a local file) to moderate or enrich messages before relaying them.