Gator is a command-line RSS feed aggregator built in Go. It allows users to manage RSS feeds, follow feeds, and browse posts from their subscribed feeds.
Before running Gator, you need to have the following installed:
- Go (version 1.24.5 or later) - Install Go
- PostgreSQL - Install PostgreSQL
Install the Gator CLI using Go:
go install github.com/hellyeahomg/gator@latestBefore using Gator, you need to set up a configuration file with your database connection details.
Create a JSON configuration file (typically ~/.gatorconfig.json) with the following structure:
{
"db_url": "postgres://username:password@localhost/gator_db?sslmode=disable",
"current_user_name": ""
}Replace username, password, and gator_db with your PostgreSQL credentials and database name.
- Create a PostgreSQL database for Gator
- Run the SQL schema files in the
sql/schema/directory to set up the required tables
Once installed and configured, you can use the following commands:
gator register <username>- Create a new user accountgator login <username>- Log in as an existing usergator users- List all registered usersgator reset- Reset/clear user data
gator addfeed <feed_name> <feed_url>- Add a new RSS feedgator feeds- List all available feedsgator follow <feed_name>- Follow an RSS feedgator following- Show feeds you're followinggator unfollow <feed_name>- Unfollow a feed
gator agg- Aggregate/fetch new posts from followed feedsgator browse [limit]- Browse recent posts from your followed feeds
# Register a new user
gator register john
# Add some feeds
gator addfeed techcrunch https://feeds.feedburner.com/TechCrunch
gator addfeed hackernews https://hnrss.org/frontpage
# Follow feeds
gator follow techcrunch
gator follow hackernews
# Fetch new posts
gator agg
# Browse recent posts
gator browse 10This project uses:
- PostgreSQL for data storage
- SQLC for type-safe SQL queries
- UUID for unique identifiers
The project structure includes:
internal/handlers/- Command handlersinternal/commands/- Command systeminternal/config/- Configuration managementinternal/database/- Database operationssql/- SQL schemas and queries