Embedding Node-RED into Applications Part 2 (Installing per Folder)
Introduction
In this post, I experimented with installing and isolating Node-RED environments into separate folders. In a previous article, I tried combining Node-RED with Electron. Essentially, since it was just being launched via Express, it seemed possible to separate the environments by folder. As development progresses, flow scales tend to grow, so I wanted to make it possible to install Node-RED as a dedicated folder for each project.
▼Here is the article where I combined it with Electron. I am still using and improving it as a desktop-like application.
▼Previous articles:
Creating the GitHub Repository
When Node-RED is installed globally via npm as per the documentation, it can be launched from anywhere, but packages are added to a fixed location. In my case, I wanted to verify the operation of custom-developed nodes without breaking other environments, so I opted for a local installation instead of a global one. I’ve simplified this process. On a PC with Node.js installed, this allows for a fresh Node-RED installation in every folder. I have uploaded the minimum files required to start Node-RED to a GitHub repository, so it can be used immediately after cloning.
▼Here is the GitHub repository I created:
https://github.com/404background/Hive-RED
▼I included the following conceptual diagram in the README:

After cloning the repository, you install the necessary packages and start Node-RED. Since running multiple Node-RED instances can lead to port conflicts, I made the port configurable.
Starting Node-RED
I actually cloned the repository, installed the required packages, and started it up.
git clone https://github.com/404background/Hive-RED
cd Hive-RED
npm install
npm start▼It started without any issues.

By accessing http://localhost:8000/red, you can reach the Node-RED editor screen.
▼Access confirmed!

It is also possible to change the port number using an argument with the npm start command.
▼I successfully started it on port 9000 and accessed it.

Additionally, I prepared a function to reset the Node-RED environment for development purposes. Running the following command will perform the reset:
npm run resetWhen developing nodes or plugins, the environment can sometimes break and fail to start. I use this reset command for such occasions.
Finally
Using this repository, I have recently been managing and developing different Node-RED projects separately. I plan to continue improving this workflow as I use it.
▼In my case, I use Node-RED in combination with Unreal Engine 5 (UE5). Since Node-RED cannot be directly embedded into UE5, I run it separately using Node.js.


