Green Equity Demo

February 9, 2023 ยท View on GitHub

This project will demo a couple data visualizations of how and where Infrastructure Bill money is being spent.

Requirements

Getting Started

./scripts/bootstrap
./scripts/update

A pre-commit hook that lints staged files is included. It can be installed with:

python3 -m pip install pre-commit
pre-commit install

If there are lint failures, they are reported and the commit is aborted. Formatting fixes will be applied automatically. Once any other needed fixes are made, simply reattempt the commit.

The hook can always be ignored with git commit --no-verify.

Development

Rebuild Docker images and run application.

./scripts/update
./scripts/server

Ports

ServicePort
Webpack Dev Server8765

Testing

./scripts/test

Scripts

NameDescription
bootstrapSetup environment file
citasksRun tasks before building images in CI
cleanFree disk space by cleaning up dangling Docker images
consoleRun interactive shell inside application container
lintLint source code
serverRun Docker Compose services
testRun unit tests
updateBuild Docker images
yarnRun yarn commands on the app container

Adding new JS/TS Packages

To add a new package to the project:

./scripts/yarn add package-name

Upgrading JS/TS dependencies

The update script uses a --frozen-lockfile flag so when packages need an upgrade:

# Manually change the package.json to upgrade the version and run:

./scripts/yarn install

Use Typescript file watching

Watch for TypeScript changes and list all errors

./scripts/yarn tsc --watch