Skip to content
The COVID Tracking Project website
JavaScript CSS
Branch: master
Clone or download

Latest commit

schwartzadev Merge pull request #859 from COVID19Tracking/schwartzadev/blog-byline…
…-spacing

fix(blog): vertically align byline text with headshots
Latest commit 05497a8 May 15, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Merge from master Apr 27, 2020
.github feat(code): Auto-build storybook on push to master May 6, 2020
.storybook fix: SCSS modules in storybook May 7, 2020
__mocks__ chore: Renamed field to comprehensiveGrade Apr 24, 2020
build chore: Update screenshot source May 12, 2020
plugins/gatsby-source-covid-tracking-api feat: Added plugin to use Covid API files Apr 2, 2020
src fix(blog): byline alignment May 15, 2020
static chore: Move form to component May 13, 2020
.editorconfig Add some markdown defs Mar 17, 2020
.eslintrc.js feat(search): partition search results depending on title/other relev… Apr 30, 2020
.gitignore chore: Added function, set redirect Apr 29, 2020
.npmrc Document required Node version Apr 2, 2020
.prettierignore feat: Added github repo to prettier Apr 5, 2020
.prettierrc.js Configuring eslint and prettier Mar 16, 2020
.typo-ci.yml chore: Add config file for TypoCI Apr 19, 2020
CODE_OF_CONDUCT.md chore(docs): Add link to project code of conduct Apr 21, 2020
CONTRIBUTING.md chore(docs): Documented where SCSS files go. Apr 8, 2020
LICENSE Merge gatsbyjs Mar 26, 2020
README.md chore: Added test:dev command, embed coverage in readme Apr 21, 2020
gatsby-browser.js chore: Make swagger load in component only Apr 28, 2020
gatsby-config.js chore: remove contentful environment May 14, 2020
gatsby-node.js fix: Add blog title, #802 May 6, 2020
gatsby-ssr.js chore: Set paths on pages, blog May 13, 2020
jest-preprocess.js chore: Setup jest testing Apr 18, 2020
jest.config.js chore: Fix test with imports, updated snapshots May 1, 2020
jsconfig.json feat(search): partition search results depending on title/other relev… Apr 30, 2020
loadershim.js chore: Setup jest testing Apr 18, 2020
netlify.toml chore: Remove branch deploy May 12, 2020
package-lock.json Merge remote-tracking branch 'origin/master' into feature/sub-navigation May 12, 2020
package.json Merge remote-tracking branch 'origin/master' into feature/sub-navigation May 12, 2020
setupTests.js Add some tests for state-nav.js component Apr 24, 2020

README.md

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/.

Development

The website is built on GatsbyJS. If you are not familiar with Gatsby, we suggest checking out their excellent documentation.

Install

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

npm install -g gatsby-cli

Then, install all dependencies by running:

npm 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:

npm run setup

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

To run the website locally, use:

gatsby develop

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, 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

Coverage Status

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 npm run test.

When you make a change to an interface, you will need to update the Jest snapshot for tests to complete successfully:

npm run test:update

Before pushing your local branch to the repository, make sure to run npm run 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

All common components throughout the site are documented in Storybook. You can find all our component stories in /src/stories.

To preview the storybook locally, just run:

npm run 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 for information on how to file issues and make pull requests.

You can’t perform that action at this time.