Boot.dev Guided Project- Blog AggreGator
Gator is a command-line RSS feed aggregator written in Go. It continuously fetches posts from configured feeds, stores them in Postgres, and lets you browse and manage feeds from the terminal.
To run gator, you must have the following installed:
- Go (1.21 or newer recommended)
- PostgreSQL (14 or newer recommended)
Make sure both go and psql are available in your PATH.
Install the gator CLI using go install:
go install github.com/ppllama/gator@latestAfter installation, ensure $GOPATH/bin (or $HOME/go/bin) is in your PATH:
export PATH="$PATH:$HOME/go/bin"You should now be able to run:
gatorCreate a Postgres database for gator:
CREATE DATABASE gator;Gator uses a config file located at:
~/.gatorconfig.json
Example config:
{
"db_url": "postgres://user:password@localhost:5432/gator?sslmode=disable",
"current_user": "alice"
}db_url– Postgres connection stringcurrent_user– the active gator user
gator register alicegator addfeed "Hacker News" https://news.ycombinator.com/rssgator follow https://news.ycombinator.com/rssgator agg 1hgator browse 10- register
- login
- users
- addfeed
- feeds
- follow
- unfollow
- following
- agg
- browse
- reset (dangerous- resets the database)