Skip to content

090max/covid19Tracker_server

Repository files navigation


Covid 19 Tracker

A python flask API that regularly tracks Covid19 cases in India.
View Demo

Table of Contents

API Information

Routes Information

  • /getgeneral : Returns a JSON data of the current cases report of India.
  • /getanalytics : Returns a JSON data of the past case report along with current cases in India .This is specifically for data visualization.
  • /getstate?state=statename :Return a JSON data of the current case report of a particular state.Note : statename should be in lowercases and without any white spaces.
  • /getstate?state=all :Return a JSON data of the current case report of all Indian states.

API Files Information

  • app.py : Responsible for routing purpose.
  • information_fetcher.py : Fetches the information for a particular route.
  • scrapper.py :Scrapes the data from "https://www.mohfw.gov.in/"
  • clock.py :Runs the cron job in the given interval of time.

Built With

  • Python
  • Flask
  • Mongo DB

Getting Started

Here is a quick installation guide.Please note this is for Ubuntu machines.

Installation

  1. To Run the application for development ,Clone the repo
git clone https://github.com/090max/covid19Tracker_server
  1. Install requirements.
pip install requirements.txt
  1. Run the application.`
python app.py

Database Setup

  1. Go to any of the Mongo DB hosting website( ex - Mongo Atlas)
  2. Create a Database named "covid19".
  3. Create two collections named "general" and "state_wise"
  4. Paste the connection url in db_helper.py file.

Heroku Hosting

  1. Login to heroku and create a new web app.

  2. Install heroku CLI .Follow this link.

  3. Run the following commands on your terminal in the directory of project.Note : The Procfile and requirements.txt is already defined here , so no need of making a new one.

git init
heroku git:remote -a <your heroku app name>
git add .
git commit -m "Commit info"
git push heroku master
  1. Run the following commands to scale the clock (cron job) and web app , run on your terminal.
heroku ps:scale clock =1
heroku ps:scale web=1
  1. Add time zone to the heroku application ,run this on terminal
heroku config:add TZ="Asia/Kolkata"
  1. Thats is your application is LIVE !!.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/FeatureBranch)
  3. Commit your Changes (git commit -m 'Add some Feature')
  4. Push to the Branch (git push origin feature/FeatureBranch)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Releases

No releases published

Packages

No packages published

Languages