Skip to content

Latest commit

 

History

History
93 lines (52 loc) · 3.4 KB

README.md

File metadata and controls

93 lines (52 loc) · 3.4 KB

Wildfire Predictive Services Web Application

Description

Wildfire Predictive Services to support decision making in prevention, preparedness, response and recovery.

Getting Started

Dependencies

  • You’ll need to have Node >= 10.x and yarn on your machine. You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.
  • Note: We are using Node 19 as a base image on our pipeline.
  • On ubuntu: sudo apt install nodejs
  • npm install -g yarn

Installing

In the project directory, run:

yarn

Installs all dependencies in the node_modules folder.

Cypress on WSL2

It's possible to configure cypress to run with an X-server with WSL2 and Windows see this blog entry

The short version is:

  • Launch VcXsrv (remember to check "Disable access control")
  • yarn run cypress

Executing program

In the project directory, create .env file at root using .env.example as a sample, then you can run:

yarn start

Runs the app in the development mode. The page will reload if you make edits. You will also see any lint errors in the console.

yarn test

Launches the jest test runner in the interactive watch mode. Includes logic only unit tests and react-testing-library component tests.

yarn cypress

Launches the cypress test runner in the interactive watch mode. Includes end-to-end / integration tests for frontend common path interactions.

yarn run build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

Running the application in docker:
  1. Create .env file at root using .env.example as a sample
  2. Run docker compose build and then docker compose up
  3. Open http://localhost:3000 to view it in the browser.

Config

In openshift/templates/global.config.yaml there is a template for a global ConfigMap. This template can be applied to the Openshift project from the command line. For example, to apply the global.config template and pass a value for the REACT_APP_KEYCLOAK_REALM parameter, run

oc -n <openshift-project-name> process -f openshift/templates/global.config.yaml -p REACT_APP_KEYCLOAK_REALM=<realm-name> | oc create -f -

License

This project is licensed under the Apache License, Version 2.0.

Contributing

Frontend changes should follow MaterialUI design as closely as possible, leveraging the Material-UI React implementation library, unless decided otherwise.

Acknowledgments

Inspiration, code snippets, etc.

SonarCloud

Template copied from