Gator is a command-line RSS feed aggregator built in Go. It allows users to register accounts, subscribe to RSS feeds, and browse aggregated content from multiple sources.
- User registration and authentication
- RSS feed subscription management
- Automatic feed aggregation with configurable intervals
- Browse posts from followed feeds
- Multi-user support with individual feed subscriptions
- Go 1.23 or higher
- PostgreSQL server
- Goose (for database migrations)
git clone https://github.com/azs06/gator.git
cd gatorCreate a PostgreSQL database:
createdb gatorRun the migrations:
goose -dir sql/schema postgres "postgresql://username:password@localhost/gator?sslmode=disable" upCreate a .env file in the project root:
DB_URL=postgresql://username:password@localhost/gator?sslmode=disable
go build -o gator .# Register a new user
./gator register <username>
# Log in as an existing user
./gator login <username>
# List all users
./gator users
# Reset (delete all users)
./gator reset# Add a new RSS feed
./gator addfeed <name> <url>
# List all feeds
./gator feeds
# Follow a feed
./gator follow <feed_url>
# List feeds you're following
./gator following
# Unfollow a feed
./gator unfollow <feed_url># Start continuous feed aggregation (default: 1 minute interval)
./gator aggz
# Start aggregation with custom interval
./gator aggz 30s
./gator aggz 5m# Browse posts from followed feeds (default: 2 posts)
./gator browse
# Browse with custom limit
./gator browse 10gator/
├── main.go # Application entry point and command handlers
├── go.mod # Go module definition
├── sqlc.yaml # sqlc configuration
├── internal/
│ ├── config/
│ │ └── config.go # Configuration management
│ └── database/
│ ├── models.go # Generated database models
│ ├── db.go # Database query interface
│ ├── users.sql.go # User queries
│ ├── feeds.sql.go # Feed queries
│ ├── feeds_follow.sql.go
│ └── posts.sql.go # Post queries
└── sql/
├── schema/ # Database migrations
└── queries/ # SQL query definitions
Gator stores user configuration in ~/.gatorconfig.json:
{
"db_url": "postgresql://username:password@localhost/gator",
"current_user_name": "your_username"
}- users - User accounts
- feeds - RSS feed definitions
- feed_follows - User feed subscriptions
- posts - Aggregated feed content
- Go
- PostgreSQL
- sqlc - Type-safe SQL code generation
- lib/pq - PostgreSQL driver
- google/uuid - UUID generation
MIT