webui

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

Bacalhau WebUI

This project was bootstrapped with Create React App. To help develop the WebUI we have built to interact with the Bacalhau network follow the directions below:

Getting Started

First, install dependencies:

yarn install

Next, run the development server. The page will reload if you make edits:

yarn start

Before committing new code, you will need to lint it by running:

yarn run lint

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

yarn run build

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.

yarn run eject

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.

Spinning up the Dashboard for Development:

For spinning up & testing the dashboard with the API connection to the bacalhau network you can run:

cd webui

yarn run build

cd..

make build

./bin/$(go env GOOS)/$(go env GOARCH)/bacalhau serve --node-type=requester,compute --peer=none --web-ui

The above will spin up your own bacalhau cluster. This will use the default port 1234. Visit http://127.0.0.1/ to see WebUI.

Interaction with Bacalhau

In bacalhau.ts you will find Bacalhau API configuration.

webui.go serves as a web server to deliver the webui (React code), handling both the serving of static assets embedded in the binary and dynamic routing for client-side navigation.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexPage

func IndexPage(host, port, base string) ([]byte, error)

Return the index page for the web app with the passed API URL used. The app running on each client will attempt to connect to the API URL to retrieve job and node information.

func ListenAndServe

func ListenAndServe(ctx context.Context, host, apiPort, apiPath string, listenPort int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL