How billos/broadcastarr works
And Represent the Main Components
• Frontend Interface (Client/Discord Bot Interface): Although the project does not have a traditional web frontend, the Discord bot is a major interactive component. Represent it separately as it handles user interactions, commands (like addcategory, removecategory, etc.), and uses Discord’s API.
• AgendaTS (for scheduling tasks like publishing categories, indexing, grabbing streams, releasing broadcasts, etc.)
• Auth, Broadcast, Category, Config, Group, Indexer, Indexers, Publishers, Releasers, Role, Scrapper, Templater, UUID – each representing different functions in the broadcast cycle.
• Bootstrappers & Config Managers: Under “src/bootstrappers” and “src/config”, these components perform initial configuration and setup at startup. They ensure the environment is properly loaded.
• Database (MongoDB as per runtime env variables like MONGO_URL, MONGO_DB, etc.)
• External broadcasting or notification services (Discord’s webhook/bot, Jellyfin as a releaser, Gotify, and (soon) Matrix)
• VPN/Wireguard: Represent the networking component that checks connectivity via the “gateway.sh” script in Docker.
• Infrastructure & Deployment Containers: Include Docker and docker-compose as encompassing the service’s server, workers, and bootstrap containers. This will show that the entire architecture is containerized and scalable.
Relationships and Interactions
• The Discord bot interacts with the API layer and feeds commands into the various modules.
• The API endpoints communicate with the underlying modules (e.g., broadcast, category, indexer) and schedule tasks via AgendaTS.
• The scheduler (AgendaTS) triggers tasks that interact with the scrappers, indexers, publishers, and releasers.
• Bootstrappers initiate the configuration at startup, ensuring that modules and services like the database and external APIs are correctly configured.
• Docker orchestration: Represent the overall container environment and networking (for example, linking the Broadcastarr container with MongoDB and the Wireguard VPN container).
Important Architectural Patterns/Principles
• Modular Design: The clean separation into modules (organized under “src/modules”), each encapsulating a specific business domain (e.g., AgendaTS, scrapper, publishers, indexers) is key.
• Task Scheduling: The system leverages scheduled tasks (AgendaTS) to manage asynchronous workflows. Show the scheduler as an orchestration engine.
• Containerization and Scalability: Indicate that a Docker compose setup is used to deploy multiple instances (workers and server) and that the service is designed for horizontal scaling.
Relevant Technologies and Frameworks
• Node.js as the runtime environment (implied by the file structure and .ts files).
• Docker/Docker Compose (multiple YAML configurations and the Dockerfile).
• Environment variables (.env files) used for runtime and bootstrap configurations.
• Potential use of Express or similar frameworks for the HTTP API routes (as per "src/routes" structure).
• Messaging/notification integrations like Discord, Jellyfin, Gotify, Matrix.
• MongoDB for data persistence (as seen from runtime configuration).