This project uses Svelte for the user interface, which is built as a static web application where web assets are built in advance in a dedicated build step.
This uses Mapbox GL JS for the map engine.
This project requires the NodeJS version specified in .nvmrc. For convenience,
NodeJS can be managed using nvm. Install nvm
and then run:
nvm install
nvm useTo activate that version of NodeJS each time you open this project, use
nvm usePython and tippecanoe are used for processing GIS data into map tiles in PMTiles format so they can be used directly in frontend without requiring a tile server.
It is only necessary to do this if the SECAS boundary or state boundaries change.
Install uv. Then set up a new virtual environment:
uv venv .venv --python=3.12Activate it for your shell, e.g., Fish:
source .venv/bin/activate.fishThen install the dependencies specified in pyproject.toml (and frozen in uv.lock):
uv sync --frozenSee analysis/prep/README.md for more information.
Create .env.development file with the following entry:
PUBLIC_MAPBOX_TOKEN=<mapbox token>In a production environment, this also needs the following entries:
PUBLIC_SENTRY_DSN=<sentry DSN created for project at https://sentry.io>
PUBLIC_GOOGLE_ANALYTICS_ID=<google analytics ID>The website is hosted using Github. It uses Github actions to run the build step to transform the Svelte application into static web assets (HTML / CSS / Javascript / etc) that are then hosted by Github.
To configure the production environment:
-
Enable actions: Go to
https://github.com/<organization>/<repository>/settings/actionsand choose "Allow all actions and reusable workflows" at the top -
Enable build from Github actions: Go to
https://github.com/<organization>/<repository>/settings/pagesand choose "Github Actions" in the dropdown for Source under "Build and deployment" -
Edit or enable github pages environment and source branches for build: Go to
https://github.com/<organization>/<repository>/settings/environmentsand select thegithub-pagesenvironment if it exists, or create a new environment with that name. Then in the "Deployment branches and tags" section, use the "Add deployment branch or tag rule" button to addmasterand any other branches that are allowed to publish changes to the website -
Set repository secrets: Go to
https://github.com/<organization>/<repository>/settings/secrets/actionsand add the following entries and their values in the "Repository secrets" section: -
PUBLIC_MAPBOX_TOKEN
-
PUBLIC_SENTRY_DSN
-
PUBLIC_GOOGLE_ANALYTICS_ID
-
Set website deploy path: Go to
https://github.com/<organization>/<repository>/settings/variables/actionsand add the following entry in the "Repository variables" section: -
DEPLOY_PATH:/story-map
Github is configured to deploy from the master branch. This setting is controlled
in .github/workflows/build.yml.
After pushing changes to the master branch, you can watch the Actions workflows
at https://github.com/<organization>/<repository>/actions to determine if the
build is in progress, succeeded, or failed.