-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add design note for standalone Node-RED #30
base: master
Are you sure you want to change the base?
Changes from 1 commit
d00ca51
2619a51
6b11bbc
2119178
eed07fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
state: draft | ||
--- | ||
|
||
# Standalone Node-RED | ||
|
||
## Summary | ||
|
||
The standalone Node-RED is a desktop version of Node-RED which includes Node-RED, Node.js, nodes, and browser engine using Chromium. | ||
|
||
## Authors | ||
|
||
- @kazuhitoyokoi | ||
|
||
## Use Cases | ||
|
||
- Easy installation | ||
|
||
With the Node-RED installer, it will be easy for users to set up the Node-RED environment. | ||
Especially, the targets are users who have no CLI skills to install Node-RED using commands like `npm install`. | ||
|
||
- Offline installation | ||
|
||
It is suitable for offline use cases because it contains all necessary components to execute Node-RED. | ||
|
||
- Integrated Development Environment (IDE) | ||
|
||
The standalone Node-RED behaves as IDE application like VS Code or Eclipse. | ||
Therefore, users may want to switch multiple projects for various environments on their single computer. | ||
Additionally, they need git functionality as default to proceed with team development or backup their flows. | ||
|
||
## Details | ||
|
||
### Flow editor window | ||
The window is used for the Node-RED flow editor. After executing the standalone Node-RED, the window will be opened automatically. | ||
|
||
- Dialog when closing window | ||
|
||
When closing the window without saving the flow, the window show dialog to select "save & exit" or "cancel". | ||
It is implemented using electron dialog or Node-RED notify UI. | ||
|
||
- Debug window, event log window | ||
|
||
To check the debug tab and event log in another window, users can open these UIs in a single window. | ||
(To realize this functionality, The event log UI in Node-RED core requires ”Open in new window” button which is same as debug tab) | ||
|
||
### Runtime | ||
The Node-RED runtime will be executed when the standard Node-RED starts. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it always try to run a flow ? last opened flow ? Or should it always start in "safe mode" - as this is now more of an IDE model. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely. "safe mode" is natural in an IDE model. I added the text about it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I agree. It really depends how far down the IDE model you want to go. A full IDE like model would let you open up multiple different flow files, save them separately, run more than one... is that the type of model we want? Until we've set out the basic scope of the IDE, then we simply cannot start discussing individual details about the implementation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @knolleary Thank you for your comments. I added the scope of the standalone Node-RED. Could you review it? |
||
|
||
- Admin API | ||
|
||
The URL to connect between window and runtime uses a random path and fixed port number because the flow editor needs to be prohibited from other users and allow access REST API endpoints using http-in nodes which require the fixed port number. The following URL is an example of the admin API which window accesses. | ||
|
||
http://localhost:1880/< random path > | ||
|
||
- settings.js file | ||
|
||
The standalone Node-RED has the default `settings.js` file. When there is no `settings.js` file under `~/.node-red/` directory, the standalone Node-RED saves the default `settings.js` file to load the custom settings in the following table. | ||
|
||
| key | value | | ||
| ---------------------------- | ----- | | ||
| editorTheme.projects.enabled | true | | ||
|
||
If `~./node-red/` directory already has `settings.js` file which was created by common Node-RED, the standalone Node-RED uses it without overwriting the file to avoid changing the current environment. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it even use the ~/.node-red directory if it is self contained ? If someone already has Node-RED installed should this interact with it or not ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As you wrote, I think that there is no need to interact with the normal Node-RED environment. I changed it to |
||
|
||
### Logging | ||
Users can see log data in real-time on the event log window. On the other hand, users can also see historical log data from log files. | ||
If the `electron-log` module is used to implement logging functionality, the following paths are default file paths to store log data. | ||
|
||
- Windows: C:\Users\\< User name >\AppData\Roaming\node-red\logs\file.log | ||
- macOS: ~/Library/Logs/node-red/file.log | ||
- Linux: ~/.config/node-red/logs/file.log | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not use system log files so linux can autoclean them up ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The auto clean by OS will be useful. I changed the file path to |
||
|
||
### Building binaries | ||
`npm run build` command builds binaries for the following OS environments. | ||
|
||
- Windows (msi) | ||
- macOS (dmg) | ||
- Linux (tar.gz) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. electron-builder can build deb and rpm There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, electron-builder can build various types of binaries. To reduce our tasks to check all binaries in every release, I wrote three major binaries. I would like to suggest documentation about how to build other binaries like deb and rpm. |
||
|
||
## History | ||
|
||
- 2019-05-19 - Initial proposal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so would this also install git ? Or is git a prereq ? Or should it autodetect and not enable projects etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If installer support to install git command, we need to add different handlings for Windows, macOS, Linux environments. Therefore, I think that prereq and auto-detection are suitable for the project feature on the standalone Node-RED.