# pltnk/habr-observer architecture

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

- Interactive diagram: https://gitdiagram.com/pltnk/habr-observer
- Repository: https://github.com/pltnk/habr-observer

## Overview

Habr Observer presents Habr top-article feeds with YandexGPT-generated summaries. The visitor loads feeds, selects a feed, and reads article cards with summaries and source links. A separate updater workflow refreshes Habr articles and obtains summaries before persisting feed data for the `/feeds` API. Frontend component relationships are evidenced by excerpts; backend wiring is based on read source files in the index. The README documents the product and external services, but does not specify finer backend call chains.

Main entry points: [`frontend/src/App.tsx`](https://github.com/pltnk/habr-observer/blob/main/frontend/src/App.tsx) (App shell), [`backend/internal/infrastructure/yagpt/client.go`](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/client.go) (YandexGPT client), [`backend/internal/application/usecases/update_feed.go`](https://github.com/pltnk/habr-observer/blob/main/backend/internal/application/usecases/update_feed.go) (Update feed), [`backend/internal/infrastructure/habr/client.go`](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/habr/client.go) (Habr RSS client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Feed viewer"]
  node_app["App shell<br/>[App.tsx]"]
  node_feedhook["Feed state<br/>[useFeeds.ts]"]
  node_feedapi["Feed client<br/>[feeds.ts]"]
  node_tabs["Feed tabs<br/>[FeedTabs.tsx]"]
  node_articlecard["Article cards<br/>[ArticleEntry.tsx]"]
  node_theses["Summary theses<br/>[SummaryTheses.tsx]"]
  node_preferences["View preferences"]
  node_theme["Theme preference"]
  node_selector["Summary selector"]
  node_themecontrol["Theme selector<br/>[ThemeSelector.tsx]"]
  node_navigation["Page controls<br/>[BackToTop.tsx]"]
  node_header["Header<br/>[Header.tsx]"]
  node_footer["Credits footer<br/>[Footer.tsx]"]
end

subgraph group_api["Feed API"]
  node_server["HTTP server<br/>[main.go]"]
  node_delivery["Feeds endpoint<br/>[get_feeds.go]"]
  node_getfeeds["Get feeds<br/>[get_feeds.go]"]
  node_entities["Feed entities<br/>[entities.go]"]
end

subgraph group_refresh["Feed refresh"]
  node_updatercmd["Updater process<br/>[main.go]"]
  node_runner["Refresh runner<br/>[runner.go]"]
  node_updatecase["Update feed<br/>[update_feed.go]"]
  node_updatersvc["Updater service<br/>[updater.go]"]
end

subgraph group_connectors["External services"]
  node_habr["Habr RSS client<br/>[client.go]"]
  node_habrparse["Article parsing<br/>[parse.go]"]
  node_habrrss["RSS handling<br/>[rss.go]"]
  node_yagpt["YandexGPT client<br/>[client.go]"]
  node_summaryapi["Summary API<br/>[summary_api.go]"]
  node_summaryhtml["Summary HTML<br/>[summary_html.go]"]
  node_summaryurl["Summary URL<br/>[summary_url.go]"]
  node_summaryurlapi["Summary URL API<br/>[summary_url_api.go]"]
end

subgraph group_storage["Persistence"]
  node_articlesrepo["Article repository<br/>[articles.go]"]
  node_feedsrepo["Feed repository<br/>[feeds.go]"]
end

node_visitor(("Visitor"))
node_habrsite["Habr"]
node_yandex["300.ya.ru"]

node_visitor -->|"opens"| node_app
node_app -->|"loads state"| node_feedhook
node_feedhook -->|"fetches feeds"| node_feedapi
node_feedapi -->|"GET /feeds"| node_server
node_app -->|"renders"| node_tabs
node_tabs -->|"renders cards"| node_articlecard
node_articlecard -->|"renders summary"| node_theses
node_app -->|"reads preference"| node_preferences
node_app -->|"reads preference"| node_theme
node_app -->|"renders"| node_selector
node_app -->|"renders"| node_themecontrol
node_themecontrol -->|"updates"| node_theme
node_app -->|"renders"| node_header
node_app -->|"renders"| node_footer
node_app -->|"renders"| node_navigation
node_server -.->|"serves"| node_delivery
node_delivery -.->|"handles request"| node_getfeeds
node_getfeeds -.->|"reads feeds"| node_feedsrepo
node_updatercmd -.->|"starts"| node_runner
node_runner -.->|"runs updates"| node_updatecase
node_updatecase -.->|"delegates"| node_updatersvc
node_updatersvc -.->|"gets articles"| node_habr
node_habr -.->|"fetches RSS"| node_habrsite
node_habr -.->|"parses articles"| node_habrparse
node_habr -.->|"reads feed"| node_habrrss
node_updatersvc -.->|"requests summaries"| node_yagpt
node_yagpt -.->|"uses summary service"| node_yandex
node_yagpt -.->|"supports"| node_summaryapi
node_yagpt -.->|"supports"| node_summaryhtml
node_yagpt -.->|"supports"| node_summaryurl
node_yagpt -.->|"supports"| node_summaryurlapi
node_updatecase -.->|"stores articles"| node_articlesrepo
node_updatecase -.->|"stores feeds"| node_feedsrepo
node_delivery -.->|"returns feed data"| node_entities

click node_app "https://github.com/pltnk/habr-observer/blob/main/frontend/src/App.tsx"
click node_feedhook "https://github.com/pltnk/habr-observer/blob/main/frontend/src/hooks/useFeeds.ts"
click node_feedapi "https://github.com/pltnk/habr-observer/blob/main/frontend/src/api/feeds.ts"
click node_tabs "https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/FeedTabs.tsx"
click node_articlecard "https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/ArticleEntry.tsx"
click node_theses "https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/SummaryTheses.tsx"
click node_preferences "https://github.com/pltnk/habr-observer/blob/main/frontend/src/hooks/useCollapsePreference.ts"
click node_theme "https://github.com/pltnk/habr-observer/blob/main/frontend/src/hooks/useThemePreference.ts"
click node_selector "https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/SummaryViewSelector.tsx"
click node_themecontrol "https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/ThemeSelector.tsx"
click node_navigation "https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/BackToTop.tsx"
click node_header "https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/Header.tsx"
click node_footer "https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/Footer.tsx"
click node_server "https://github.com/pltnk/habr-observer/blob/main/backend/cmd/server/main.go"
click node_delivery "https://github.com/pltnk/habr-observer/blob/main/backend/internal/delivery/get_feeds.go"
click node_getfeeds "https://github.com/pltnk/habr-observer/blob/main/backend/internal/application/usecases/get_feeds.go"
click node_entities "https://github.com/pltnk/habr-observer/blob/main/backend/internal/domain/entities.go"
click node_updatercmd "https://github.com/pltnk/habr-observer/blob/main/backend/cmd/updater/main.go"
click node_runner "https://github.com/pltnk/habr-observer/blob/main/backend/internal/application/services/updater/runner.go"
click node_updatecase "https://github.com/pltnk/habr-observer/blob/main/backend/internal/application/usecases/update_feed.go"
click node_updatersvc "https://github.com/pltnk/habr-observer/blob/main/backend/internal/application/services/updater/updater.go"
click node_habr "https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/habr/client.go"
click node_habrparse "https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/habr/parse.go"
click node_habrrss "https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/habr/rss.go"
click node_yagpt "https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/client.go"
click node_summaryapi "https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/summary_api.go"
click node_summaryhtml "https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/summary_html.go"
click node_summaryurl "https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/summary_url.go"
click node_summaryurlapi "https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/summary_url_api.go"
click node_articlesrepo "https://github.com/pltnk/habr-observer/blob/main/backend/internal/repository/articles.go"
click node_feedsrepo "https://github.com/pltnk/habr-observer/blob/main/backend/internal/repository/feeds.go"

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_feedhook,node_feedapi,node_tabs,node_articlecard,node_theses,node_preferences,node_theme,node_selector,node_themecontrol,node_navigation,node_header,node_footer toneBlue
class node_server,node_delivery,node_getfeeds,node_entities toneAmber
class node_updatercmd,node_runner,node_updatecase,node_updatersvc toneMint
class node_habr,node_habrparse,node_habrrss,node_yagpt,node_summaryapi,node_summaryhtml,node_summaryurl,node_summaryurlapi toneRose
class node_articlesrepo,node_feedsrepo,node_visitor,node_habrsite,node_yandex toneIndigo
```

## Components

### Feed viewer

- [App shell](https://github.com/pltnk/habr-observer/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Feed state](https://github.com/pltnk/habr-observer/blob/main/frontend/src/hooks/useFeeds.ts): `frontend/src/hooks/useFeeds.ts`
- [Feed client](https://github.com/pltnk/habr-observer/blob/main/frontend/src/api/feeds.ts): `frontend/src/api/feeds.ts`
- [Feed tabs](https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/FeedTabs.tsx): `frontend/src/components/FeedTabs.tsx`
- [Article cards](https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/ArticleEntry.tsx): `frontend/src/components/ArticleEntry.tsx`
- [Summary theses](https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/SummaryTheses.tsx): `frontend/src/components/SummaryTheses.tsx`
- [View preferences](https://github.com/pltnk/habr-observer/blob/main/frontend/src/hooks/useCollapsePreference.ts): `frontend/src/hooks/useCollapsePreference.ts`
- [Theme preference](https://github.com/pltnk/habr-observer/blob/main/frontend/src/hooks/useThemePreference.ts): `frontend/src/hooks/useThemePreference.ts`
- [Summary selector](https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/SummaryViewSelector.tsx): `frontend/src/components/SummaryViewSelector.tsx`
- [Theme selector](https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/ThemeSelector.tsx): `frontend/src/components/ThemeSelector.tsx`
- [Page controls](https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/BackToTop.tsx): `frontend/src/components/BackToTop.tsx`
- [Header](https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/Header.tsx): `frontend/src/components/Header.tsx`
- [Credits footer](https://github.com/pltnk/habr-observer/blob/main/frontend/src/components/Footer.tsx): `frontend/src/components/Footer.tsx`

### Feed API

- [HTTP server](https://github.com/pltnk/habr-observer/blob/main/backend/cmd/server/main.go): `backend/cmd/server/main.go`
- [Feeds endpoint](https://github.com/pltnk/habr-observer/blob/main/backend/internal/delivery/get_feeds.go): `backend/internal/delivery/get_feeds.go`
- [Get feeds](https://github.com/pltnk/habr-observer/blob/main/backend/internal/application/usecases/get_feeds.go): `backend/internal/application/usecases/get_feeds.go`
- [Feed entities](https://github.com/pltnk/habr-observer/blob/main/backend/internal/domain/entities.go): `backend/internal/domain/entities.go`

### Feed refresh

- [Updater process](https://github.com/pltnk/habr-observer/blob/main/backend/cmd/updater/main.go): `backend/cmd/updater/main.go`
- [Refresh runner](https://github.com/pltnk/habr-observer/blob/main/backend/internal/application/services/updater/runner.go): `backend/internal/application/services/updater/runner.go`
- [Update feed](https://github.com/pltnk/habr-observer/blob/main/backend/internal/application/usecases/update_feed.go): `backend/internal/application/usecases/update_feed.go`
- [Updater service](https://github.com/pltnk/habr-observer/blob/main/backend/internal/application/services/updater/updater.go): `backend/internal/application/services/updater/updater.go`

### External services

- [Habr RSS client](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/habr/client.go): `backend/internal/infrastructure/habr/client.go`
- [Article parsing](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/habr/parse.go): `backend/internal/infrastructure/habr/parse.go`
- [RSS handling](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/habr/rss.go): `backend/internal/infrastructure/habr/rss.go`
- [YandexGPT client](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/client.go): `backend/internal/infrastructure/yagpt/client.go`
- [Summary API](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/summary_api.go): `backend/internal/infrastructure/yagpt/summary_api.go`
- [Summary HTML](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/summary_html.go): `backend/internal/infrastructure/yagpt/summary_html.go`
- [Summary URL](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/summary_url.go): `backend/internal/infrastructure/yagpt/summary_url.go`
- [Summary URL API](https://github.com/pltnk/habr-observer/blob/main/backend/internal/infrastructure/yagpt/summary_url_api.go): `backend/internal/infrastructure/yagpt/summary_url_api.go`

### Persistence

- [Article repository](https://github.com/pltnk/habr-observer/blob/main/backend/internal/repository/articles.go): `backend/internal/repository/articles.go`
- [Feed repository](https://github.com/pltnk/habr-observer/blob/main/backend/internal/repository/feeds.go): `backend/internal/repository/feeds.go`

### Other components

- **Visitor**
- **Habr**
- **300.ya.ru**

## Connections

- Visitor → App shell: opens
- App shell → Feed state: loads state (evidence: `frontend/src/App.tsx`)
- Feed state → Feed client: fetches feeds (evidence: `frontend/src/hooks/useFeeds.ts`)
- Feed client → HTTP server: GET /feeds (evidence: `frontend/src/api/feeds.ts`)
- App shell → Feed tabs: renders (evidence: `frontend/src/App.tsx`)
- Feed tabs → Article cards: renders cards (evidence: `frontend/src/components/FeedTabs.tsx`)
- Article cards → Summary theses: renders summary (evidence: `frontend/src/components/ArticleEntry.tsx`)
- App shell → View preferences: reads preference (evidence: `frontend/src/App.tsx`)
- App shell → Theme preference: reads preference (evidence: `frontend/src/App.tsx`)
- App shell → Summary selector: renders (evidence: `frontend/src/App.tsx`)
- App shell → Theme selector: renders (evidence: `frontend/src/App.tsx`)
- Theme selector → Theme preference: updates (evidence: `frontend/src/components/ThemeSelector.tsx`)
- App shell → Header: renders (evidence: `frontend/src/App.tsx`)
- App shell → Credits footer: renders (evidence: `frontend/src/App.tsx`)
- App shell → Page controls: renders (evidence: `frontend/src/App.tsx`)
- HTTP server → Feeds endpoint: serves
- Feeds endpoint → Get feeds: handles request
- Get feeds → Feed repository: reads feeds
- Updater process → Refresh runner: starts
- Refresh runner → Update feed: runs updates
- Update feed → Updater service: delegates
- Updater service → Habr RSS client: gets articles
- Habr RSS client → Habr: fetches RSS
- Habr RSS client → Article parsing: parses articles
- Habr RSS client → RSS handling: reads feed
- Updater service → YandexGPT client: requests summaries
- YandexGPT client → 300.ya.ru: uses summary service
- YandexGPT client → Summary API: supports
- YandexGPT client → Summary HTML: supports
- YandexGPT client → Summary URL: supports
- YandexGPT client → Summary URL API: supports
- Update feed → Article repository: stores articles
- Update feed → Feed repository: stores feeds
- Feeds endpoint → Feed entities: returns feed data
