Politeiagui is the web frontent for Politiea, Fonero's proposal system.
Politeiagui uses node.js and the yarn package manager.
-
Note: Politeiagui can be run as a standalone application that uses mock APIs to simulate communicaiton with the Politeia backend (useful if you're only doing UI changes). In this case,
politeiawww
isn't needed. However, be aware that the Mock APIs are not always up-to-date with the latest changes.
-
Clone this repository
https://github.com/fonero-project/politeiagui.git
-
Build and run locally.
Against politeiawww
To run politeiagui against
politeiawww
, make surepoliteiawww
is running and use the following command:yarn && yarn start
Mock APIs (WARNING: may be out of date)
To run politeiagui using mock APIs that do not communicate with
politeiawww
(useful for working on UI changes only), run the following command:yarn && yarn uidev
To build politeiagui for production deployment, use the following commands:
yarn && yarn build
ls build
Politeiagui allow customization of settings and features toggling from enviroment variables. To make this process easier we use dotenv.
Specify your config options by creating a .env
file in the root folder of the project. All
variables must be preceded by "REACT_APP" as follow:
/.env:
REACT_APP_TITLE="Politeia"
REACT_APP_STAGING=false
It is also possible to specify a preset to be used:
/.env:
REACT_APP_PRESET="POLITEIA"
If the REACT_APP_PRESET
is specified, all other specified options in the env
file will be ignored.
Politeiagui has unit tests for its core logic. To run all unit tests run the command:
yarn test
Test coverage is currently provided for (actions/*
), (lib/*, reducers/*
) and (selectors/*
).
Relevant libraries/modules used for testing are:
- Jest - Javascript testing
- fetch-mock - Mock http requests
- redux-mock-store and redux-actions-assertions for testing redux actions.
We encourage you to contribute to Politeiagui. Please check How to contribute to Politeiagui for guidelines about how to proceed.
Politeiagui can also be hosted in a docker container. To build the the docker container, run the following commands:
$ ./bin/build.sh
Then run the container with:
$ docker run -d --rm -p <local port>:80 fonero/politeiagui:latest
This project was bootstrapped with Create React App. You can find the most recent version of this guide here.