/news-aggregator

Trending News aggregator using Google Trends

Primary LanguageJavaScript

Trending News Aggregator Project

Set up development environment

  • Activate _development/docker-compose.yml file when you want to work on your local machine:
$ docker-compose up -d --build 
  • Create new venv and install all the requirements from the requirements.txt file:
$ python3 -m venv venv 
$ source venv/bin/activate 
$ pip3 install -r requirements.txt
  • Enter app folder and apply migrations:
$ python3 manage.py makemigrations 
$ python3 manage.py migrate 
  • Finally start up the server:
$ python3 manage.py runserver 

Project Structure

  • Project have one main mini-app(django app) - core

Usecases

  • Every business logic lives under the usecases folders.
  • You can simply understand the purpose of the specific usecase by looking its name or description in the class.
  • Usecases implemented using profit404/stories ("https://github.com/proofit404/stories") library.

Repositories

  • Every db related actions are stored in the repository.
  • Do not use querysets and db related actions outside of the repository.

Celery

  • For running tasks in background, Celery is used.
  • Celery is used to create and update news in every 1 min.
  • For running task in development, run this command inside the app folder:
$ celery --app=app.celery:app worker -B --loglevel=DEBUG