frontend
frontend copied to clipboard
Cambiatus Web based frontend using Elm
Cambiatus frontend
This project is bootstrapped with Create Elm App.
You must have yarn installed to develop or build.
Development
yarn install
yarn start
To update the GraphQL Elm files, run:
yarn generate-graphql
Code Quality
We check JS with StandardJS and Elm with elm-review
before the git push using husky. You can also run yarn standard and yarn review
at any moment to make sure your code is passing the linters.
You can also use elm-analyse to get even more insights about the code.
This package is not included in the repo, you should install it manually:
yarn global add elm-analyse
elm-analyse # view analyse result in terminal
elm-analyse -p 3001 -s # show extended analyse in the browser on `localhost:3001`
Build
yarn install
yarn build
Configurations
Our app have a somewhat complex configuration stack, allowing the app to run without any changes, connecting to the staging environmnent. Here is an outline of all the configuration files and how the interact:
src/scripts/config.jsis the bottom level config. All the defaults are stored here forDEVandPRODenvironments.env-config.jsis the config for the dev/prod/demo servers. This file overwrites the defaults from theconfig.jsabove. Currently, this file is not used in the local dev environment, on the localhost it won't be loaded correctly. In the repo, this file contains the data for the Staging server (in Demo it will be different, in a dedicated server for a community it will be different, etc.).src/elm/Flags.elmis the Elm configuration file. We start our Elm app and send a port with all that comes fromsrc/scripts/config.js. Since we need to decode JSON values on Elm, it comes with some default values so the app won't fail to load, we default it to some values specified there.