Giter Club home page Giter Club logo

hacker-news-reign's Introduction

Nest Logo

Description

An implementation of a small subset of the capabilities of the Hacker News Algolia API. New Items are retrieved every hour from the main HN API.

Nest framework TypeScript starter repository.

Installation

Local

$ npm install

Docker container

# Bundled with a postgresql database
$ docker compose -f "docker-compose.yml" up --build

Running the app

# docker
$  docker compose -f "docker-compose.yml" up
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Postman

A Postman collection and enviroment are provided inside the postman forder for easy of use

Usage with Postman

All endpoints require a Bearer token to be used, to obtain a token:

  1. In postman set the api enviroment variable to the appropiate URL, by default it'll be localhost:3000 unless changed by the .env files
  2. Import the Collection and enviroment files from the postman folder into Postman
  3. Inside the collection run the login request, it will return a JWT auth token. The default body of the request must be:
// This user is seeded on to the DB by default
{
  "email": "[email protected]",
  "password": "password"
}
  1. Put the received token on the postman's jwt enviroment variable
  2. All the other endpoints are ready to be used

Notes

  • The API Docs are available at /api/docs
  • The .env files are included in the repository only to aid the ease of use, I undestand is a bad practice to do so.
  • One thing I'd have liked to do would be to implement the complex tags filtering from the Algolia API, I did not have enough time this weekend.
  • An Online version of this API is available at my personal site https://api.servinges.cl because I wanted to demostrate that I have some knowledge about web servers configuration (nginx), ec2, web hosting, certificates, etc.

License

Nest is MIT licensed.

hacker-news-reign's People

Contributors

denismirandaj avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.