Gator is a CLI RSS/blog aggregator that stores feeds and posts in PostgreSQL.
This project was completed as part of the Boot.dev backend curriculum. While the core architecture followed a guided specification, I personally implemented the database migrations and the concurrent scraping logic.
- TypeScript
- Node.js
- PostgreSQL
- Drizzle ORM
To get a local copy up and running follow these steps.
- npm
npm install npm@latest -g
- Postgres
- macOS with brew
brew install postgresql@16
- Linux / WSL (Debian). Docs for WSL:
Confirm installation worked:sudo apt update sudo apt install postgresql postgresql-contrib
(Linux only) Update postgres password:psql --version
sudo passwd postgres
- Clone the repo
git clone https://github.com/useradamlee/Gator.git
- Install NPM packages
npm install
- Get connection string to postgres database. Format:
Examples:
protocol://username:password@host:port/database- macOS (no password, your username):
postgres://adamlee:@localhost:5432/gator - Linux (password from last lesson, postgres user):
postgres://postgres:postgres@localhost:5432/gator
- macOS (no password, your username):
- Enter the psql shell:
- Mac:
psql postgres - Linux:
sudo -u postgres psql
- Create the database:
CREATE DATABASE gator;
- Connect to the database:
\c gator - Set the user password (Linux only):
ALTER USER postgres PASSWORD 'postgres';
postgreswas used as the password for simplicity - You can type
exitor use\qto leave thepsqlshell. - Create a config file in your home directory
~/.gatorconfig.jsonAdd an additionalsslmode=disablequery string:{ "db_url": "protocol://username:password@host:port/database?sslmode=disable" }
Run the CLI with:
npm run startRegister a user:
npm run start register adamAdd a feed:
npm run start addfeed "Boot.dev Blog" https://blog.boot.dev/index.xmlFollow a feed:
npm run start follow https://blog.boot.dev/index.xmlBrowse posts:
npm run start browselogin <username>- log in as an existing userusers- list all usersagg <time_between_reqs>- scrape feeds every given intervalfollowing- list all the feeds the user is currently followingregister <username>- create a new userlogin <username>- log in as a useraddfeed <name> <url>- add a new feedfollow <url>- follow a feedunfollow <url>- unfollow a feedbrowse [limit]- browse recent posts, optionally limiting the number shown