Skip to content

A microservice called Gator that allows you to keep up with your favorite blogs, news sites, podcasts, and more.

Notifications You must be signed in to change notification settings

jesselam00/blog-aggregator

Repository files navigation

🐊 Blog Aggregator

Blog Aggregator is a microservice CLI RSS feed aggregator written in Go! We'll call the CLI tool gator because it is an aggreGATOR 🐊. This app allows you to:

  • Add RSS feeds from across the internet.
  • Store collected posts in a PostgreSQL database.
  • Follow and unfollow RSS feeds from other users.
  • View summaries of aggregated posts in the terminal, with links to full posts.

RSS feeds are a convenient way to keep up with blogs, news sites, podcasts, and more.


Prerequisites

To run this project, you need:


Installing the CLI

You can install the CLI using:

go install github.com/yourusername/blog-aggregator@latest

This will install a blog-aggregator executable you can use in your terminal.


Configuration

gator uses a JSON config file located at ~/.gatorconfig.json:

{
  "db_url": "postgres://user:password@localhost:5432/blog_aggregator",
  "current_user_name": "your_username"
}
  • db_url: Connection string to your PostgreSQL database.
  • current_user_name: Automatically set by the application after using the register.

Running the CLI

For development, you can run:

go run .

For production usage, use the installed blog-aggregator binary:

blog-aggregator <command> [args]

Commands

The Blog Aggregator CLI supports the following commands:

Command Description Usage Login Required
register Create a new user register <name> No
login Switch to an existing user login <name> No
reset Reset the database by deleting all users reset No
users List all users and highlight the current one users No
agg Collect feeds periodically agg <time_between_requests> Yes
addfeed Add a new RSS feed addfeed <feed_url> Yes
feeds List all available feeds feeds No
follow Follow an existing feed follow <feed_url> Yes
following List all feeds the current user follows following Yes
browse Browse posts for the current user (optional limit) browse [limit] Yes

Database Setup

PostgreSQL is used to store users, feeds, and posts.

macOS (Homebrew)

brew install postgresql@15
brew services start postgresql@15
psql postgres

Linux / WSL (Debian)

sudo apt update
sudo apt install postgresql postgresql-contrib
sudo service postgresql start
sudo -u postgres psql

Create Database

CREATE DATABASE gator;
\c gator
ALTER USER postgres PASSWORD 'postgres';

About

A microservice called Gator that allows you to keep up with your favorite blogs, news sites, podcasts, and more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages