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.
Note: This workflow was never fully implemented. The primary data collection is still based out of Google Sheets
- Install Spatial Data Requirements
sudo apt install libsqlite3-mod-spatialite python-gdal
sudo apt-get install memcached libmemcached-tools -y
brew update
brew install spatialite-tools
brew install gdal
- Setup virtual environment
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
- Create a new
.env
fromexample.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/
- Generate the local db
python manage.py migrate
- To access the admin pages - create a super user
python manage.py createsuperuser
- Start local development server
python manage.py runserver
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
There are two frontends for this application:
- Server side rendered frontend based on Django Templates. This frontend has the crowdsourcing functionality.
- 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.
Install all the node dependencies and start the development server.
cd frontend
yarn
yarn start
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.