A Real Time notification system task for SocialCops
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
static
templates
LICENSE
Procfile
README.md
config.py
forms.py
models.py
requirements.txt
server.py

README.md

Gossip Girl

A Real Time notification system task for SocialCops

Problem Task: Create a real time notification system to notify subscribers about the changes in the MongoDB database.

Link to complete task.

Solution:

Due to lack of knowledge about Gossip Girl and their characters, I have updated the task to notify us about the updates of various TV shows instead of characters of Gossip Girl.

Tech Stack: Web app = Flask + Heroku + SocketIO + MongoDB/MongoLab

Steps to run app:

  • Clone the repo and cd into it

  • Setup virtualenv: virtualenv venv

  • Activate virtualenv: source venv/bin/activate

  • Install required libraries: pip install -r requirements.txt

  • Run the MongoDB server: mongod

  • Run the flask server: python server.py

Screenshots and how to use it:

login

  • First Register and Login: username: akul password: 1234

index

  • Then Goto /Rooms and subscribe to your favourite TV Shows rooms

  • Goto /Notification for real time subscribed Notifications, notifications of not subscribed TV shows are not shown here. notifs

  • Goto /All Notifs for real time Notifications for all TV shows all notifs

  • Open /Update DB in new tab and send an update for a TV show to MongoDB. This is inserted in the MongoDB db and a notification is sent to /Notifications if subscribed and /All Notifs in real time via SocketIO. updatedb

  • Notification about update on Flash TV show is sent to both /Notifications and /All Notifs. notifs & all notifs

  • Again sending Notification about Game of Thrones which is not subscribed by akul updatedb again

  • On Sending notification about Game of Thrones, only /All Notifs will receive as akul is not following Game of Thrones and hence no notification in /Notifications notifs & all notifs again

  • Logout and Exit the program

Resources: