The project aims to use the BEM naming convention.
The project uses TypeScript. Utility command yarn lint
can help identifing wrong and missing types.
Versioning is done via yarn version
. Usually a patch version change is enough; if a new page/module is added, instead, a minor change is required.
The UI is configured to use a proxy so that real apis deployed online can be used when developing locally. The proxy is available under the server
folder and it can be run with node index.js
or yarn proxy
Before merging any PR, make sure that:
- the version is incremented. the command
yarn version
should be used for this purpose. - every changed line followes the styleguide pattern; the command
yarn prettier
should be used for this purpose. - there are no linting issues; the command
yarn lint
should be used for this purpose.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Runs the proxy to connect to online apispac
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
Runs prettier on the project source files.
Runs ESLint on the project source files.
Serves the production build on port 8080.
The command docker build --build-arg API_BASE_URL=http://backend-url:3000 -t mojaloop-payment-manager-ui .
creates a docker image with the name mojaloop-payment-manager-ui
. Exposes the UI on port 8080.
The command docker run --rm -p 8080:8080 mojaloop-payment-manager-ui
runs the docker image binding the port 8080.
The command make build
creates a docker image with the name mojaloop-payment-manager-ui
. Exposes the UI on port 8080.
The command make run
runs the docker image binding the port 8080.
Set the environment variables, before running the server (or Docker image):
CHECK_SESSION_URL
: URL to check if the session is still validLOGIN_URL
: - URL to redirect to when the session is not validLOGIN_PROVIDER
: - The name of the login provider. When specified, the app will redirect to the login provider URL.
These will override the in-app login form and redirect to the provided URL.