How drakomichael/streamchatrelay works
Stream Chat Relay centralizes live-chat messages, analyzes them, persists a local log, and broadcasts them to connected dashboard clients. The documented path runs from src/index.js through settings and application bootstrap into the WebSocket service; the WebSocket normalizes each message, records analysis and log data, then broadcasts it. Express exposes the dashboard and APIs, while Twitch connectivity and a development spam generator are additional capabilities. The Angular workspace is an evolving alternative UI. Relationships follow the README’s workflow and sampled modules; unsampled subsystem wiring is omitted.
Main entry points: bootstrapApp.js App bootstrap · websocket_bootstrap.js WebSocket server · ws_functions.js Message handling · express_bootstrap.js HTTP server and API
Components 18
Runtime and settings
- Application entry
src/index.js - Settings loader
src/services/settings/loadsettings.js - Config store
src/services/settings/configStore.js - App bootstrap
src/services/app/bootstrapApp.js
Message pipeline
- WebSocket server
src/services/websocket/websocket_bootstrap.js - Message handling
src/services/websocket/ws_functions.js - Message analysis
src/services/dataAnalysis/messageAnalysis.js - Log control
src/services/dataControl/dataControl.js - Message log
src/logs/chat_log.txt - SQLite storage
src/services/dataBase/databaseHUB.js
Web interface
- HTTP server and API
src/services/webmanager/express_bootstrap.js - Legacy dashboard
src/public/scripts.js - Angular UI
frontend/src/app/app.ts
External and satellite services
- Twitch platform
- Twitch connection
src/services/externalConnections/twitch/handleTwitchConnection.js - Dev spam generator
modules/service_spamChatBot/spammer.deprecated.js - Spam service
modules/service_spamChatBot/src/services/SpamOrchestratorService.js
Other components
- Chat client
Connections 21
- Application entry → Settings loader: loads settings
- Settings loader → Config store: reads config
- Settings loader → App bootstrap: starts app
- App bootstrap → WebSocket server: starts WebSocket
- Chat client → WebSocket server: sends messages
- WebSocket server → Message handling: dispatches events
- Message handling → Message analysis: registers messages
- Message handling → Log control: records messages
- Log control → Message log: writes log
- Message handling → Chat client: broadcasts messages
- App bootstrap → HTTP server and API: starts HTTP
- HTTP server and API → Legacy dashboard: serves dashboard
- Legacy dashboard → WebSocket server: receives events
- Legacy dashboard → HTTP server and API: requests analysis
- HTTP server and API → Message analysis: reads summary
- App bootstrap → SQLite storage: initializes optionally
- App bootstrap → Twitch connection: initializes optionally
- Twitch connection → Twitch platform: connects
- App bootstrap → Dev spam generator: enables in dev
- Dev spam generator → Spam service: starts generation
- Spam service → WebSocket server: sends messages