GithubHelp home page GithubHelp logo

daily-trends-api's Introduction

news-feed-api

API build with Node-TS following, DDD Hexagonal Architecture and OOP best practices.

Project architecture

About the project

The api allows the user to create news and store the main 5 feed news from different Spanish newspapers (Elmundo & ElPais) for now.

To get the news it's used puppeter at the moment as axios was having some enconding problems and cheerio for handling the request and parsing the data.

The architecture allows to easilly increase the number of newspapers to be scrapper using a ScrapperFactory.

Features

Working with this project

The following are the instructions to set up the API project locally. To get a local copy up and running follow these simple example steps.

  • Run the app: yarn dev
  • Install the dependencies: yarn install
  • Execute unit tests: yarn test:unit
  • Execture integration tests: yarn test:int
  • Check linter errors: npm run lint
  • Fix linter errors: npm run lint:fix

!IMPORTANT

You need to provide the database connection in order for the persistance layer to work, can either be a local or an atlasdb mongo instace.

Usage

API docs.

  • Feed model
{
  "id": "0766c602-d4d4-48b6-9d50-d3253123273e",
  "title": "Feed title",
  "description": "Feed description",
  "url": "https://example.com",
  "image": "https://example.com/image.png",
  "source": "ELMUNDO",
  "author": "",
  "location": "",
  "date": "2021/03/07"
}

Main routes

  • PUT /feed

     Create and udpate the feed
  • GET /feed/:id

     Gets feed by :id
  • DELETE /api/feed/:id

     DELETE feed by :id
  • GET /api/feed-scrapper?type="sourcetype"

     Get 5 feeds from the selected sourcetype and saves it into the database

Manual Testing

Postman colletion

daily-trends-api's People

Contributors

gagocarrilloedgar avatar

Watchers

 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.