This is an API that works on top of HackerNews and allows user to maintain custom collections of stories. Offers basic fulltext search functionality via ElasticSearch. API is secured via JWT tokens.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Install [Node.js version 14 or greater] (https://nodejs.org/en/download/)
- Install Docker and docker-compose
- Clone this repository:
git clone https://github.com/Dratinox/hacker-news-stories.git
- Run the sample:
docker-compose up -d
- Test the application:
npm install
npm run test
Every route here is under /api
Store token from registering / logging in as "x-auth-token" header
- Create a user
POST /user
@param username: string
@param password: string
@return token: string
- Login user
POST /auth
@param username: string
@param password: string
@return token: string
- Add story to collection (creates a collection if it doesn't exist)
POST /collection
@param id: number (story ID)
@param name: string
- Retrive collections / collection
GET /collection[/:id]
- Update collection
PUT /collection/:id
- Delete collection
DELETE /collection/:id
- Fulltext search through collections
POST /search
@param term: string
@param (optional) collectionId: number