# electronic-mango/rss-reader-telegram-bot architecture

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

- Interactive diagram: https://gitdiagram.com/electronic-mango/rss-reader-telegram-bot
- Repository: https://github.com/electronic-mango/rss-reader-telegram-bot

## Overview

This is an RSS-subscription Telegram bot. Users add feeds from configured feed types, inspect or remove subscriptions, and receive updates as the bot checks feeds and sends new entries. The graph preserves command handling, feed retrieval/parsing, update delivery, and persistence as separate stages. Several edges are supported by the SOURCE INDEX’s import references; broader update and delivery behavior is documented in the README. Unsampled subsystems are represented only where the tree and documentation establish their role.

Main entry points: [`src/main/bot/telegram_bot.py`](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/telegram_bot.py) (Bot registration), [`src/main/bot/update_checker.py`](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/update_checker.py) (Update checker), [`src/main/bot/command/add.py`](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/command/add.py) (Add subscription), [`src/main/feed/reader.py`](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/feed/reader.py) (Feed retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Telegram interaction"]
  node_app["Bot startup<br/>[main.py]"]
  node_bot["Bot registration<br/>[telegram_bot.py]"]
  node_commands["Core commands"]
  node_add["Add subscription<br/>[add.py]"]
  node_subs["Browse subscriptions<br/>[handler.py]"]
  node_subs_data["Subscription query data<br/>[query_data.py]"]
  node_access["User access filter<br/>[user_filter.py]"]
  node_settings["Configuration<br/>[settings.py]"]
end

subgraph group_feeds["Feed processing"]
  node_feed_source(("RSS feed sources"))
  node_reader["Feed retrieval<br/>[reader.py]"]
  node_parser["Entry formatting<br/>[parser.py]"]
  node_feed_types["Feed data types<br/>[types.py]"]
end

subgraph group_updates["Update delivery"]
  node_checker["Update checker<br/>[update_checker.py]"]
  node_sender["Message sender<br/>[sender.py]"]
end

subgraph group_storage["Subscription storage"]
  node_mongo[("MongoDB")]
  node_db_client["Database client<br/>[client.py]"]
  node_db_wrapper["Subscription operations<br/>[wrapper.py]"]
end

node_user(("Telegram user"))
node_telegram(("Telegram platform"))

node_user -->|"sends commands"| node_telegram
node_telegram -->|"delivers updates"| node_bot
node_app -->|"loads configuration"| node_settings
node_app -->|"starts"| node_bot
node_bot -->|"registers handlers"| node_commands
node_bot -->|"registers"| node_add
node_bot -->|"registers"| node_subs
node_add -->|"filters users"| node_access
node_subs -->|"routes callback data"| node_subs_data
node_add -->|"retrieves and validates"| node_reader
node_add -->|"checks and stores"| node_db_wrapper
node_reader -->|"fetches RSS"| node_feed_source
node_reader -->|"uses"| node_feed_types
node_checker -->|"checks feeds"| node_reader
node_checker -->|"parses entries"| node_parser
node_checker -->|"reads and updates"| node_db_wrapper
node_checker -->|"dispatches updates"| node_sender
node_sender -->|"sends messages"| node_telegram
node_db_wrapper -->|"delegates database operations"| node_db_client
node_db_client -->|"reads and writes"| node_mongo

click node_app "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/main.py"
click node_bot "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/telegram_bot.py"
click node_commands "https://github.com/electronic-mango/rss-reader-telegram-bot/tree/main/src/main/bot/command"
click node_add "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/command/add.py"
click node_subs "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/command/subs/handler.py"
click node_subs_data "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/command/subs/query_data.py"
click node_access "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/user_filter.py"
click node_settings "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/settings.py"
click node_reader "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/feed/reader.py"
click node_parser "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/feed/parser.py"
click node_feed_types "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/feed/types.py"
click node_checker "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/update_checker.py"
click node_sender "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/sender.py"
click node_db_client "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/db/client.py"
click node_db_wrapper "https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/db/wrapper.py"

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_app,node_bot,node_commands,node_add,node_subs,node_subs_data,node_access,node_settings,node_user toneBlue
class node_feed_source,node_reader,node_parser,node_feed_types toneAmber
class node_checker,node_sender toneMint
class node_mongo,node_db_client,node_db_wrapper toneRose
class node_telegram toneIndigo
```

## Components

### Telegram interaction

- [Bot startup](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/main.py): `src/main/main.py`
- [Bot registration](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/telegram_bot.py): `src/main/bot/telegram_bot.py`
- [Core commands](https://github.com/electronic-mango/rss-reader-telegram-bot/tree/main/src/main/bot/command): `src/main/bot/command`
- [Add subscription](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/command/add.py): `src/main/bot/command/add.py`
- [Browse subscriptions](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/command/subs/handler.py): `src/main/bot/command/subs/handler.py`
- [Subscription query data](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/command/subs/query_data.py): `src/main/bot/command/subs/query_data.py`
- [User access filter](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/user_filter.py): `src/main/bot/user_filter.py`
- [Configuration](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/settings.py): `src/main/settings.py`

### Feed processing

- **RSS feed sources**
- [Feed retrieval](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/feed/reader.py): `src/main/feed/reader.py`
- [Entry formatting](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/feed/parser.py): `src/main/feed/parser.py`
- [Feed data types](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/feed/types.py): `src/main/feed/types.py`

### Update delivery

- [Update checker](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/update_checker.py): `src/main/bot/update_checker.py`
- [Message sender](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/bot/sender.py): `src/main/bot/sender.py`

### Subscription storage

- **MongoDB**
- [Database client](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/db/client.py): `src/main/db/client.py`
- [Subscription operations](https://github.com/electronic-mango/rss-reader-telegram-bot/blob/main/src/main/db/wrapper.py): `src/main/db/wrapper.py`

### Other components

- **Telegram user**
- **Telegram platform**

## Connections

- Telegram user → Telegram platform: sends commands (evidence: `README.md`)
- Telegram platform → Bot registration: delivers updates (evidence: `src/main/bot/telegram_bot.py`)
- Bot startup → Configuration: loads configuration (evidence: `src/main/main.py`)
- Bot startup → Bot registration: starts (evidence: `src/main/main.py`)
- Bot registration → Core commands: registers handlers (evidence: `src/main/bot/telegram_bot.py`)
- Bot registration → Add subscription: registers (evidence: `src/main/bot/telegram_bot.py`)
- Bot registration → Browse subscriptions: registers (evidence: `src/main/bot/telegram_bot.py`)
- Add subscription → User access filter: filters users (evidence: `src/main/bot/command/add.py`)
- Browse subscriptions → Subscription query data: routes callback data (evidence: `src/main/bot/command/subs/handler.py`)
- Add subscription → Feed retrieval: retrieves and validates (evidence: `src/main/bot/command/add.py`)
- Add subscription → Subscription operations: checks and stores (evidence: `src/main/bot/command/add.py`)
- Feed retrieval → RSS feed sources: fetches RSS (evidence: `src/main/feed/reader.py`)
- Feed retrieval → Feed data types: uses (evidence: `src/main/feed/reader.py`)
- Update checker → Feed retrieval: checks feeds (evidence: `src/main/bot/update_checker.py`)
- Update checker → Entry formatting: parses entries (evidence: `src/main/bot/update_checker.py`)
- Update checker → Subscription operations: reads and updates (evidence: `src/main/bot/update_checker.py`)
- Update checker → Message sender: dispatches updates (evidence: `src/main/bot/update_checker.py`)
- Message sender → Telegram platform: sends messages (evidence: `README.md`)
- Subscription operations → Database client: delegates database operations (evidence: `src/main/db/wrapper.py`)
- Database client → MongoDB: reads and writes (evidence: `src/main/db/client.py`)
