# anvar-khikmatov/telegram-job-filter-bot architecture

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

- Interactive diagram: https://gitdiagram.com/anvar-khikmatov/telegram-job-filter-bot
- Repository: https://github.com/anvar-khikmatov/telegram-job-filter-bot

## Overview

This bot polls configured Telegram channels, classifies new posts as employer frontend jobs with Gemini, reposts matches with their source links, and records per-channel progress in JSONBin. The main orchestration and dependency calls are visible in `src/index.js`; the README documents scheduled runs. Session generation is a separate one-time setup flow. The graph omits the workflow implementation and limits external-service edges to relationships shown in source or documented capabilities.

Main entry points: [`src/index.js`](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/index.js) (Bot orchestrator), [`src/telegram.js`](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/telegram.js) (Message reader), [`src/poster.js`](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/poster.js) (Message formatter), [`src/generate-session.js`](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/generate-session.js) (Session generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Job processing"]
  node_orchestrator["Bot orchestrator<br/>[index.js]"]
  node_poster["Message formatter<br/>[poster.js]"]
end

subgraph group_telegram["Telegram access"]
  node_telegram_reader["Message reader<br/>[telegram.js]"]
  node_session_generator["Session generator"]
end

subgraph group_classification["Job classification"]
  node_classifier["Job classifier<br/>[filter.js]"]
end

subgraph group_state["Progress storage"]
  node_progress_store["Progress client<br/>[store.js]"]
end

node_scheduler(("Scheduled run"))
node_source_channels(("Source channels"))
node_telegram_api{{"Telegram API"}}
node_gemini{{"Gemini API"}}
node_telegram_bot_api{{"Telegram Bot API"}}
node_jsonbin[("JSONBin")]
node_session_user(("Setup user"))

node_scheduler -->|"starts run"| node_orchestrator
node_orchestrator -->|"fetches messages"| node_telegram_reader
node_telegram_reader -->|"reads messages"| node_telegram_api
node_orchestrator -->|"classifies batch"| node_classifier
node_classifier -->|"requests classification"| node_gemini
node_orchestrator -->|"gets source links"| node_telegram_reader
node_orchestrator -->|"posts matches"| node_poster
node_poster -->|"sends message"| node_telegram_bot_api
node_orchestrator -->|"loads and saves"| node_progress_store
node_progress_store -->|"reads and writes"| node_jsonbin
node_session_user -->|"provides credentials"| node_session_generator
node_session_generator -->|"authenticates"| node_telegram_api

click node_orchestrator "https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/index.js"
click node_telegram_reader "https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/telegram.js"
click node_classifier "https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/filter.js"
click node_poster "https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/poster.js"
click node_progress_store "https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/store.js"
click node_session_generator "https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/generate-session.js"

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_orchestrator,node_poster,node_session_user toneBlue
class node_telegram_reader,node_session_generator,node_jsonbin toneAmber
class node_classifier,node_telegram_api,node_gemini,node_telegram_bot_api toneMint
class node_progress_store toneRose
class node_scheduler,node_source_channels toneIndigo
```

## Components

### Job processing

- [Bot orchestrator](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/index.js): `src/index.js`
- [Message formatter](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/poster.js): `src/poster.js`

### Telegram access

- [Message reader](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/telegram.js): `src/telegram.js`
- [Session generator](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/generate-session.js): `src/generate-session.js`

### Job classification

- [Job classifier](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/filter.js): `src/filter.js`

### Progress storage

- [Progress client](https://github.com/anvar-khikmatov/telegram-job-filter-bot/blob/main/src/store.js): `src/store.js`

### Other components

- **Scheduled run**
- **Source channels**
- **Telegram API**
- **Gemini API**
- **Telegram Bot API**
- **JSONBin**
- **Setup user**

## Connections

- Scheduled run → Bot orchestrator: starts run (evidence: `README.md`)
- Bot orchestrator → Message reader: fetches messages (evidence: `src/index.js`)
- Message reader → Telegram API: reads messages (evidence: `src/telegram.js`)
- Bot orchestrator → Job classifier: classifies batch (evidence: `src/index.js`)
- Job classifier → Gemini API: requests classification (evidence: `src/filter.js`)
- Bot orchestrator → Message reader: gets source links (evidence: `src/index.js`)
- Bot orchestrator → Message formatter: posts matches (evidence: `src/index.js`)
- Message formatter → Telegram Bot API: sends message (evidence: `src/poster.js`)
- Bot orchestrator → Progress client: loads and saves (evidence: `src/index.js`)
- Progress client → JSONBin: reads and writes (evidence: `src/store.js`)
- Setup user → Session generator: provides credentials (evidence: `src/generate-session.js`)
- Session generator → Telegram API: authenticates (evidence: `src/generate-session.js`)
