6.1 KiB
Multi-Platform Chat Overlay Development Plan (v2)
This document outlines the development plan for a multi-platform chat overlay and moderation toolset.
1. Project Overview
The goal is to create a system that aggregates chat from multiple platforms (YouTube, Twitch), displays it in a customizable OBS overlay, and provides a suite of tools for both the streamer (host) and their moderators. Key features include highlighting messages and a system for moderators to queue important messages for the host to address.
2. Architecture
The system will consist of one backend and four frontend components:
-
Python Backend: A central server application responsible for:
- Connecting to and fetching chat messages, including moderator status, from YouTube and Twitch.
- Running a WebSocket server to broadcast chat messages and queue updates to all connected clients.
- Serving the various HTML/CSS/JS frontend applications.
- Providing an HTTP API for actions like highlighting, queuing, and managing the queue.
- Handling authentication for the Moderator and Host panels.
-
Web Overlay: The public-facing chat display, loaded as a Browser Source in OBS. It will display all chat messages and special indicators for highlighted messages.
-
Host Control Panel: The streamer's main interface, loaded as a Browser Dock in OBS. It will display the full chat, allow for message highlighting, and show the queue of messages tagged by moderators.
-
Moderator Panel: A separate, secure web page for channel moderators. It will display the chat feed and allow moderators to "tag" or "queue" a message for the host's attention.
3. Technology Stack
-
Backend:
- Language: Python 3.9+
- Web Framework: FastAPI
- WebSocket Server:
websocketslibrary - YouTube Chat:
pytchat - Twitch Chat:
TwitchIO - Authentication: A simple password-based auth for moderator/host panels initially.
-
Frontend (All Panels):
- Markup/Styling: HTML5, CSS3
- JavaScript: Vanilla JavaScript
- Communication: Native WebSocket API, Fetch API
4. Feature Breakdown
-
Core Chat:
- Aggregate chat from YouTube and Twitch.
- Identify moderators from both platforms.
- Broadcast all messages via WebSockets.
-
Web Overlay:
- Display combined chat feed.
- Visually distinguish highlighted messages.
-
Host Control Panel:
- Display combined chat feed.
- "Highlight" button for any message.
- Display the Moderator-curated message queue.
- "Dismiss" button to remove a message from the queue after it's been addressed.
-
Moderator Queuing System:
- A separate, password-protected
moderator.htmlpanel. - Display combined chat feed.
- "Queue" button next to each message, visible only to identified moderators.
- Pressing "Queue" sends the message to the backend to be added to the host's queue.
- A separate, password-protected
5. Implementation Roadmap
Phase 1: Core Backend & Basic Overlay
(This phase remains the same)
- Setup Project: Initialize project, venv, and install dependencies.
- Develop Chat Listeners: Create modules for
pytchatandTwitchIO, ensuring they can identify moderator status for each message. - Implement WebSocket Server: Set up a server to broadcast all incoming chat messages.
- Create Basic Overlay: Build a simple
index.htmlthat connects to the WebSocket and displays messages. - Integrate with FastAPI: Get the backend to serve the overlay page.
Phase 2: Host Control Panel & Highlighting
(This phase remains the same)
- Create Host Panel UI: Build
host.htmlwhich connects to the WebSocket. - Develop Highlighting API: Create a FastAPI endpoint (
/highlight-message). - Implement Highlighting Logic: The backend broadcasts a "highlight" event via WebSocket when the API is called.
- Update Overlay: The
index.htmloverlay listens for the "highlight" event and applies a special style.
Phase 3: Moderator Queuing System
(New phase incorporating the requested feature)
- Backend Queue: Implement an in-memory queue on the backend to hold tagged messages.
- Develop Queuing API: Create a FastAPI endpoint (
/queue-message) that adds a message to the queue. - Create Moderator Panel: Build a
moderator.htmlpage. It will show the chat feed. For users identified as moderators, a "Queue" button will appear next to messages. - Implement Moderator Action: The "Queue" button calls the
/queue-messageAPI. - Update Host Panel: Add a new section to
host.htmlthat displays the contents of the message queue in real-time. This will require the backend to send a "queue-updated" WebSocket event. - Implement Dismissal: Add a "Dismiss" button in the Host Panel's queue view. This will call a new API endpoint (e.g.,
/dismiss-message) to remove a message from the backend queue.
Phase 4: Configuration & Polish
(Formerly Phase 3)
- Create Configuration UI: Build a
config.htmlpage for entering stream details. - Refine CSS: Improve the visual appearance of all four frontend components.
- Documentation: Write a
README.mdwith setup instructions for all parts of the system.
Phase 5: Subscription & Monetization (Future)
(Formerly Phase 4)
- Research & Integrate: Investigate and implement webhook integration for services like Ko-fi.
- Develop Subscriber Features: Build subscriber-only perks (e.g., on-screen alerts, special badges).
6. Requirements for Completion (Initial Version)
The project will be considered complete for its initial version when Phases 1, 2, and 3 are functional:
- Chat is aggregated from YouTube and Twitch.
- The Host can highlight messages via the Host Control Panel, and they appear styled in the OBS overlay.
- Moderators can log into a separate panel and queue messages.
- The Host can see the queued messages in their panel and dismiss them.
7. Deployment & Development Workflow
(This section remains the same)
8. Subscription & Monetization (Future)
(This section is now covered in the roadmap)