# rabbitgramdesktop/rabbitgramdesktop architecture

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

- Interactive diagram: https://gitdiagram.com/rabbitgramdesktop/rabbitgramdesktop
- Repository: https://github.com/rabbitgramdesktop/rabbitgramdesktop

## Overview

rabbitGram Desktop is a Telegram Desktop–based messenger with additional UI and chat features. A typical user action enters through a window/session controller, interacts with chat and message state, and may use API services to communicate with Telegram; local account and application settings are persisted separately. The README documents appearance, notification, chat, and miscellaneous enhancements, while the supplied excerpts do not identify their implementation. The graph therefore shows documented product areas without asserting unsampled wiring.

Main entry points: [`Telegram/SourceFiles/window/window_session_controller.cpp`](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/window/window_session_controller.cpp) (Window session), [`Telegram/SourceFiles/storage/storage_account.cpp`](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/storage/storage_account.cpp) (Account storage), [`Telegram/SourceFiles/core/application.h`](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/core/application.h) (Application services), [`Telegram/SourceFiles/api`](https://github.com/rabbitgramdesktop/rabbitgramdesktop/tree/dev/Telegram/SourceFiles/api) (Telegram API features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_window["Window session"]
  node_chatui["Chat composition<br/>[message_field.cpp]"]
  node_settingsui["Settings interface"]
  node_cacheui["Storage controls"]
  node_rabbitfeatures["RabbitGram enhancements"]
end

subgraph group_messaging["Messaging domain"]
  node_history["Message history<br/>[history.h]"]
  node_sessiondata["Session data<br/>[data_session.h]"]
  node_peerdata["User and peer data<br/>[data_user.h]"]
end

subgraph group_services["Application services"]
  node_apiwrap["API coordination<br/>[apiwrap.h]"]
  node_api["Telegram API features"]
  node_downloads["Media downloads"]
  node_calls["Voice and video calls"]
  node_inline["Inline bot storage"]
  node_passport["Passport flow"]
  node_viewer["Instant view<br/>[iv_controller.cpp]"]
  node_app["Application services<br/>[application.h]"]
end

subgraph group_persistence["Local persistence"]
  node_storageaccount[("Account storage")]
  node_localstorage[("Local settings<br/>[localstorage.cpp]")]
  node_settingsscheme["Settings serialization"]
end

node_user(("Desktop user"))

node_user -->|"uses"| node_window
node_window -->|"uses API"| node_apiwrap
node_window -.->|"opens chats"| node_history
node_window -.->|"uses session"| node_sessiondata
node_chatui -.->|"composes messages"| node_history
node_apiwrap -.->|"coordinates"| node_api
node_sessiondata -.->|"tracks peers"| node_peerdata
node_app -->|"provides manager"| node_downloads
node_window -.->|"opens settings"| node_settingsui
node_settingsui -->|"uses privacy APIs"| node_api
node_app -.->|"owns databases"| node_storageaccount
node_storageaccount -->|"uses local storage"| node_localstorage
node_localstorage -->|"reads settings"| node_settingsscheme
node_cacheui -->|"shows account storage"| node_storageaccount
node_inline -->|"uses account storage"| node_storageaccount
node_passport -->|"uses session controller"| node_window
node_viewer -.->|"uses application services"| node_app
node_calls -.->|"signals calls"| node_api
node_rabbitfeatures -.->|"extends desktop UX"| node_window

click node_window "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/window/window_session_controller.cpp"
click node_chatui "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/chat_helpers/message_field.cpp"
click node_settingsui "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp"
click node_history "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/history/history.h"
click node_sessiondata "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/data/data_session.h"
click node_peerdata "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/data/data_user.h"
click node_apiwrap "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/apiwrap.h"
click node_api "https://github.com/rabbitgramdesktop/rabbitgramdesktop/tree/dev/Telegram/SourceFiles/api"
click node_downloads "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/data/data_download_manager.cpp"
click node_calls "https://github.com/rabbitgramdesktop/rabbitgramdesktop/tree/dev/Telegram/SourceFiles/calls"
click node_inline "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/inline_bots/inline_bot_storage.cpp"
click node_passport "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/passport/passport_form_controller.cpp"
click node_viewer "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/iv/iv_controller.cpp"
click node_app "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/core/application.h"
click node_storageaccount "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/storage/storage_account.cpp"
click node_localstorage "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/storage/localstorage.cpp"
click node_settingsscheme "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/storage/details/storage_settings_scheme.cpp"
click node_cacheui "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/boxes/local_storage_box.cpp"
click node_rabbitfeatures "https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp"

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_window,node_chatui,node_settingsui,node_cacheui,node_rabbitfeatures,node_user toneBlue
class node_history,node_sessiondata,node_peerdata toneAmber
class node_apiwrap,node_api,node_downloads,node_calls,node_inline,node_passport,node_viewer,node_app toneMint
class node_storageaccount,node_localstorage,node_settingsscheme toneRose
```

## Components

### User interaction

- [Window session](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/window/window_session_controller.cpp): `Telegram/SourceFiles/window/window_session_controller.cpp`
- [Chat composition](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/chat_helpers/message_field.cpp): `Telegram/SourceFiles/chat_helpers/message_field.cpp`
- [Settings interface](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp): `Telegram/SourceFiles/settings/settings_privacy_controllers.cpp`
- [Storage controls](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/boxes/local_storage_box.cpp): `Telegram/SourceFiles/boxes/local_storage_box.cpp`
- [RabbitGram enhancements](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp): `Telegram/SourceFiles/settings/settings_privacy_controllers.cpp`

### Messaging domain

- [Message history](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/history/history.h): `Telegram/SourceFiles/history/history.h`
- [Session data](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/data/data_session.h): `Telegram/SourceFiles/data/data_session.h`
- [User and peer data](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/data/data_user.h): `Telegram/SourceFiles/data/data_user.h`

### Application services

- [API coordination](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/apiwrap.h): `Telegram/SourceFiles/apiwrap.h`
- [Telegram API features](https://github.com/rabbitgramdesktop/rabbitgramdesktop/tree/dev/Telegram/SourceFiles/api): `Telegram/SourceFiles/api`
- [Media downloads](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/data/data_download_manager.cpp): `Telegram/SourceFiles/data/data_download_manager.cpp`
- [Voice and video calls](https://github.com/rabbitgramdesktop/rabbitgramdesktop/tree/dev/Telegram/SourceFiles/calls): `Telegram/SourceFiles/calls`
- [Inline bot storage](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/inline_bots/inline_bot_storage.cpp): `Telegram/SourceFiles/inline_bots/inline_bot_storage.cpp`
- [Passport flow](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/passport/passport_form_controller.cpp): `Telegram/SourceFiles/passport/passport_form_controller.cpp`
- [Instant view](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/iv/iv_controller.cpp): `Telegram/SourceFiles/iv/iv_controller.cpp`
- [Application services](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/core/application.h): `Telegram/SourceFiles/core/application.h`

### Local persistence

- [Account storage](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/storage/storage_account.cpp): `Telegram/SourceFiles/storage/storage_account.cpp`
- [Local settings](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/storage/localstorage.cpp): `Telegram/SourceFiles/storage/localstorage.cpp`
- [Settings serialization](https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/Telegram/SourceFiles/storage/details/storage_settings_scheme.cpp): `Telegram/SourceFiles/storage/details/storage_settings_scheme.cpp`

### Other components

- **Desktop user**

## Connections

- Desktop user → Window session: uses
- Window session → API coordination: uses API (evidence: `Telegram/SourceFiles/window/window_session_controller.cpp`)
- Window session → Message history: opens chats (evidence: `Telegram/SourceFiles/window/window_session_controller.cpp`)
- Window session → Session data: uses session (evidence: `Telegram/SourceFiles/window/window_session_controller.cpp`)
- Chat composition → Message history: composes messages
- API coordination → Telegram API features: coordinates (evidence: `Telegram/SourceFiles/apiwrap.h`)
- Session data → User and peer data: tracks peers
- Application services → Media downloads: provides manager (evidence: `Telegram/SourceFiles/core/application.h`)
- Window session → Settings interface: opens settings
- Settings interface → Telegram API features: uses privacy APIs (evidence: `Telegram/SourceFiles/settings/settings_privacy_controllers.cpp`)
- Application services → Account storage: owns databases (evidence: `Telegram/SourceFiles/storage/storage_account.cpp`)
- Account storage → Local settings: uses local storage (evidence: `Telegram/SourceFiles/storage/storage_account.cpp`)
- Local settings → Settings serialization: reads settings (evidence: `Telegram/SourceFiles/storage/localstorage.cpp`)
- Storage controls → Account storage: shows account storage (evidence: `Telegram/SourceFiles/boxes/local_storage_box.cpp`)
- Inline bot storage → Account storage: uses account storage (evidence: `Telegram/SourceFiles/inline_bots/inline_bot_storage.cpp`)
- Passport flow → Window session: uses session controller (evidence: `Telegram/SourceFiles/passport/passport_form_controller.cpp`)
- Instant view → Application services: uses application services
- Voice and video calls → Telegram API features: signals calls (evidence: `Telegram/SourceFiles/calls/calls_box_controller.cpp`)
- RabbitGram enhancements → Window session: extends desktop UX
