The build system for this website uses Node and Gatsby, with each survey being a microsite subpage. The following steps explain how to setup your local environment after pulling down the repository:
-
Before running the project setup node/npm (Installation instructions).
-
Install the (Gatsby CLI) globally
npm install -g gatsby-cli
-
Run
npm install
to install all packages and dependencies. (If you have a M1 Mac, you may need to runbrew reinstall vips
before installing the site packages and dependencies.)
- Run
npm start
in your shell terminal - A hot-reloading development environment of the latest version will start at
http://localhost:8000
. - Open localhost:8000/2022 in your browser to view the site
- In your shell run
npm run start
- A hot-reloading development environment of the all Gatsby versions will start at
http://localhost:8000
. - Open localhost:8000 in your browser and select the desired year to view
Note: Running all years can get slow since each year has its own Sass file being compiled. It is recommended to only run the latest version during development
-
Run
npm run build2018
. This will:- Remove any current
2018
folder in thestatic
directory - Go into /2018
- Install dependencies
- Build the 2018 survey site
- Copy that build into
static
directory
- Remove any current
-
Run
npm run build
. This will:- Build the Gatsby sites in the root
- Build the 2018 site at
/2018
from the static folder
-
Run a local server.
- Install npm http-server
npm i -g http-server
- Start the server from the public folder (this is the compiled site that will be live)
http-server ./public
- Install npm http-server
-
You can find the latest site at the root
localhost:8080
and the 2018 site atlocalhost:8080/2018
The site will be powered by Gatsby and will be organized by:
- Go to
src
>components
. - Click on the file you want to update.
- Choose the
edit this file
option in the toolbar and update the content. - When your updates are complete, create a descriptive commit about your updates that follows the (Sparkbox Standard on commit messages).
- Create a new branch and open up a pull request for your changes, then send the PR to a teammate for review.