The interactive part of the protocol is build using JavaScript and the React Framework. The code for this resides in this directory. Since the output of the front-end build (the app) will only change little over time, it is checked in into the git repository as a static asset.
In order to rebuild the app or work on the code, the following setup needs to be done:
-
Install nodejs using nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
Then add:
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm ```
to your `.bashrc`.
-
Run
nvm install
in this directory to install the node version given in.nvmrc
. -
Run
npm install
to install the node dependencies. -
Run
npm run watch
ormake watch
to build the app and rebuild it when changing the source. -
Run
python3 build/assets.py --link
ormake dev
in the main protocol directory to link the assets instead of copying them. -
Before committing any changes, run
npm run build:prod
or justmake
to create a production version of the app, which then will be part of the repository.