Weblets is a front-end application that helps with deploying solutions on TF Grid v3. A weblet is a compiled javascript web component which can be embedded in HTML page of a web app. The backend for the weblets is introduced with grid client which communicate to TF Chain and TF Grid over RMB.
Weblets is a svelte project for creating web components - which are reusable custom elements with their functionality encapsulated away from the rest of the code — that interact with TF Grid 3 and could be utilized from other web apps. It solves such problem where you had to write complex HTML (and associated style and script) to render custom UI controls (eg, to deploy some workload on the TF Grid 3), and how using them multiple times in different projects can be a miss if you are not careful.
-
Prerequisite
- Nodejs 16^
- yarn
- libtool
For troubleshooting please checkout this file troubleshooting
-
Clone the repository
git clone https://github.com/threefoldtech/grid_weblets.git
For detailed information you can read the Getting Started documentation.
Before running the Weblets, in your terminal move to the project directory, then install the required dependencies using yarn deps
, it runs install_deps.sh, that will handle the installation of Weblets and playground dependencies
cd grid_weblets
yarn deps
- Run Weblets in Development mode
yarn serve:app
- Run Weblets in Production mode
yarn build:app
This will generate the production build in the dist
directory, which can be served using Caddy or NGINX
You can run the playground in different modes. by editing the config file in playground/public/config.js
For an automated generation of the config file you can use the script build-env
in scripts/
it will generate the config file based on your env-vars.
cd playground/public
bash ../../scripts/build-env.sh
More illustration on the build-env script here
The main testing tool that is used in Weblets is Cypress.