Giter VIP home page Giter VIP logo

covid19-reports's Introduction

STATUS ENGINE

Description

Web app for visualizing Covid-19 data generated by mysymptoms.mil.

Getting Started

Prerequisites

Ensure the following packages are installed.

Development

  • Create a file named .env at project root with the following in it. You can change the USER_EDIPI value to any 10 digit number greater than 1 to create a new user.
USER_EDIPI=0000000001
  • Navigate to the project root and run the following.
npm install
npm run seed-dev
npm run dev

Switching Users

The client uses certificates for login in production rather than a typical login page, which is why we use the USER_EDIPI environment variable as a development workaround. To switch users, change the value of USER_EDIPI in your .env file and restart the development server.

Synchronizing the Database

When modifying database models, it can be useful to continuously sync the database schema during development. To do so, add the following to your .env file:

SYNC_DATABASE=true

This functionality can't be used in production, so you'll still need to remember to write migrations to deploy changes to the schema.

Database Migrations

Running

Migrations will automatically be run on app startup, or they can be manually run with npm run migration-run.

Generating

The recommended way to create a new migration is to run npm run migration-generate {name}, where {name} is the name of the migration you want to create. The generate script will automatically run migrations to make sure you're up to date, then it will generate a new migration for you in /server/migrations with the necessary changes to match your current models.

NOTE: There's currently a known bug in TypeORM's migration generator, where it will always add unnecessary alterations on date columns that use default: () => 'null'. So make sure you review the generated migration and remove any of these unnecessary alterations before committing them (and also format the generated file to match our eslint rules).

Creating

If you want to write a migration from scratch, you can create a new blank migration with npm run migration-create {name}, where {name} is the name of the migration you want to create. An empty template will be generated in /server/migrations.

Restoring State Locally

If your local database schema falls out of sync with migrations and you want to get back to a clean state, you can run npm run seed-dev. This will automatically recreate the database, apply the current migrations, and get the app back into a usable state.

Testing

npm test

Notes

This project was bootstrapped with create-react-app, and uses rescripts to customize the build configuration.

As the project requirements grow, we may need to eject from create-react-app/rescripts. However, they greatly simplify management of the build configuration, so we should avoid ejecting if possible.

covid19-reports's People

Contributors

larskendall avatar jdgarrett avatar anthonywhitaker avatar rogelioii avatar bingles avatar davejackson-pe avatar srflaxu40 avatar jwileczek avatar trevermock54 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.