Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.
/ CovidCrowd Public archive

A crowd-sourcing platform for the Covid-19 Pandemic

Notifications You must be signed in to change notification settings

covid19india/CovidCrowd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CovidCrowd

A crowd-sourcing platform for the Covid-19 Pandemic

This is NOT the project that powers the Covid 19 India Dashboard. Click here to switch to the dashboard project.

Workflow

Note: This workflow was never fully implemented. The primary data collection is still based out of Google Sheets

FlowChart

Development Setup for Backend

  1. Install Spatial Data Requirements

For Ubuntu

sudo apt install libsqlite3-mod-spatialite python-gdal
sudo apt-get install memcached libmemcached-tools -y

For Mac

brew update
brew install spatialite-tools
brew install gdal
  1. Setup virtual environment
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
  1. Create a new .env from example.env and populate the values
cp example.env .env
# Edit the .env file according to your needs. If you are new to decouple library read this https://pypi.org/project/python-decouple/
  1. Generate the local db
python manage.py migrate
  1. To access the admin pages - create a super user
python manage.py createsuperuser
  1. Start local development server
python manage.py runserver

Populating the Database

The Raw Data sheet from the Google Sheets is dumped as a CSV file into the data folder periodically and can be used for initializing or updating the database.

python manage.py importcsv ./data/raw_data.csv

This will create a new report for every row that has a data entry. Mainly it looks to see if the Date Announced column has a value. If the Patient number is already present it will be skipped. So running multiple imports is not an issue.

You can also load the patient travel history into the project using

python manage.py importcsv ./data/travel_history.csv --type travel

Development Setup for the frontend

There are two frontends for this application:

  1. Server side rendered frontend based on Django Templates. This frontend has the crowdsourcing functionality.
  2. Client side rendered frontend based on React. This is just provides a table interface and patient details page for browsing the patient database.

There is nothing to be done for the Django based frontend. This Backend setup would automatically handle this.

Setting up the React Frontend

Install all the node dependencies and start the development server.

cd frontend
yarn
yarn start

A Note about caching

Due to the high traffic load a number of Django views are cached. This might interfere with your development. See patients/urls.py for all the cached views and their durations.

About

A crowd-sourcing platform for the Covid-19 Pandemic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published