This package contains the source code of React web application. The web application has to be instantiated by your own configuration like information page markdown file. The data consumed by the app is preprocessed by action package so no need for a backend and can be easily published on services like Github Packages.
The look and feel of this web application mainly relies on the Ant Design React library, which provides a set of high quality components for building rich, interactive user interfaces.
If you want to build or contribute to this project you will probably need to build/run this web application locally, here few steps to follow:
- Clone the repository
$ git clone [email protected]:kiegroup/chain-status.git
- Install all libraries [run it in the project's root]
$ yarn
- Run the application in development mode [run it in the
webpage
package]
$ yarn run
Open http://localhost:3000 to view it in the browser.
Keep in mind that the page will reload if you make edits on the source code.
- Build the whole project [run it on the project's root]
$ yarn build
If you want to install this web application on your repository in an automated way, this project comes with an easy to use Github action that you can use on your Github workflows.
The generate-app action is in charge to checkout this project, build it using yarn
and publish it on a specific branch of the repository is including it.
Here the main important steps performed by generate-app action:
- Checkout in the branch where you want to store the webpage code and content, the default is
gh-pages
. [the first time you run this action there will be no webpage] - Checkout in the original chain-status repository, i.e., this one.
- Setup nodejs and build the webpage using
yarn
. - Check if in the target branch (e.g.,
gh-pages
) there are old content/configuration files by checking thedata/
folder. If there exists, it copies its content under the newly compiled webpage (under./packages/webpage/public/
). - Deploy the created page using gh-pages tool in the target branch (e.g.,
gh-pages
).
Field | Required | Default | Description |
---|---|---|---|
github-token | true | The Github token that must be used to interact with Github API | |
info-md-url | true | The url pointing to a Markdown file used to populate info section | |
gh-pages-branch | false | gh-pages | The branch used by gh-pages tool, where the webpage will be stored |
-
I use redux to handle states. sectionsShow specifically https://github.com/kiegroup/chain-status/blob/main/packages/webpage/src/service/layout.service.tsx#L43
-
Then section is only shown based on the state
-
and then the section is registered on redux machinery based on the callback from
whenever the section is shown based on an observer with some extra margins