Skip to content

Checks for new feed entries periodically, accumulates new entries and sends the notifications. Python/Django/React.js

Notifications You must be signed in to change notification settings

AlexanderKaluzhny/instanotifier

Repository files navigation

InstaNotifier

Checks the RSS feed periodically, accumulates new entries and sends the notifications. The UI for listing of saved entries is implemented in React.js. Also allows rating, bookmarking, filtering, searching. (UI demo is deployed to Heroku free dyno instanotifier-react.herokuapp.com)

Built with Cookiecutter Django
  • Python: 3.7
  • Django: 2.2
  • React.js
  • Celery
  • ElasticSearch
  • PostgreSQL

Introductory Documentation

Goal

Periodically check for updates on some source (RSS, API, etc.), store new entries into db, and send notifications about the new ones (email, FB Messenger, push, Slack, etc.).

Components

FetcherParserModelPublisher

Fetcher(source from where to fetch)FeedSource settings → (target where to send notification)Publisher

Fetcher:Gets data from the particular source (RSS, API)
Parser:Serialize the data fetched from the particular source into some model instance
Filter:Having the set of new data entries, filters out the existing ones
Model:Saves the data into the db
Publisher:Sends out the data into the particular channel (email, fb messenger, etc.)
FeedSource Settings:The settings application for wiring up the source to fetch from to the target to publish notifications to
API:REST API providing access to stored data
UI:Displays the stored entries, supports filtering and searching

Implemented functionality

  • Modular architecture
  • RssFetcher → RssParser → RssNotification model → Email publisher
  • FeedSource settings application
  • Celery tasks with the hardcoded schedule to run the fetching
  • Integration with Mailgun (out of box from the cookiecutter project template)
  • REST API for listing, rating, searching, filtering of stored entries
  • UI for listing of saved RssNotifications (rss feed entries). Allows rating of items, searching, filtering by date
  • The demo of UI is deployed to Heroku instanotifier-react.herokuapp.com (It is a free dyno, so wait a little for it to wake up). [NOTE: That deployed instance doesn't fetch any data from the sources, because the Celery is not deployed there. It only shows the already preloaded data.]

Basic Commands

Building the front-end

To build the dev environment:

cd front-end
npm start

To build the production environment:

cd front-end
npm run build

Celery

To run celery:

cd instanotifier
celery -A instanotifier.taskapp worker -B -l info
Running tests
$ ./manage.py test

Email Server

In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server MailHog with a web interface is available as docker container.

Container mailhog will start automatically when you will run all docker containers. Please check cookiecutter-django Docker documentation for more details how to start all containers.

With MailHog running, to view messages that are sent by your application, open your browser and go to http://127.0.0.1:8025

Local Dev Setup

Starting up with tmuxinator locally

Using the tmuxinator-inr.yml script provided, follow the TODOs in the script to set it up for your environment.