GATOR - blog aggregator implementation in typescript
Prerequisites:
- linux/WSL
- install Node.js v22.15.0 or newer
- npm package manager
- PostgreSQL database server
To install:
- Clone the repo:
git clone <repository-url> cd <project-directory> - Install using npm:
npm install - Create a new file named
.gatorconfig.jsonin your user's home folder and add this text to it:{"db_url":"[your_postgres_database_url_here]"}. if you're running locally without a database - you can put a default connection string with your own username and password:postgresql://username:password@localhost:5432/database_name. - Migrate your database:
npm run db:migrate
To run:
npm run start <command> <args>
Commands:
- agg: [interval] - aggregates posts from feeds for the user every X milliseconds.
- register[username] - registers a new user
- login[username] - logs in
- reset - deletes all users, feeds, posts etc
- users - lists all users
- addfeed[url] - adds feed to database and follows it for the current user.
- feeds - lists all feeds
- follow[url] - follows a feed for the current user.
- following - lists all followed feeds for the current logged in user.
- unfollow[url] - unfollows a feed for the current user.