How ramzygirgis/feed-aggregator works
This is a Go CLI for managing users, RSS feeds and subscriptions, polling feeds into PostgreSQL, and browsing collected posts. The primary workflow is: a user adds/follows feeds, the agg command selects feeds due for polling, fetches and parses RSS items, stores URL-deduplicated posts, and browse retrieves posts for followed feeds. The graph reflects the documented command capabilities; source excerpts establish the main dispatch, polling, parsing and query paths, while some generated query implementations were not sampled.
Main entry points: commands.go Command handlers · db.go Typed query layer · main.go Startup and dispatch · middleware.go Login middleware
Components 15
CLI and commands
- Startup and dispatch
main.go - Command handlers
commands.go
Feed collection
- RSS fetch and parse
rss_feed.go
Persistence
- Typed query layer
internal/database/db.go - User queries
internal/database/users.sql.go - Feed and follow queries
internal/database/feeds.sql.go - Follow queries
internal/database/feed_follows.sql.go - Post queries
internal/database/posts.sql.go - Relational schema
sql/schema
User context
- Login middleware
middleware.go - Config reader/writer
internal/config/configuration.go - JSON config file
Other components
- CLI user
- RSS feed servers
- PostgreSQL
Connections 21
- CLI user → Startup and dispatch: runs command
- Startup and dispatch → Config reader/writer: loads config
- Startup and dispatch → Typed query layer: opens database
- Startup and dispatch → Command handlers: dispatches
- Config reader/writer → JSON config file: reads/writes
- Command handlers → Config reader/writer: sets active user
- Command handlers → Login middleware: registers protected handlers
- Login middleware → User queries: looks up current user
- Login middleware → Command handlers: delegates authenticated
- Command handlers → User queries: manages users
- Command handlers → Feed and follow queries: selects and updates feeds
- Command handlers → Follow queries: manages subscriptions
- Command handlers → Post queries: stores and browses posts
- Command handlers → RSS fetch and parse: fetches selected feed
- RSS fetch and parse → RSS feed servers: requests RSS
- Typed query layer → PostgreSQL: executes queries
- User queries → Typed query layer: uses
- Feed and follow queries → Typed query layer: uses
- Follow queries → Typed query layer: uses
- Post queries → Typed query layer: uses
- Relational schema → PostgreSQL: defines tables