2ndtlmining / Fluxnode

Fluxnode Website
https://fluxnode.app.runonflux.io/
5 stars 6 forks source link

Fluxnode Website

Frontend website

Application Overview

The website allows users to display their node information to get a more collective view of the status of their various nodes. The website consist out of two pages

Main Features

Below are some of the key features to the website:

Development and Building

Tools

Make sure to have the following stuff installed on your machine.

Verify the installation with these commands:

Starting the app

The client/ folder contains all the code for frontend app made with React.

Starting the server

The api/ folder contains a server (written in Rust) that acts as a thin wrapper/proxy in front of the official flux node API.

Using the server

In dev mode, the frontend client is configured to not use the API wrapper and instead directly use the official APIs.

To make it use the server in dev mode too, first start the server in another terminal using above steps. Then add the following lines in <REPO_ROOT>/client/.env.development.local (create the file if it doesn't exist).

REACT_APP_FLUXNODE_INFO_API_MODE="proxy"
REACT_APP_FLUXNODE_INFO_API_URL="http://localhost:5049"
REACT_APP_ENABLE_FLUX_NODE_API=false
REACT_APP_SEARCH_BY_ZELID=false

Replace value of REACT_APP_FLUXNODE_INFO_API_URL with the actual url of the API server.

Now you can start the frontend app as usual in a separate terminal. Also make sure the server keeps running.

To revert the change and use the official APIs in dev mode, set the value of REACT_APP_FLUXNODE_INFO_API_MODE back to debug.

Deployment Steps (using Docker)

docker login

docker tag <REPOSITORY> <USERNAME>/<REPOSITORY>:<TAG>

docker push <USERNAME>/<REPOSITORY>


While running the container, map exposed port 80 of the container to your desired port on host machine. For example.

docker run --rm --name="flux-node-web" -it -p 9000:80 <USERNAME>/<REPOSITORY>:<TAG>

The app would then be available on http://localhost:9000