This is the code for https://striketracker.ilr.cornell.edu/.
It is primarily a single page app hosted on Github Pages, but the data is stored in a Grist database. There is a build script that transforms the data in the database into a JSON file that is deployed to Pages.
- Data is added and edited in a Grist database.
- A build script, run with Github Actions, generates a static copy of this site with the database data in
labor_actions.jsonand publishes it to Github Pages.- The scheduled workflow may be disabled if there is no repo activity for 60 days. See https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#disabling-and-enabling-workflows
GRIST_API_TOKENmust be set in the Secrets and variables settings (settings/secrets/actions) in the Github project.
- Copy
.env.exampleto.envand set theGRIST_API_TOKEN. - Run
npm install.
- Run
npm run buildto create thelabor_actions.jsonfile. - Open
index.htmlin a web browser.
A simple Docker container build file is included for testing purposes. It will run the node.js build script and can serve the site with a basic static web server:
docker build -t ilrweb/striketracker:latest .
The resulting image can be pushed to Docker hub, where the ILR web team has an account:
docker push ilrweb/striketracker:latest
The image can be run with a command like the following:
docker run -it --rm --init -p 3000:3000 ilrweb/striketracker:latest
- Site loading is much faster. This was done by:
- Rewriting the javascript
- Initially limiting the first page load to the labor actions of the last 12 months
- The filter form has been simplified and now includes Employer
- New non-google map with custom markers
- Moved data from Google Sheets to self-hosted Grist instance
- No more Google Form for adding/editing existing labor actions
- Relational storage for locations and sources
- Built-in geocoder that doesn't rely on a paid Google project
- Report a Labor Action form moved to Grist with results next to existing data
- This could be improved by changing the form and dropping the reports into the main data table