How pltnk/habr-observer works
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: App.tsx App shell · yagpt/client.go YandexGPT client · update_feed.go Update feed · habr/client.go Habr RSS client
Components 34
Feed viewer
- App shell
frontend/src/App.tsx - Feed state
frontend/src/hooks/useFeeds.ts - Feed client
frontend/src/api/feeds.ts - Feed tabs
frontend/src/components/FeedTabs.tsx - Article cards
frontend/src/components/ArticleEntry.tsx - Summary theses
frontend/src/components/SummaryTheses.tsx - View preferences
frontend/src/hooks/useCollapsePreference.ts - Theme preference
frontend/src/hooks/useThemePreference.ts - Summary selector
frontend/src/components/SummaryViewSelector.tsx - Theme selector
frontend/src/components/ThemeSelector.tsx - Page controls
frontend/src/components/BackToTop.tsx - Header
frontend/src/components/Header.tsx - Credits footer
frontend/src/components/Footer.tsx
Feed API
- HTTP server
backend/cmd/server/main.go - Feeds endpoint
backend/internal/delivery/get_feeds.go - Get feeds
backend/internal/application/usecases/get_feeds.go - Feed entities
backend/internal/domain/entities.go
Feed refresh
- Updater process
backend/cmd/updater/main.go - Refresh runner
backend/internal/application/services/updater/runner.go - Update feed
backend/internal/application/usecases/update_feed.go - Updater service
backend/internal/application/services/updater/updater.go
External services
- Habr RSS client
backend/internal/infrastructure/habr/client.go - Article parsing
backend/internal/infrastructure/habr/parse.go - RSS handling
backend/internal/infrastructure/habr/rss.go - YandexGPT client
backend/internal/infrastructure/yagpt/client.go - Summary API
backend/internal/infrastructure/yagpt/summary_api.go - Summary HTML
backend/internal/infrastructure/yagpt/summary_html.go - Summary URL
backend/internal/infrastructure/yagpt/summary_url.go - Summary URL API
backend/internal/infrastructure/yagpt/summary_url_api.go
Persistence
- Article repository
backend/internal/repository/articles.go - Feed repository
backend/internal/repository/feeds.go
Other components
- Visitor
- Habr
- 300.ya.ru
Connections 34
- Visitor → App shell: opens
- App shell → Feed state: loads state
frontend/src/App.tsx - Feed state → Feed client: fetches feeds
frontend/src/hooks/useFeeds.ts - Feed client → HTTP server: GET /feeds
frontend/src/api/feeds.ts - App shell → Feed tabs: renders
frontend/src/App.tsx - Feed tabs → Article cards: renders cards
frontend/src/components/FeedTabs.tsx - Article cards → Summary theses: renders summary
frontend/src/components/ArticleEntry.tsx - App shell → View preferences: reads preference
frontend/src/App.tsx - App shell → Theme preference: reads preference
frontend/src/App.tsx - App shell → Summary selector: renders
frontend/src/App.tsx - App shell → Theme selector: renders
frontend/src/App.tsx - Theme selector → Theme preference: updates
frontend/src/components/ThemeSelector.tsx - App shell → Header: renders
frontend/src/App.tsx - App shell → Credits footer: renders
frontend/src/App.tsx - App shell → Page controls: renders
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