This project was bootstrapped with create-react-app.
git clone git@github.com:enveritas/enveritas-frontend.git
cd enveritas-frontend/
git checkout supply-chain-dashboard
cd projects/supply-chain-dashboard
yarn install
yarn start
git checkout -b name-of-the-new-feature
API responses are modeled using the GraphQL schema language.
A GUI can be run by running yarn graphql
(pointing to http://localhost:2999
). This allows checking the validity of mocks against the schemas. Standard GraphQL queries are located in graphql/mocks
and can be used in the GUI.
yarn lint
You need a source shapefile of all Supply Units. Natural Earth data is used for countries that are not present in the SU shapefile. Run:
yarn generate-topojson [source file path]
yarn generate-topojson ./scripts/in/su/su\ of\ central\ america.shp
This will generate needed TopoJSON files in src/map
.
In order to keep the data safe we are using crypto-js to encrypt the json file.
To do this follow the next steps:
- ensure you have the (git-ignored) file called supply-chain-dataset.json in the
./src/data
folder - Run
yarn encrypt-json
- Choose your password in the node input request to save the new encripted file.
Once the app is loaded, the browser will prompt with the password choosen to decrypt the file in the client side and show an alert when password is not valid.