{"id":44079441,"url":"https://github.com/pacificclimate/climate-explorer-frontend","last_synced_at":"2026-02-08T08:34:37.000Z","repository":{"id":2837343,"uuid":"47588182","full_name":"pacificclimate/climate-explorer-frontend","owner":"pacificclimate","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-17T23:18:42.000Z","size":7160,"stargazers_count":7,"open_issues_count":98,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-18T00:12:58.263Z","etag":null,"topics":["actions","docker","snyk"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pacificclimate.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-12-08T00:31:18.000Z","updated_at":"2025-09-17T23:18:45.000Z","dependencies_parsed_at":"2024-02-23T21:28:20.755Z","dependency_job_id":"1b9ec9a5-37bf-4c8c-b4e5-e9fcfccc6bd7","html_url":"https://github.com/pacificclimate/climate-explorer-frontend","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/pacificclimate/climate-explorer-frontend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacificclimate%2Fclimate-explorer-frontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacificclimate%2Fclimate-explorer-frontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacificclimate%2Fclimate-explorer-frontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacificclimate%2Fclimate-explorer-frontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pacificclimate","download_url":"https://codeload.github.com/pacificclimate/climate-explorer-frontend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacificclimate%2Fclimate-explorer-frontend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29225478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T06:05:31.539Z","status":"ssl_error","status_checked_at":"2026-02-08T05:58:33.853Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","docker","snyk"],"created_at":"2026-02-08T08:34:36.301Z","updated_at":"2026-02-08T08:34:36.993Z","avatar_url":"https://github.com/pacificclimate.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PCIC Climate Explorer\n\n![Node CI](https://github.com/pacificclimate/climate-explorer-frontend/workflows/Node%20CI/badge.svg)\n![Docker Publishing](https://github.com/pacificclimate/climate-explorer-frontend/workflows/Docker%20Publishing/badge.svg)\n[![Code Climate](https://codeclimate.com/github/pacificclimate/climate-explorer-frontend/badges/gpa.svg)](https://codeclimate.com/github/pacificclimate/climate-explorer-frontend)\n\nFront end interface for the PCIC Climate Explorer. Node, React.js, Webpack, Babel, ES6+.\n\n## Requirements\n\nNode.js = 22.x.x (**important**)\n\nAll other package requirements are specified in `package.json`. And their specific versions in the package-lock.json.\n\nWe **strongly** recommend using [`nvm`](https://github.com/creationix/nvm) to manage your `node`/`npm` install.\nIn particular, you will have trouble finding later versions of Node.js in standard Linux installs;\n`nvm` however is up to date with all recent releases.\n\nDevcontainer files are provided in .devcontainer to facilitate these requirements using that development environment.\n\nNote: Avoid `snap` packages. Experience to date suggests it does not result in stable, reliable installations.\n\n## Configuration\n\n### Configuration variables\n\nConfiguration values are managed via a `config.js` file loaded into the app at runtime. Defaults (used for local\ndevelopment) can be found in [public/config.js](./public/config.js). Adjust these as needed for your local environment\nbut the defaults _should_ work.\n\nConfiguration variables for configuring the app are:\n\n`PUBLIC_URL`\n\n- Base **URL** for CE frontend app.\n- For production, set this to the URL for CE configured in our proxy server.\n- **WARNING**: The path component of this value **MUST** match `REACT_APP_CE_BASE_PATH` (see below).\n\n`REACT_APP_APP_VERSION`\n\n- Current version of the app.\n- This value should be set using `generate-commitish.sh` when the Docker image is built (see below).\n- It is not recommended to manually override the automatically generated value when the image is run.\n- No default value for this variable is provided in any `.env` file.\n\n`REACT_APP_CE_BACKEND_URL`\n\n- Publicly accessible URL for backend climate data.\n\n`REACT_APP_TILECACHE_URL`\n\n- Tilecache URL for basemap layers.\n\n`REACT_APP_NCWMS_URL`\n\n- ncWMS URL for climate layers.\n\n`REACT_APP_CE_ENSEMBLE_NAME`\n\n- Ensemble name to use for backend requests.\n\n`REACT_APP_MAP_LAYER_ID_TYPE`\n\n- Type of identifier used by the app in requests for map climate layers.\n  - Value `dynamic` selects the dynamic dataset identifier type.\n    A dynamic dataset identifier is formed by prefixing the value of\n    `REACT_APP_MAP_LAYER_ID_PREFIX` to the filepath of the dataset\n    (obtained from the metadata).\n  - Any other values selects static (preconfigured) dataset identifier type.\n    A simple dataset identifier is the unqiue_id of the dataset\n    (obtained from the metadata).\n\n`REACT_APP_MAP_LAYER_ID_PREFIX`\n\n- Prefix used to form a dynamic dataset identifier, if requested.\n  (See item above.)\n\n`REACT_APP_VARIABLE_OPTIONS`\n\n- Path within the `public` folder of the variable options file.\n\n`REACT_APP_EXTERNAL_TEXT`\n\n- Path within the `public` folder of the external text file.\n\n### Environment Variables:\n\nBuild configuration can still be managed via Environment variables however once built these will be unchangable\nat runtime. Currently the following are defined:\n\n`PUBLIC_URL`: Defined as the local url when in development mode. Set to `%REPLACE_PUBLIC_URL%` during production\nbuilds to allow for environmental configuration. See [entrypoint.sh](./docker/entrypoint.sh) for this mechanism.\n\n`APP_VERSION`: set via the `generate-commitish.sh` script, used to bake the current version into the javascript files.\n\n`NODE_ENV` [(unchangable)](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables): Set automatically to `production` when running `npm run build`, `development` otherwise. Allows for some\noptimisation when executing production builds.\n\n### Variable options\n\nA certain amount of configuration of the app is accomplished through the variable options file,\nwhich is a YAML file stored at a location specified by the environment variable `REACT_APP_VARIABLE_OPTIONS`.\nThe source for the default version of this file is at `./public/variable-options.yaml`.\n\nFor documentation on the contents of this file, see the comments at the head\nof the file.\n\nSee Production section below for information on \"live updating\" this file.\n\n## Development\n\nThis project is now based on [Create React App](https://github.com/facebook/create-react-app).\nOriginally it was a manually managed Webpack/Babel project,\nbut, for a variety of reasons you can read about in [issue 297](https://github.com/pacificclimate/climate-explorer-frontend/issues/297),\nwe \"rebased\" it on CRA.\n\n### Installation\n\nThis app has been tested against node 22, with its accompanying npm 10.9. These can be set up manually (we reccomend\nthe use of nvm or the `.devcontainer` specification can set up a container based development environment for you, including\nexecuting an initial npm install for you.\n\nWith the appropriate versions of `node`/`npm` in use:\n\n```bash\nnpm install\n```\n\nIf you need to start fresh after much messing about, the `reinstall` script\ndeletes `./node_modules/` and then installs:\n\n```bash\nnpm run reinstall\n```\n\n### Running (dev environment)\n\n```bash\nnpm start\n```\n\nFor building a production app, see below.\n\n### Testing\n\n```bash\nnpm test\n```\n\n### Linting / code style\n\nLinting is handled by [Prettier](https://prettier.io/). Prettier can be run directly from the command\nline or using the two aliased commands from the [package.json](package.json); `npm run lint` and `npm run format`.\n`lint` will check code for errors, format will automatically fix those errors.\n\nPrettier is also installed as a pre-commit hook as per instructions [here](https://prettier.io/docs/en/precommit.html)\nusing \"Option 1. lint-staged\".\n\n## Production\n\n### Notes\n\n#### Github Actions\n\nThe workflows setup in actions will automatically build, tag and publish to our [docker hub](https://hub.docker.com/r/pcic/climate-explorer-frontend).\n\n#### Configuration, environment variables, and Docker\n\nRun-time configuration options are managed via a `config.js` file loaded into `index.html` when the app is loaded.\nDefaults for these configuration options are kept in [public/config.js](./public/config.js), it should have\nsensible defaults that allow local development. After deployment, this file can be replaced to adjust configuration\noptions to match the deployed environment. Within the container it is stored at `/app/config.js`.\n\nWe no longer use environment variables for runtime configuration in order to avoid the build time associated with it.\nThey can be used to configure specific builds.\n\n#### Routing and base path\n\nA key requirement is to be able to configure at run time the the URL at which the app is deployed.\n\nBecause we are using React Router v4 (react-router-dom), and therefore the HTML5 `pushState` history API via\nits [dependency](https://reacttraining.com/react-router/web/api/history)\n[`history`](https://github.com/ReactTraining/history),\nwe [cannot use](https://facebook.github.io/create-react-app/docs/deployment#serving-the-same-build-from-different-paths) t\nhe relatively simple `package.json` `homepage` property.\n\nInstead we must use CRA-provided build-time environment variable `PUBLIC_URL`.\n\n- It is [discussed briefly](https://facebook.github.io/create-react-app/docs/using-the-public-folder)\n  as the URL for the `public` folder, of which we make use for dynamic configuration assets such as\n  external text and variable configuration files.\n\n- `PUBLIC_URL` is also discussed more interestingly in\n  [Advanced Configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration):\n\n      \u003e Create React App assumes your application is hosted at the serving web server's root or a subpath as\n\n  specified in package.json (homepage). Normally, Create React App ignores the\n  hostname. You may use this variable to force assets to be referenced verbatim\n  to the url you provide (hostname included). This may be particularly useful\n  when using a CDN to host your application.\n\n### Setup using Docker\n\nWe use Docker for production deployment.\n\nIt can also be useful in development; for example, to test a proposed volume mounting for the container.\n\n#### Build docker image manually\n\nA Makefile has been included for helping execute the creation of a docker image. This can be executed\nvia the command `make image`. It will build the javascript code into `build/` and create a docker image.\n\n#### Run docker image\n\nThe generated docker image can be tested via the `make up` command. This will start the container based\non the specification defined in the [docker/docker-compose.yaml](./docker/docker-compose.yaml) file.\nConfiguration options for its execution can be found in its accompanying [config.js](./docker/config.js),\nthese can be adjusted to suit your preferred configuration (such as adjusting the API source).\n\n## Updating configuration files\n\nCertain parts of Climate Explorer are configured in external configuration files.\nThese configuration files are stored in [the `public` folder](https://facebook.github.io/create-react-app/docs/using-the-public-folder).\nThe path to each configuration file inside this folder specified by a value in the `config.js`.\nSpecifically:\n\n| Configuration    | Env variable                 | Default value              |\n| ---------------- | ---------------------------- | -------------------------- |\n| External texts   | `REACT_APP_EXTERNAL_TEXT`    | external-text/default.yaml |\n| Variable options | `REACT_APP_VARIABLE_OPTIONS` | variable-options.yaml      |\n\nDuring a build (`npm run build`),\nfiles in the `public` folder are copied directly, without bundling, to the build directory (normally, `./build`).\nFiles in the `build` folder can be updated on the fly, so that changes to them can be made without creating\na new release of Climate Explorer.\n\nWhen running the app in a production environment, we mount an external configuration file as a volume\nin the docker container. (See section above.)\nThis external file can be modified, and the container restarted, to provide an updated version of the\nvariable options file without needing to modify source code, create a new release, or rebuild the image.\n\nTo prevent tears, hair loss, and the cursing of your name by future developers (including yourself),\nwe **strongly recommend also updating** the source configuration files in the repo (in the `public` folder)\nwith any changes made, so that they are in fact propagated to later versions. \"Hot updates\" should not be stored\noutside of the version control system.\n\n## Releasing\n\nCreating a versioned release involves:\n\n1. Increment `version` in `package.json`\n2. Summarize the changes from the last version in `NEWS.md`\n3. Commit these changes, then tag the release:\n\n```bash\ngit add package.json NEWS.md\ngit commit -m\"Bump to version x.x.x\"\ngit tag -a -m\"x.x.x\" x.x.x\ngit push --follow-tags\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacificclimate%2Fclimate-explorer-frontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpacificclimate%2Fclimate-explorer-frontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacificclimate%2Fclimate-explorer-frontend/lists"}