Coder Social home page Coder Social logo

sg-covid-19-dashboard's Introduction

SG COVID-19 Dashboard

⚠️ This service has since been stood down as it is no longer needed and APIs are no longer active ⚠️

Singapore COVID-19 Dashboard

View the publicly accessible site here

Features currently available

  • View latest day statistics
  • View Case History (Up to 19 April 2020)
  • View past statistics in a table
  • Graphs showcasing some statistics (More coming soon!)
  • Add statistics

Databse Configuration

As of now, only MySQL is supported

  • Create 2 tables with the schemas available here. You can change any of the table names except sg_case_info
  • Extract and run the data script found here

Using the Docker image

Ready made docker images are available for this project and can be found in the project's container registry.
It is also recommended to use Docker Compose to do so for filling up some of the environment variables (alternatively you can save the variable into config-dev.js)

  • Using environment variables
    Use the following docker-compose file to start the server up, replacing values accordingly. Note that you can also startup your database through docker, but make sure the steps in database configuration is followed.
version: "3.5"
services: 
    webserver:
        image: registry.gitlab.com/itachi1706/sg-covid-19-dashboard:latest
        ports:
            - "443:3000"
        environment:
            - dbDatabase=<Database Name>
            - dbDelta=<Database Delta Table Name>
            - dbHost=<Database Host Name>
            - dbInfo=<Database Info Table Name>
            - dbPassword=<Database User Password>
            - dbUser=<Database User Name>
            - fbApi=<Firebase API Key>
            - fbAppId=<Firebase Application ID>
            - fbAuthDomain=<Firebase Authentication Domain>
            - fbDatabaseURL=<Firebase Database URL>
            - fbMeasurement=<Firebase Measurement ID>
            - fbMessage=<Firebase Messaging ID>
            - fbProjId=<Firebase Project ID>
            - fbStorage=<Firebase Storage ID>
            - firebaseSvcAcct=<Firebase Service Account>
            - PRODMODE=true
            - NODE_ENV=production

301 Redirect Note

If you are exeperiencing a infinite 301 redirect (or Chrome throws a TOO_MANY_REDIRECTS error), try disabling the HTTP -> HTTPS automatic redirect by adding the following environment variable disableHTTPSRedirect = true

Images available

  • latest: registry.gitlab.com/itachi1706/sg-covid-19-dashboard:latest
  • 1.0.0: registry.gitlab.com/itachi1706/sg-covid-19-dashboard:1-0-0

How to start development

  • Get a config key from Firebase
  • Setup a MySQL Database and create 2 tables (schemas available here). You can change any of the table names except sg_case_info
  • Extract and run the data script found here
  • Create a file called "config-dev.js" in the root repository directory.
  • Add the following code
module.exports.config = 'yourFirebaseConfigObject';
module.exports.db = {
    host: 'hostname',
    user: 'user',
    password: 'password',
    database: 'database',
    infoTable: 'table name of info table',
    deltaTable: 'table name of delta table'
}
  • Generate a service account from Firebase > Project Settings and save the file as service-account.json in the root of the repository folder

sg-covid-19-dashboard's People

Contributors

itachi1706 avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.