Skip to content

A dashboard for Real-time analysis of Covid-19 in India and a resource tracker eg. Oxygen, Ventilators, Remdesivir along with Live Vaccine Availablity Tracker.

Notifications You must be signed in to change notification settings

eeshsingh123/Covid19_Analysis

Repository files navigation

Covid19_Analysis

NOTE It is recommended that you view this website via a PC or Laptop as some features may not be visible properly on Mobile devices.

This App is not hosted yet, it can be used via this Ngrok link: ____ (this can be changed everytime, and it may not be available at odd hours as it is locally hosted for demo purpose) Check screenshots below to see the actual APP.

All the data has been collection from official Covid-19 resource:

  1. https://api.covid19india.org/
  2. https://apisetu.gov.in/public/api/cowin (use with caution: can be rate limited. I have added caching to avoid hitting the API endpoint every call)
  3. https://twitter.com/home

Pre-requisites:

  1. Create Twitter API tokens

    • Create an account on https://developer.twitter.com
    • Create an application with a unique name
    • To access the Twitter API, you will need 4 things from the your Twitter App page. These keys are located in your Twitter app settings in the Keys and Access Tokens tab.
      • consumer key
      • consumer secret key
      • access token key
      • access token secret key
    • Create a directory called creds and a file credentials.py inside it. Save these credentials as Variables in it
    • Do not share these with anyone else because these values are specific to your app.
  2. Docker for Windows/Linux

  3. MongoDB, MongoDB (Compass)

  4. Redis, redis-scheduler For Windows:

    • Need Windows Subsystem for Linux (WSL) - Ubuntu (https://ubuntu.com/wsl)
    • Inside the Ubuntu Terminal, sudo service redis-server start
    • To test, redis-cli -> ping -> Expected Response: PONG
    • Redis is working

    For Linux:

    • apt install redis
    • setup docs available online for Linux

Steps to Run:

  1. Clone the repository https://github.com/eeshsingh123/Covid19_Analysis.git
  2. Setup Docker & docker-compose in the system
  3. Run the command, docker-compose up --build -d (-d for daemon build)

Steps to Run (Without Docker):

  1. Terminal 1 : python3 -m app.flask_main (to run flask app)
  2. Terminal 2 : python3 -m app.twitter_main (to run twitter app)
  3. Terminal 3: python3 -m rq_queue data_updater (run the redis queue, to update the reports based on scheduler call )
  4. Terminal 4: rqscheduler -v (Scheduler which runs periodically and collects users, hashtags data from twitter and updates graph data from covid api)

Repository Contents:

  1. /app/flask_main.py: Flask app which handles the API calls and interacts with the JS Front-end code using Jinja2 template

  2. /app/twitter_main.py: Runs 24/7 and collects data from the Twitter Stream leveraging the tweepy stream api, stores data into mongoDB and generates trending on a Runtime

  3. /workers: Consists of the API and Twitter data Aggregation, Preprocessing and Modelling logic before sending it to the Front-end via Flask app

  4. /concepts: Consists of various Jupyter notebooks where each logic has been tried and tested before integration

  5. /static & /templates: Has all the JavaScript, CSS & Templates file used by Flask for UI integration

  6. /tools : Contains Helper functions to perform tasks needed

NEW FLASK BASED APP:

HOME PAGE:

STATE DISTRIBUTION:

VACCINATION AVAILABILITY:

OLD CORE DASH APP : (NOT IN USE NOW..)

New Feature

  1. Graphs

  1. Live Twitter Feed (Color coded sentiment wise)

About

A dashboard for Real-time analysis of Covid-19 in India and a resource tracker eg. Oxygen, Ventilators, Remdesivir along with Live Vaccine Availablity Tracker.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published