# madhu-maneesh/toptech architecture

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

- Interactive diagram: https://gitdiagram.com/madhu-maneesh/toptech
- Repository: https://github.com/madhu-maneesh/toptech

## Overview

TopTech Bot is a Spring Boot service with two entry points: Telegram long polling and HTTP endpoints. Telegram commands are handled by the bot, which calls NewsService for news and sends the response back; HTTP /news also calls that service. The README describes Hacker News, but the sampled NewsService fetches and parses Google News RSS feeds, so the graph reflects the sampled implementation. Some internal methods are omitted from the excerpts; edges are limited to relationships visible in the excerpts or README.

Main entry points: [`src/main/java/com/toptech/toptech/Service/botService.java`](https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Service/botService.java) (Telegram handler), [`src/main/java/com/toptech/toptech/Confing/botconfig.java`](https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Confing/botconfig.java) (Bot configuration), [`src/main/java/com/toptech/toptech/Service/NewsService.java`](https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Service/NewsService.java) (News service), [`src/main/java/com/toptech/toptech/Controller/NewsController.java`](https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Controller/NewsController.java) (News endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry points"]
  node_spring_app["Spring Boot app"]
  node_bot_config["Bot configuration<br/>[botconfig.java]"]
  node_bot_handler["Telegram handler<br/>[botService.java]"]
  node_http_controller["News endpoint"]
end

subgraph group_news["News retrieval"]
  node_news_service["News service<br/>[NewsService.java]"]
end

subgraph group_integration["External integrations"]
  node_rss_feeds["Google News RSS"]
  node_telegram_api["Telegram API"]
end

node_telegram_user(("Telegram user"))
node_http_client(("HTTP client"))

node_telegram_user -->|"sends commands"| node_bot_handler
node_bot_config -->|"creates bot"| node_bot_handler
node_bot_config -->|"registers bot"| node_telegram_api
node_bot_handler -->|"requests stories"| node_news_service
node_bot_handler -->|"sends replies"| node_telegram_api
node_http_client -->|"requests news"| node_http_controller
node_http_controller -->|"requests stories"| node_news_service
node_news_service -->|"fetches feeds"| node_rss_feeds
node_spring_app -.->|"starts context"| node_bot_config

click node_spring_app "https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/ToptechApplication.java"
click node_bot_config "https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Confing/botconfig.java"
click node_bot_handler "https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Service/botService.java"
click node_http_controller "https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Controller/NewsController.java"
click node_news_service "https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Service/NewsService.java"

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_spring_app,node_bot_config,node_bot_handler,node_http_controller,node_telegram_user,node_http_client toneBlue
class node_news_service toneAmber
class node_rss_feeds,node_telegram_api toneMint
```

## Components

### Application entry points

- [Spring Boot app](https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/ToptechApplication.java): `src/main/java/com/toptech/toptech/ToptechApplication.java`
- [Bot configuration](https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Confing/botconfig.java): `src/main/java/com/toptech/toptech/Confing/botconfig.java`
- [Telegram handler](https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Service/botService.java): `src/main/java/com/toptech/toptech/Service/botService.java`
- [News endpoint](https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Controller/NewsController.java): `src/main/java/com/toptech/toptech/Controller/NewsController.java`

### News retrieval

- [News service](https://github.com/madhu-maneesh/toptech/blob/main/src/main/java/com/toptech/toptech/Service/NewsService.java): `src/main/java/com/toptech/toptech/Service/NewsService.java`

### External integrations

- **Google News RSS**
- **Telegram API**

### Other components

- **Telegram user**
- **HTTP client**

## Connections

- Telegram user → Telegram handler: sends commands (evidence: `README.md`)
- Bot configuration → Telegram handler: creates bot (evidence: `src/main/java/com/toptech/toptech/Confing/botconfig.java`)
- Bot configuration → Telegram API: registers bot (evidence: `src/main/java/com/toptech/toptech/Confing/botconfig.java`)
- Telegram handler → News service: requests stories (evidence: `src/main/java/com/toptech/toptech/Service/botService.java`)
- Telegram handler → Telegram API: sends replies (evidence: `src/main/java/com/toptech/toptech/Service/botService.java`)
- HTTP client → News endpoint: requests news (evidence: `src/main/java/com/toptech/toptech/Controller/NewsController.java`)
- News endpoint → News service: requests stories (evidence: `src/main/java/com/toptech/toptech/Controller/NewsController.java`)
- News service → Google News RSS: fetches feeds (evidence: `src/main/java/com/toptech/toptech/Service/NewsService.java`)
- Spring Boot app → Bot configuration: starts context
