Gator is a CLI RSS feed aggregator built with TypeScript, Node.js, PostgreSQL, and Drizzle ORM.
It lets you:
- register/login users
- add RSS feeds
- follow/unfollow feeds
- run an aggregator loop to fetch posts
- browse recent posts from feeds you follow
Before running Gator, make sure you have:
- Node.js (Node 18+ recommended, Node 20/22 works great)
- npm
- PostgreSQL running locally
- psql (Postgres CLI client)
Clone the repo and install dependencies:
git clone https://github.com/YOUR-USERNAME/gator.git
cd gator
npm install- Start PostgreSQL.
- Create a database named
gator:
CREATE DATABASE gator;- Make sure you can connect with
psql.
Example connection string (works if you use the default postgres role with no password locally):
psql "postgres://postgres:@localhost:5432/gator"If your Postgres user/password is different, adjust the connection string accordingly.
If you're on Arch Linux, install and start PostgreSQL first:
sudo pacman -S postgresql
sudo -iu postgres initdb --locale=C.UTF-8 -D /var/lib/postgres/data
sudo systemctl enable --now postgresqlThen enter psql as the postgres user:
sudo -u postgres psqlCreate this file in your home directory:
~/.gatorconfig.json
Example:
{
"db_url": "postgres://postgres:@localhost:5432/gator?sslmode=disable"
}Notes:
db_urlis requiredcurrent_user_namewill be added automatically by the CLI afterlogin/register
Generate and run migrations:
npx drizzle-kit generate
npx drizzle-kit migrateIf you added scripts in package.json, you can also use:
npm run generate
npm run migrateUse:
npm run start -- <command> [args...]Example:
npm run start -- register simonnpm run start -- register <username>Creates a new user and sets them as the current user.
npm run start -- login <username>Sets the current user in the config file (user must already exist).
npm run start -- usersShows all users and marks the current user.
npm run start -- resetDeletes all users (and cascades into feeds, follows, and posts).
npm run start -- addfeed "<feed name>" "<feed url>"Creates a feed and automatically follows it for the current user.
Example:
npm run start -- addfeed "Boot.dev Blog" "https://blog.boot.dev/index.xml"npm run start -- feedsShows all feeds in the database, including the user who added them.
npm run start -- follow "<feed url>"Follows an existing feed by URL.
npm run start -- unfollow "<feed url>"Unfollows a feed for the current user.
npm run start -- followingLists all feeds followed by the current user.
npm run start -- agg <duration>Runs a continuous loop that fetches posts from feeds and stores them in the database.
Duration examples:
500ms5s1m1h
Example:
npm run start -- agg 30sPress Ctrl+C to stop the aggregator gracefully.
npm run start -- browseShows the latest posts from feeds the current user follows.
Default limit is 2 posts.
npm run start -- browse 10Shows the latest 10 posts.
npm run start -- register simon
npm run start -- addfeed "Boot.dev Blog" "https://blog.boot.dev/index.xml"
npm run start -- addfeed "Hacker News" "https://news.ycombinator.com/rss"
npm run start -- agg 10s
# let it run for a bit, then press Ctrl+C
npm run start -- browse 10- TypeScript
- Node.js
- PostgreSQL
- Drizzle ORM
- drizzle-kit
- fast-xml-parser
- Feed URLs are unique in the database.
- Post URLs are unique, so duplicate posts are ignored safely.
- Deleting users cascades and removes related feeds, follows, and posts.
- Run the aggregator with a reasonable interval to avoid hammering third-party servers.
This project was built as part of the Boot.dev guided project curriculum.