The repository for the Healthy Families Healthy Futures website
- Run
yarn install
- Setup development environment variables by running
yarn secrets
- You will be prompted for a password. Ask your EM to send it to you.
- NOTE: Windows users need to run
yarn secrets:login
andyarn secrets:sync
instead
-
Run
yarn start
-
Gatsby will run a development server at
localhost:8000
, complete with hot reloading
yarn start
- starts the development server atlocalhost:8000
yarn build
- builds the project and outputs intopublic/
yarn clean
- runsgatsby clean
to fix weird issues with the development serveryarn lint
- runs eslint/prettieryarn secrets
- syncs secrets from BitWarden
This codebase heavily features TypeScript, a superset of JavaScript that adds static typing to the language. This helps catch bugs at compile-time (typos, null checking, etc.) If you know how to write JavaScript, you can start writing TypeScript by changing .js
and .jsx
to .ts
and .tsx
!
To fully utilize the power of TypeScript, you will have to learn its type system. Use this as a cheat sheet for using TypeScript with React.
While you are encouraged to use TypeScript, you don't have to. Our codebase can be a mix of both TypeScript and JavaScript.
-
Use
[NAME]/[ISSUE_NUMBER]-[SHORT_DESCRIPTION]
to label your feature branches -
Set up "Format on Save" on VSCode to save time
-
Run lint often
This repository is set up with Netlify, which creates preview deployments on every PR and deploys to the main deployment site on pushes to main
.
- React.js - frontend components
- Gatsby - static site generation
- Contentful - content management
- eslint - linting
- prettier - formatting
- yarn - package management
-
src/
: Contains almost all of our front-end code. This is where we put our React components, Gatsby pages, and styles. It has four sub-folders:components/
: Contains reusable React componentscss/
: Contains CSS modules for components and pagespages/
: Contains top-level page componentsutils/
: Contains miscellaneous code
-
static/
: Stores static files like fonts or the favicon. -
gatsby-config.ts
: Not a directory, but a file that defines plugins and other config for Gatsby (see Gatsby doc)