The COVID Tracking Project website
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/.
Additional documentation can be found at our documentation and Storybook website.
First, you'll need the Gatsby command line interface installed globally:
npm install -g gatsby-cli
Then, install all dependencies by running:
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
.envfile with a copy of read-only API keys to Contentful, run:
You can also run
yarn setup:api-repoif you just want to download data and not touch the
To run the website locally, use:
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/___graphqlto see what data is exposed to the website.
Note that any changes you make while running Gatsby will automatically checked with ESLint, so check your console as you save files.
Components live in
src/componentsand are organized as follows:
/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.
StateGradehas to do with states) belong in their respective directory in
/utils- Utilities. (If a particular component doesn't have any associated styles, there's a good chance it's a utility.)
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
When you make a change to an interface, you will need to update the Jest snapshot for tests to complete successfully:
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.
All common components throughout the site are documented in Storybook. You can find all our component stories in
To preview the storybook locally, just run:
The storybook is now available at
No matter how you choose to help, we would love to have you as part of the project. Check our Contributing Guide for information on how to file issues and make pull requests.