Начало
Начало
System overview
The 10,000-foot view of ItsBagelBot. Actors, boundaries, and the systems it talks to.
На этой странице
ItsBagelBot is a fully scalable, high-availability Twitch bot that extends into new services by adding the appropriate ingress workers. This makes it easy to drive multi-platform streamers from a single configuration.
We keep the footprint of each service small to reduce the hardware and energy cost of the system.
This page is the C4 Level 1 (System Context) view. It deliberately hides everything inside the bot and shows only the actors that interact with it and the external systems it depends on. For what’s inside the box, see Microservices →. For the running shape (data plane, bus, request flow), see System state →.
Context diagram
flowchart TB
Broadcaster["Broadcaster / chatter<br/><i>Twitch user</i>"]
Operator["Operator<br/><i>tailnet device</i>"]
subgraph Bagel ["ItsBagelBot"]
Core["Bot system<br/><i>microservices on NATS</i>"]
end
Twitch["Twitch<br/><i>EventSub + Helix API</i>"]
Discord["Discord<br/><i>gateway + REST API</i>"]
Tebex["Tebex<br/><i>purchases / monetization</i>"]
Providers["External API providers<br/><i>via Gossip</i>"]
NewRelic["New Relic<br/><i>observability</i>"]
Broadcaster -- "uses console<br/>(OAuth, settings)" --> Core
Operator -- "admin console / kubectl<br/>(tailnet only)" --> Core
Twitch -- "EventSub events" --> Core
Core -- "chat + EventSub mgmt" --> Twitch
Discord -- "gateway events" --> Core
Core -- "REST actions" --> Discord
Tebex -- "purchase webhooks" --> Core
Core -- "typed lookups" --> Providers
Core -- "telemetry" --> NewRelic
Actors and external systems
| Party | Relationship |
|---|---|
| Broadcaster / chatter | Drives the bot through Twitch chat and EventSub; configures it through the console (Twitch OAuth via oauth4webapi). |
| Operator | Runs the bot. Reaches the admin console and kubectl over the Tailscale tailnet only; no public path. |
| Twitch | Source of EventSub events (ingress) and target for chat sends + EventSub management (outgress), via the Helix API and the bot account token. |
| Discord | Source of gateway events (Discord ingress) and target for REST actions (Discord outgress). |
| External API providers | Third-party data sources such as game stats and music services. Only Gossip calls them, using credentials resolved at request time. |
| Tebex | Monetization. Purchase records flow into the transactions service and promote a broadcaster’s tier (paid). |
| New Relic | Observability sink for the Go and Elixir services. |
The bot’s public surface is the broadcaster console and its public pages (commands, stats, leaderboards), the status endpoints, and the Tebex webhook receiver, all served through the outbound cloudflared tunnel. Everything operator-facing is tailnet-only. Inside the box, services talk exclusively over NATS.