# decatrondev/decatron architecture

> Architecture diagram of the GitHub repository decatrondev/decatron, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/decatrondev/decatron
- Repository: https://github.com/decatrondev/decatron

## Overview

Decatron is a multi-tenant streaming toolkit for Twitch and Kick. Streamers configure bot features and OBS browser-source overlays in the React dashboard; viewers interact through chat, public pages, and overlays, while developers can use the OAuth2 API. The backend serves the dashboard and real-time integrations, with PostgreSQL as its shared persistence layer. The graph preserves documented product areas; source excerpts are selective, so several subsystem links reflect README-level architecture rather than inspected runtime calls.

Main entry points: [`Program.cs`](https://github.com/decatrondev/decatron/blob/main/Program.cs) (ASP.NET Core API), [`Decatron.Data/DecatronDbContext.cs`](https://github.com/decatrondev/decatron/blob/main/Decatron.Data/DecatronDbContext.cs) (Entity Framework context), [`ClientApp/src/pages`](https://github.com/decatrondev/decatron/tree/main/ClientApp/src/pages) (Dashboard and public pages), [`Decatron.Services/SongRequest`](https://github.com/decatrondev/decatron/tree/main/Decatron.Services/SongRequest) (Song requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Dashboard and overlays"]
  node_dashboard["Dashboard and public pages"]
  node_overlay_ui["Overlay renderers"]
end

subgraph group_runtime["Bot and streaming features"]
  node_bot_commands["Bot commands<br/>[CreateCommand.cs]"]
  node_scripting["Command scripting<br/>[Decatron.Scripting]"]
  node_moderation["Chat moderation"]
  node_song_requests["Song requests<br/>[SongRequest]"]
  node_timers_alerts["Timers and alerts"]
  node_tournaments["Tournaments<br/>[Tournament]"]
  node_live_translation["Live translation<br/>[LiveTranslation]"]
  node_discord["Discord features<br/>[Decatron.Discord]"]
end

subgraph group_platform["Platform services"]
  node_api["ASP.NET Core API<br/>[Program.cs]"]
  node_oauth["OAuth2 API<br/>[OAuthService.cs]"]
  node_tenancy["Tenant and entitlements<br/>[Tenancy]"]
  node_external["Platform integrations"]
end

subgraph group_foundation["Identity and persistence"]
  node_identity["Users and accounts<br/>[User.cs]"]
  node_core_models["Platform and timer models<br/>[Tenancy.cs]"]
  node_interfaces["Core service contracts<br/>[Interfaces]"]
  node_db_context["Entity Framework context"]
end

node_streamers(("Streamers and moderators"))
node_viewers(("Viewers"))
node_developers(("Developers"))
node_postgres[("PostgreSQL")]

node_streamers -->|"configure features"| node_dashboard
node_viewers -->|"use public pages"| node_dashboard
node_dashboard -->|"HTTPS and JWT"| node_api
node_dashboard -->|"configure overlays"| node_overlay_ui
node_overlay_ui -->|"SignalR updates"| node_api
node_viewers -->|"send chat commands"| node_bot_commands
node_api -->|"serves bot features"| node_bot_commands
node_api -->|"serves scripts"| node_scripting
node_api -->|"serves moderation"| node_moderation
node_dashboard -->|"manage requests"| node_song_requests
node_viewers -->|"request songs"| node_song_requests
node_api -->|"serves queue"| node_song_requests
node_api -->|"serves timer features"| node_timers_alerts
node_api -->|"serves tournaments"| node_tournaments
node_api -->|"serves translation"| node_live_translation
node_api -->|"serves Discord bot"| node_discord
node_developers -->|"authorize applications"| node_oauth
node_api -->|"hosts OAuth2 API"| node_oauth
node_api -->|"enforces tenant access"| node_tenancy
node_api -->|"connects integrations"| node_external
node_api -->|"persists application data"| node_db_context
node_db_context -->|"reads and writes"| node_postgres
node_tenancy -->|"checks storage quota"| node_db_context
node_timers_alerts -->|"reads and writes"| node_db_context
node_song_requests -->|"reads pending requests"| node_db_context
node_song_requests -.->|"notifies requester chat"| node_external
node_identity -->|"stored as user data"| node_db_context
node_core_models -->|"mapped for persistence"| node_db_context
node_oauth -->|"stores tokens"| node_db_context
node_interfaces -->|"defines entitlement contract"| node_tenancy

click node_dashboard "https://github.com/decatrondev/decatron/tree/main/ClientApp/src/pages"
click node_overlay_ui "https://github.com/decatrondev/decatron/tree/main/ClientApp/src/components"
click node_bot_commands "https://github.com/decatrondev/decatron/blob/main/Decatron.Custom/Commands/CreateCommand.cs"
click node_scripting "https://github.com/decatrondev/decatron/tree/main/Decatron.Scripting"
click node_moderation "https://github.com/decatrondev/decatron/blob/main/Decatron.Core/Services/ModerationService.cs"
click node_song_requests "https://github.com/decatrondev/decatron/tree/main/Decatron.Services/SongRequest"
click node_timers_alerts "https://github.com/decatrondev/decatron/blob/main/Decatron.Controllers/TimerExtensionController.cs"
click node_tournaments "https://github.com/decatrondev/decatron/tree/main/Decatron.Services/Tournament"
click node_live_translation "https://github.com/decatrondev/decatron/tree/main/Decatron.Services/LiveTranslation"
click node_discord "https://github.com/decatrondev/decatron/tree/main/Decatron.Discord"
click node_api "https://github.com/decatrondev/decatron/blob/main/Program.cs"
click node_oauth "https://github.com/decatrondev/decatron/blob/main/Decatron.Services/OAuthService.cs"
click node_tenancy "https://github.com/decatrondev/decatron/tree/main/Decatron.Services/Tenancy"
click node_identity "https://github.com/decatrondev/decatron/blob/main/Decatron.Core/Models/User.cs"
click node_core_models "https://github.com/decatrondev/decatron/blob/main/Decatron.Core/Models/Platform/Tenancy.cs"
click node_interfaces "https://github.com/decatrondev/decatron/tree/main/Decatron.Core/Interfaces"
click node_db_context "https://github.com/decatrondev/decatron/blob/main/Decatron.Data/DecatronDbContext.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_overlay_ui,node_viewers toneBlue
class node_bot_commands,node_scripting,node_moderation,node_song_requests,node_timers_alerts,node_tournaments,node_live_translation,node_discord,node_postgres toneAmber
class node_api,node_oauth,node_tenancy,node_external toneMint
class node_identity,node_core_models,node_interfaces,node_db_context toneRose
class node_streamers,node_developers toneIndigo
```

## Components

### Dashboard and overlays

- [Dashboard and public pages](https://github.com/decatrondev/decatron/tree/main/ClientApp/src/pages): `ClientApp/src/pages`
- [Overlay renderers](https://github.com/decatrondev/decatron/tree/main/ClientApp/src/components): `ClientApp/src/components`

### Bot and streaming features

- [Bot commands](https://github.com/decatrondev/decatron/blob/main/Decatron.Custom/Commands/CreateCommand.cs): `Decatron.Custom/Commands/CreateCommand.cs`
- [Command scripting](https://github.com/decatrondev/decatron/tree/main/Decatron.Scripting): `Decatron.Scripting`
- [Chat moderation](https://github.com/decatrondev/decatron/blob/main/Decatron.Core/Services/ModerationService.cs): `Decatron.Core/Services/ModerationService.cs`
- [Song requests](https://github.com/decatrondev/decatron/tree/main/Decatron.Services/SongRequest): `Decatron.Services/SongRequest`
- [Timers and alerts](https://github.com/decatrondev/decatron/blob/main/Decatron.Controllers/TimerExtensionController.cs): `Decatron.Controllers/TimerExtensionController.cs`
- [Tournaments](https://github.com/decatrondev/decatron/tree/main/Decatron.Services/Tournament): `Decatron.Services/Tournament`
- [Live translation](https://github.com/decatrondev/decatron/tree/main/Decatron.Services/LiveTranslation): `Decatron.Services/LiveTranslation`
- [Discord features](https://github.com/decatrondev/decatron/tree/main/Decatron.Discord): `Decatron.Discord`

### Platform services

- [ASP.NET Core API](https://github.com/decatrondev/decatron/blob/main/Program.cs): `Program.cs`
- [OAuth2 API](https://github.com/decatrondev/decatron/blob/main/Decatron.Services/OAuthService.cs): `Decatron.Services/OAuthService.cs`
- [Tenant and entitlements](https://github.com/decatrondev/decatron/tree/main/Decatron.Services/Tenancy): `Decatron.Services/Tenancy`
- **Platform integrations**

### Identity and persistence

- [Users and accounts](https://github.com/decatrondev/decatron/blob/main/Decatron.Core/Models/User.cs): `Decatron.Core/Models/User.cs`
- [Platform and timer models](https://github.com/decatrondev/decatron/blob/main/Decatron.Core/Models/Platform/Tenancy.cs): `Decatron.Core/Models/Platform/Tenancy.cs`
- [Core service contracts](https://github.com/decatrondev/decatron/tree/main/Decatron.Core/Interfaces): `Decatron.Core/Interfaces`
- [Entity Framework context](https://github.com/decatrondev/decatron/blob/main/Decatron.Data/DecatronDbContext.cs): `Decatron.Data/DecatronDbContext.cs`

### Other components

- **Streamers and moderators**
- **Viewers**
- **Developers**
- **PostgreSQL**

## Connections

- Streamers and moderators → Dashboard and public pages: configure features (evidence: `README.md`)
- Viewers → Dashboard and public pages: use public pages (evidence: `README.md`)
- Dashboard and public pages → ASP.NET Core API: HTTPS and JWT (evidence: `README.md`)
- Dashboard and public pages → Overlay renderers: configure overlays (evidence: `README.md`)
- Overlay renderers → ASP.NET Core API: SignalR updates (evidence: `README.md`)
- Viewers → Bot commands: send chat commands (evidence: `README.md`)
- ASP.NET Core API → Bot commands: serves bot features (evidence: `README.md`)
- ASP.NET Core API → Command scripting: serves scripts (evidence: `README.md`)
- ASP.NET Core API → Chat moderation: serves moderation (evidence: `README.md`)
- Dashboard and public pages → Song requests: manage requests (evidence: `README.md`)
- Viewers → Song requests: request songs (evidence: `README.md`)
- ASP.NET Core API → Song requests: serves queue (evidence: `README.md`)
- ASP.NET Core API → Timers and alerts: serves timer features (evidence: `README.md`)
- ASP.NET Core API → Tournaments: serves tournaments (evidence: `README.md`)
- ASP.NET Core API → Live translation: serves translation (evidence: `README.md`)
- ASP.NET Core API → Discord features: serves Discord bot (evidence: `README.md`)
- Developers → OAuth2 API: authorize applications (evidence: `README.md`)
- ASP.NET Core API → OAuth2 API: hosts OAuth2 API (evidence: `README.md`)
- ASP.NET Core API → Tenant and entitlements: enforces tenant access (evidence: `README.md`)
- ASP.NET Core API → Platform integrations: connects integrations (evidence: `README.md`)
- ASP.NET Core API → Entity Framework context: persists application data (evidence: `README.md`)
- Entity Framework context → PostgreSQL: reads and writes (evidence: `README.md`)
- Tenant and entitlements → Entity Framework context: checks storage quota (evidence: `Decatron.Services/Tenancy/StorageQuota.cs`)
- Timers and alerts → Entity Framework context: reads and writes (evidence: `Decatron.Controllers/TimerExtensionController.cs`)
- Song requests → Entity Framework context: reads pending requests (evidence: `Decatron.Services/SongRequest/SongRequestReviewService.cs`)
- Song requests → Platform integrations: notifies requester chat
- Users and accounts → Entity Framework context: stored as user data (evidence: `README.md`)
- Platform and timer models → Entity Framework context: mapped for persistence (evidence: `Decatron.Data/DecatronDbContext.cs`)
- OAuth2 API → Entity Framework context: stores tokens (evidence: `Decatron.Services/OAuthService.cs`)
- Core service contracts → Tenant and entitlements: defines entitlement contract (evidence: `Decatron.Core/Interfaces/IEntitlements.cs`)
