Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/COVID19Tracking/website

The COVID Tracking Project website
https://github.com/COVID19Tracking/website

production

Last synced: 3 months ago
JSON representation

The COVID Tracking Project website

Awesome Lists containing this project

README

        

**As of March 7, 2021 we are [no longer collecting new data](https://covidtracking.com/analysis-updates/giving-thanks-and-looking-ahead-our-data-collection-work-is-done). [Learn about available federal data](https://covidtracking.com/analysis-updates/federal-covid-data-101-how-to-find-data).**

---

# COVID Tracking Project

The COVID Tracking Project collects information from 50 U.S. states, the District of Columbia, and 5 other U.S. territories to provide the most comprehensive testing data we can collect for the novel coronavirus, SARS-CoV-2.

This repository is for the project's **website**: https://covidtracking.com/.

## History

A full write-up on the history of the website is availble in the [HISTORY.md](CONTRIBUTING.md) file.

## Documentation

Additional documentation can be found [at our documentation and Storybook website](https://covid19tracking.github.io/website-docs).

## Development

The website is built on [GatsbyJS](https://www.gatsbyjs.org/). If you are not familiar with Gatsby, we suggest checking out their [excellent documentation](hhttps://www.gatsbyjs.org/docs).

### Install

First, you'll need the Gatsby command line interface installed globally:

```shell
npm install -g gatsby-cli
```

Then, install all dependencies by running:

```shell
yarn install
```

The website is built from two separate data sources: our own API for COVID data, and Contentful for content. To download the most recent COVID data and setup a `.env` file with a copy of read-only API keys to Contentful, run:

```shell
yarn setup
```

You can also run `yarn setup:api-repo` if you just want to download data and not touch the `.env` file.

To run the website locally, use:

```shell
yarn develop
```

The project takes 8-10 minutes to build.

The site is now running at `http://localhost:8000`. Any changes you make to code is live-updated. There is a GraphQL preview tool available at `http://localhost:8000/___graphql` to see what data is exposed to the website.

Note that any changes you make while running Gatsby will automatically checked with [ESLint](https://eslint.org/), so check your console as you save files.

### Organization

Components live in `src/components` and are organized as follows:

- `/charts` - Visualizations
- `/common` - Components that are used more than once and those that are used across different parts of the website
- `/layout` - Components that control the layout of the website (i.e. headers and footers)
- `/pages` - Components that are only used once or have a defined scope to a particular part of the website (i.e. `StateGrade` has to do with states) belong in their respective directory in `/pages`
- `/utils` - Utilities. (If a particular component doesn't have any associated styles, there's a good chance it's a utility.)

## Testing

We use Jest for automated testing, and all test files for Gatsby are located in `./src/__tests__`. Test files are structured following their related components. To run tests, use `yarn test`.

When you make a change to an interface, you will need to [update the Jest snapshot](https://jestjs.io/docs/en/snapshot-testing) for tests to complete successfully:

```shell
yarn test:update
```

Before pushing your local branch to the repository, make sure to run `yarn test:dev`. This will make sure the project is linted and all tests pass. Make sure that every test passes. Pull requests are automatically checked against these same tests.

## Storybook

[View our Storybook](https://covid19tracking.github.io/website-docs)

All common components throughout the site are documented in [Storybook](https://storybook.js.org/). You can find all our component stories in `/src/stories`.

To preview the storybook locally, just run:

```shell
yarn storybook
```

The storybook is now available at `http://localhost:6006`.

## How to contribute

No matter how you choose to help, we would love to have you as part of the project. Check our [Contributing Guide](https://github.com/COVID19Tracking/website/blob/master/CONTRIBUTING.md) for information on how to file issues and make pull requests.