jajukajulz / covid19zim

Covid19Zim Information Hub - Near-real time statistics and information about the COVID-19 in Zimbabwe. NB - This project is now archived but is accessible from https://covid19zim.herokuapp.com

Home Page:https://covid19zim.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

COVID-19 in Zimbabwe

covid19zim Information Hub is a web application for accessing near-real time statistics and information about the COVID-19 in Zimbabwe. Official statistics are gathered from the Ministry of Health and Child Care (MoHCC) in Zimbabwe. Other data sources such as WHO are also considered. This application is independently developed and not affiliated with any government organisation.

Online version available at https://covid19zim.herokuapp.com

Alt text

Use Cases

covid19zim Information Hub use cases:

  • Confirm official cases, deaths and recoveries.
  • Display contact details for the MoHCC in Zimbabwe
  • Display Health Tips
  • List COVID-19 resources for Zimbabwe
  • Display contact details for Hospitals in Zimbabwe

Installation (Development Environment)

In order to run covid19zim Dashboard, an environment with the following is required:

  • Node.js
  • Express Framework
  • Bootstrap

Steps

  1. Install node dependencies.
$npm install
  1. Create a Firebase Cloud Firestore DB.
  • Create a collection called stats
  • Create a document called stats
  • Add the following fields to the stats document - const_lockdown_active,lockdown_status,lockdown_current_day,total_negative,total_recovered,total_tested,total_deaths,total_confirmed,last_updated, response_status_flag,data_date,lockdown_total_days
  1. Create .env file and add the following variables (Firebase from Firebase Service Account, smtpServer from your email server, and ADMIN for the user logging in via magic link).
FIREBASE_TYPE=
FIREBASE_PROJECT_ID=
FIREBASE_PRIVATE_KEY_ID=
FIREBASE_PRIVATE_KEY=
FIREBASE_CLIENT_EMAIL=
FIREBASE_CLIENT_ID=
FIREBASE_AUTH_URI=
FIREBASE_TOKEN_URI=
FIREBASE_AUTH_PROVIDER_X509_CERT_URL=
FIREBASE_CLIENT_X509_CERT_URL=
smtpServerFrom=
smtpServerUser=
smtpServerPassword=
smtpServerHost= #for gmail should be smtp.gmail.com
smtpServerPort= #for gmail should be 465
ADMIN_USERNAME=
ADMIN_EMAIL=
PASSPORT_ZERO_SECRET=
NODE_ENV="development"
  1. Start the web server (Express) and navigate to http://localhost:3000/ in your browser.
$npm run dev
  1. Update Cloud Firestore and flush cache for latest stats to show on dashboard.
localhost:3000/caches/delete

Production Deployment

  1. To deploy to a production server (e.g. heroku) - create project, configure env variables and push.

If on a different server, after deploy, run the start command.

$npm run start

API v1 Documentation

Get COVID19 Stats for Zim (i.e. for stats document)

curl -k https://covid19zim.site/api/v1/fetch_stats
{"const_lockdown_active":false,"lockdown_status":"Started","lockdown_current_day":8,"total_negative":349,"total_recovered":-1,"total_tested":358,"total_deaths":1,"total_confirmed":9,"last_updated":"06 April 2020","response_status_flag":true,"data_date":"05 April 2020","lockdown_total_days":21}

Get COVID19 Stats for configured countries (i.e. for all documents)

curl -k https://covid19zim.site/api/v1/fetch_all_stats
{"stats":{"lockdown_total_days":21,"const_lockdown_active":false,"lockdown_status":"Started","lockdown_current_day":8,"total_negative":349,"total_recovered":-1,"total_tested":358,"total_deaths":1,"total_confirmed":9,"last_updated":"06 April 2020","response_status_flag":true,"data_date":"05 April 2020"}}

Other Documentation

Cache

The web app uses server side caching as the stats are updated once a day. The cache routes can only be access by a logged in user.

Check cache keys: /caches/view
Check cache json: /caches/json
Flush cache: /caches/delete
Get cache size:  /caches/size
Test cache: /caches/test/

Authentication

The web app uses magic link authentication. Only the user with ADMIN_EMAIL set in env variables can login. After entering the valid login email, an email with magic link is sent, which when clicked gives access.

Login: /login
User Profile: /profile
Logout: /logout

Supported Browsers

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Samsung
Samsung
Opera
Opera
IE11, Edge Supported Supported Supported Supported Supported Supported

Get in Touch

Feedback form

Blog Post about COVID19ZIM Aggregator

About

Covid19Zim Information Hub - Near-real time statistics and information about the COVID-19 in Zimbabwe. NB - This project is now archived but is accessible from https://covid19zim.herokuapp.com

https://covid19zim.herokuapp.com


Languages

Language:EJS 56.1%Language:JavaScript 41.9%Language:CSS 2.0%