Skip to content

ivanfernandez2646/daily-trends

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

"daily-trends" repository is a web application (backend) created with the aim of centralizing news from the most representative newspapers in the country. It follows a solid architecture based on Domain-Driven Design (DDD) principles with the goal of being scalable efficiently and quickly.

Demo BACKEND --> Wait 10 seconds until RENDER service is up

FRONT FRONT --> Check it now and you will see lastest news (Now, is needed to wait a little because the scraping process is fired on the fly if any of the news is older than the current day. In a future, it will be fired with an Scheduler but it costs more money in the Cloud Provider)

Tools

  • drawing Node.js (Typescript)

  • drawing Express

  • drawing MongoDB

  • drawing Docker

  • drawing Jest

Hexagonal architecture diagram

Requirements

Node.js --> min v18.16.0 (nvm use)
docker-compose --> to create DDBB instance (test and dev)

Installation

$ npm install

Running the app

# Makefile option
$ make start

# Or
$ npm run up:docker:local # to up Docker with Mongo (docker-compose necessary)
$ npm run dev

Test

# Makefile option
$ make test # Run all tests

# Or
$ npm run up:docker:local # follow we can use whatever of the below commands

    # all tests
    $ npm run test

    # unit tests
    $ npm run test:unit

    # features e2e (cucumber)
    $ npm run test:features

    # integration (infrastructure)
    $ npm run test:integration

TODO Improves

  1. Implement CQRS (commandBus and queryBus). Commands and Queries will be a handler and middleware between external app (Express.js API) and bounded context. It also allow communication between use cases
  2. Implement pagination with cursors in MongoDB infrastructure
  3. Hide GET feed/scrap endpoint and create CRON task for use it
  4. ...

About

Your news centralized!! :) TDD, Hexagonal Arch 😎

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published