Recommended Workflow
For an optimized and efficient development experience, we recommend adopting the following workflow for creating plugins for the Re:Earth Visualizer. This approach utilizes a plugin template designed with:
- React as the front-end framework.
- ShadCN, integrated with Tailwind CSS, as the UI solution.
This workflow, rather than following the standard plugin installation process, enables the Re:Earth Visualizer to dynamically retrieve the plugin directly from the preview server. This approach significantly streamlines the development cycle by allowing faster and more efficient plugin testing and iteration.
Create New Plugin using Template
For now we recommend using this Re:Earth Visualizer Plugin ShadCN Template.
You could create your own plugin project following these steps:
-
Navigate to the plugin directory and explore the structure of the template repository.
-
Install dependencies:
-
Build plugin once for initialize the reqired files:
-
Start devlepment & preview server:
Develop plugin together with Visualizer
Before start please follow this guide to set up your visualizer application in local environment.
Setup Re:Earth Visualizer to enable DEV_PLUGIN
-
Navigate to the
web
directory of your localRe:Earth Visualizer
project. -
Add the following environment variables to the
.env
file:Web server will auto restart after .env file changes.
Create Re:Earth Visualizer Project
In order to develop a plugin, you need to create a new project on the Re:Earth Visualizer so that you can add your plugin widget to the scene and see the changes.
-
Visit your local Re:Earth Visualizer at
http://localhost:3000
. -
Create a new project on Dashboard.
-
Double-click the project to enter it.
-
Click the
Install Dev Plugins
button (on the right end of header) to install your local plugin. -
Go to
Widgets
tab and add your plugin widget into the scene.
Done! Let’s start developing!
Now you can develop your plugin together with the Re:Earth Visualizer.
The plugin will be auto-built when you save the code, and the changes will be reflected in the Re:Earth Visualizer after you click the Reload Dev Plugin Extensions
button.
Dev Plugin Buttons
- This tool fetches plugin files directly from the preview server, automatically zips them, and facilitates their installation.
- When to Use: Click this button when initially setting up your development environment or after any modifications to
reearth.yml
.
- This tool rapidly reloads all plugin extensions from the preview server.
- Advantage: Reloading only the plugin itself, not the entire page, significantly accelerates the development cycle.