# chatterino/chatterino2 architecture

> Architecture diagram of the GitHub repository chatterino/chatterino2, 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/chatterino/chatterino2
- Repository: https://github.com/chatterino/chatterino2

## Overview

Chatterino 2 is a Twitch chat client. Its broad runtime is organized around an application coordinator that initializes account, window, command, notification, and Twitch-facing services; users interact through the chat UI and those services. The tree also shows substantial message construction, moderation/highlight, plugin, and third-party provider subsystems. Evidence is limited to the README, the supplied excerpts, and SOURCE INDEX references; edges are omitted where those sources do not establish a caller or data transfer.

Main entry points: [`src/Application.cpp`](https://github.com/chatterino/chatterino2/blob/master/src/Application.cpp) (Application coordinator), [`src/controllers/notifications/NotificationController.cpp`](https://github.com/chatterino/chatterino2/blob/master/src/controllers/notifications/NotificationController.cpp) (Notifications), [`src/main.cpp`](https://github.com/chatterino/chatterino2/blob/master/src/main.cpp) (Application entry), [`src/common/network/NetworkManager.cpp`](https://github.com/chatterino/chatterino2/blob/master/src/common/network/NetworkManager.cpp) (Network manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_entry["Application entry<br/>[main.cpp]"]
  node_app["Application coordinator<br/>[Application.cpp]"]
  node_args["Startup arguments<br/>[Args.hpp]"]
  node_network["Network manager<br/>[NetworkManager.cpp]"]
end

subgraph group_chat["Chat experience"]
  node_windows["Window manager<br/>[WindowManager.cpp]"]
  node_channel["Chat channel<br/>[Channel.hpp]"]
  node_message["Chat messages<br/>[Message.hpp]"]
  node_builder["Message builder<br/>[MessageBuilder.hpp]"]
  node_elements["Message elements<br/>[MessageElement.hpp]"]
end

subgraph group_twitch["Twitch services"]
  node_accounts["Account controller"]
  node_twitch["Twitch IRC server<br/>[IrcConnection2.cpp]"]
  node_pubsub["Twitch PubSub<br/>[PubSubManager.cpp]"]
  node_eventsub["Twitch EventSub<br/>[Controller.cpp]"]
  node_liveupdates["Live updates"]
end

subgraph group_extensions["Additional capabilities"]
  node_commands["Commands"]
  node_highlights["Highlights"]
  node_notifications["Notifications"]
  node_plugins["Lua plugins"]
  node_providers["Third-party providers"]
end

node_user(("Chat user"))

node_user -->|"starts client"| node_entry
node_app -->|"loads accounts"| node_accounts
node_app -->|"initializes windows"| node_windows
node_app -->|"creates controller"| node_commands
node_app -->|"creates controller"| node_notifications
node_app -->|"creates controller"| node_highlights
node_app -->|"initializes and connects"| node_twitch
node_app -->|"creates service"| node_pubsub
node_app -->|"initializes updates"| node_liveupdates
node_app -->|"initializes event APIs"| node_eventsub
node_entry -->|"reads arguments"| node_args
node_network -->|"manages requests"| node_network
node_commands -->|"uses channel context"| node_channel
node_notifications -->|"uses messages"| node_message
node_notifications -->|"uses builder"| node_builder
node_windows -->|"uses message elements"| node_elements
node_pubsub -->|"uses manager"| node_liveupdates

click node_entry "https://github.com/chatterino/chatterino2/blob/master/src/main.cpp"
click node_app "https://github.com/chatterino/chatterino2/blob/master/src/Application.cpp"
click node_args "https://github.com/chatterino/chatterino2/blob/master/src/common/Args.hpp"
click node_network "https://github.com/chatterino/chatterino2/blob/master/src/common/network/NetworkManager.cpp"
click node_windows "https://github.com/chatterino/chatterino2/blob/master/src/singletons/WindowManager.cpp"
click node_channel "https://github.com/chatterino/chatterino2/blob/master/src/common/Channel.hpp"
click node_message "https://github.com/chatterino/chatterino2/blob/master/src/messages/Message.hpp"
click node_builder "https://github.com/chatterino/chatterino2/blob/master/src/messages/MessageBuilder.hpp"
click node_elements "https://github.com/chatterino/chatterino2/blob/master/src/messages/MessageElement.hpp"
click node_accounts "https://github.com/chatterino/chatterino2/blob/master/src/controllers/accounts/AccountController.hpp"
click node_twitch "https://github.com/chatterino/chatterino2/blob/master/src/providers/irc/IrcConnection2.cpp"
click node_pubsub "https://github.com/chatterino/chatterino2/blob/master/src/providers/twitch/PubSubManager.cpp"
click node_eventsub "https://github.com/chatterino/chatterino2/blob/master/src/providers/twitch/eventsub/Controller.cpp"
click node_liveupdates "https://github.com/chatterino/chatterino2/blob/master/src/providers/liveupdates/BasicPubSubManager.hpp"
click node_commands "https://github.com/chatterino/chatterino2/blob/master/src/controllers/commands/CommandController.cpp"
click node_highlights "https://github.com/chatterino/chatterino2/blob/master/src/controllers/highlights/HighlightController.cpp"
click node_notifications "https://github.com/chatterino/chatterino2/blob/master/src/controllers/notifications/NotificationController.cpp"
click node_plugins "https://github.com/chatterino/chatterino2/blob/master/src/controllers/plugins/PluginController.cpp"
click node_providers "https://github.com/chatterino/chatterino2/tree/master/src/providers"

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_entry,node_app,node_args,node_network,node_user toneBlue
class node_windows,node_channel,node_message,node_builder,node_elements toneAmber
class node_accounts,node_twitch,node_pubsub,node_eventsub,node_liveupdates toneMint
class node_commands,node_highlights,node_notifications,node_plugins,node_providers toneRose
```

## Components

### Application runtime

- [Application entry](https://github.com/chatterino/chatterino2/blob/master/src/main.cpp): `src/main.cpp`
- [Application coordinator](https://github.com/chatterino/chatterino2/blob/master/src/Application.cpp): `src/Application.cpp`
- [Startup arguments](https://github.com/chatterino/chatterino2/blob/master/src/common/Args.hpp): `src/common/Args.hpp`
- [Network manager](https://github.com/chatterino/chatterino2/blob/master/src/common/network/NetworkManager.cpp): `src/common/network/NetworkManager.cpp`

### Chat experience

- [Window manager](https://github.com/chatterino/chatterino2/blob/master/src/singletons/WindowManager.cpp): `src/singletons/WindowManager.cpp`
- [Chat channel](https://github.com/chatterino/chatterino2/blob/master/src/common/Channel.hpp): `src/common/Channel.hpp`
- [Chat messages](https://github.com/chatterino/chatterino2/blob/master/src/messages/Message.hpp): `src/messages/Message.hpp`
- [Message builder](https://github.com/chatterino/chatterino2/blob/master/src/messages/MessageBuilder.hpp): `src/messages/MessageBuilder.hpp`
- [Message elements](https://github.com/chatterino/chatterino2/blob/master/src/messages/MessageElement.hpp): `src/messages/MessageElement.hpp`

### Twitch services

- [Account controller](https://github.com/chatterino/chatterino2/blob/master/src/controllers/accounts/AccountController.hpp): `src/controllers/accounts/AccountController.hpp`
- [Twitch IRC server](https://github.com/chatterino/chatterino2/blob/master/src/providers/irc/IrcConnection2.cpp): `src/providers/irc/IrcConnection2.cpp`
- [Twitch PubSub](https://github.com/chatterino/chatterino2/blob/master/src/providers/twitch/PubSubManager.cpp): `src/providers/twitch/PubSubManager.cpp`
- [Twitch EventSub](https://github.com/chatterino/chatterino2/blob/master/src/providers/twitch/eventsub/Controller.cpp): `src/providers/twitch/eventsub/Controller.cpp`
- [Live updates](https://github.com/chatterino/chatterino2/blob/master/src/providers/liveupdates/BasicPubSubManager.hpp): `src/providers/liveupdates/BasicPubSubManager.hpp`

### Additional capabilities

- [Commands](https://github.com/chatterino/chatterino2/blob/master/src/controllers/commands/CommandController.cpp): `src/controllers/commands/CommandController.cpp`
- [Highlights](https://github.com/chatterino/chatterino2/blob/master/src/controllers/highlights/HighlightController.cpp): `src/controllers/highlights/HighlightController.cpp`
- [Notifications](https://github.com/chatterino/chatterino2/blob/master/src/controllers/notifications/NotificationController.cpp): `src/controllers/notifications/NotificationController.cpp`
- [Lua plugins](https://github.com/chatterino/chatterino2/blob/master/src/controllers/plugins/PluginController.cpp): `src/controllers/plugins/PluginController.cpp`
- [Third-party providers](https://github.com/chatterino/chatterino2/tree/master/src/providers): `src/providers`

### Other components

- **Chat user**

## Connections

- Chat user → Application entry: starts client (evidence: `README.md`)
- Application coordinator → Account controller: loads accounts (evidence: `src/Application.cpp`)
- Application coordinator → Window manager: initializes windows (evidence: `src/Application.cpp`)
- Application coordinator → Commands: creates controller (evidence: `src/Application.cpp`)
- Application coordinator → Notifications: creates controller (evidence: `src/Application.cpp`)
- Application coordinator → Highlights: creates controller (evidence: `src/Application.cpp`)
- Application coordinator → Twitch IRC server: initializes and connects (evidence: `src/Application.cpp`)
- Application coordinator → Twitch PubSub: creates service (evidence: `src/Application.cpp`)
- Application coordinator → Live updates: initializes updates (evidence: `src/Application.cpp`)
- Application coordinator → Twitch EventSub: initializes event APIs (evidence: `src/Application.cpp`)
- Application entry → Startup arguments: reads arguments (evidence: `src/main.cpp`)
- Network manager → Network manager: manages requests (evidence: `src/common/network/NetworkManager.cpp`)
- Commands → Chat channel: uses channel context (evidence: `src/controllers/commands/CommandController.cpp`)
- Notifications → Chat messages: uses messages (evidence: `src/controllers/notifications/NotificationController.cpp`)
- Notifications → Message builder: uses builder (evidence: `src/controllers/notifications/NotificationController.cpp`)
- Window manager → Message elements: uses message elements (evidence: `src/singletons/WindowManager.cpp`)
- Twitch PubSub → Live updates: uses manager (evidence: `src/providers/twitch/PubSubManager.cpp`)
