Skip to content

kryptonn36/Blog_aggreator

Repository files navigation

Blog_aggreator

Gator is a simple CLI that aggregates RSS feeds into a Postgres database and lets you browse posts from the terminal.

Requirements

  • Go (1.20+ recommended)
  • PostgreSQL (14+ recommended)

Quick checks:

go version
psql --version

Downloads:

Make sure PostgreSQL is running and you have a database created for the app.

Installation

Install the CLI with go install:

go install github.com/kryptonn36/Blog_aggreator@latest

Ensure $GOPATH/bin is in your PATH:

export PATH="$PATH:$(go env GOPATH)/bin"

Verify:

gator

Configuration

Gator reads config from a local JSON file that includes the database connection and the current user.

Create a file at:

~/.gatorconfig.json

Example:

{
  "db_url": "postgres://postgres:postgres@localhost:5432/gator?sslmode=disable",
  "current_user_name": ""
}

Do not commit this file; add it to your global gitignore to keep credentials private.

Database Setup

Gator uses Goose for database migrations.

Install Goose:

go install github.com/pressly/goose/v3/cmd/goose@latest

Verify:

goose -version

Run migrations:

make migrate-up

Rollback migrations:

make migrate-down

Usage

Register a user:

gator register <username>

Login:

gator login <username>

Add a feed:

gator addfeed <feed_url>

Follow a feed:

gator follow <feed_url>

Start the aggregator (fetch feeds on an interval):

gator agg 5s

Browse posts:

gator browse

Limit results:

gator browse 5

Development

Clone the repo and install dependencies (Go modules are handled automatically):

git clone https://github.com/kryptonn36/Blog_aggreator.git
cd Blog_aggreator

Run the CLI directly from source:

go run . <command>

Build a local binary:

go build -o gator
./gator <command>

Run tests:

go test ./...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors