This repository adds a number of new nodes to Node-RED, allowing the creation of Haskell-based stream processing programs, utilising the StrIoT project, which is a Haskell-based pure functional stream processing system.
These nodes do not run within Node-RED, and instead Node-RED is simply used as a UI to build your stream-processing graphs. Once you have created your graph, you can use Node-RED to export it as a JSON file, which can then be use by the StrIoT GUI tool to generate the stream processing program.
Features:
- Adds a set of nodes to Node-RED enabling Haskell-based stream processing.
- Fully documented nodes with explanations for how to use them and example code.
- Easy export for use with the StrIoT GUI tool.
The nodes use user-defined Haskell code to manipulate data streams, which allows for flexible and powerful stream processing applications to be developed. See the Nodes Added section below for more information on the nodes which this repository adds to Node-RED.
- Node.js
- Node-RED
- Node-RED must have been run at least once using the
node-red
command in the terminal
Recommended:
- StrIoT GUI tool - generates a stream processing application from the Node-RED export using these nodes
This package is not currently published on NPM or other package managers, so simply git clone this repository onto your system:
$ git clone https://github.com/JonnySpruce/striot-nodes.git
Then in your Node-RED directory, simply install the nodes by running:
npm i /path/to/cloned/repository
Start Node-RED from the terminal with the command node-red
, and there will be a new section of nodes labelled StrIoT, where you will find all supported nodes for the StrIoT system.
Simply drag and drop the nodes onto the canvas, and double click on a node to edit its properties and add code etc.
There are also example flows in the examples directory, which you can import into Node-RED to see how the flow is structured and the code is written. The files output by the StrIoT GUI tool are also included for each example, and can be run using the docker-compose up
command in the directory of the example you want to run (Note: Docker must be installed).
From the Node-RED window, click the menu button in the top right corner, then Export, to view the export screen. Select the options you wish to use and then click Download to download the exported stream processing graph. You can then pass this JSON file to the StrIoT GUI program, which will automatically generate your program based on your Node-RED flow.
Name | Description |
---|---|
Filter | Filters streams based on a user-defined function. |
Generic Input | Allows any user-defined function to be used as an input to the stream. |
Sink | Allows any user-defined function to be used as an ouput to the stream. |
Map | Maps values in the stream based on a user-defined function. |
Generation Options | Allows definition of the generation options, including imports, packages, presource code and optimisation settings. |
All contributions are welcome! Any work on the issues raised in the issue tracker is always greatly appreciated. Alternatively, if you have a feature that you would like to add or a bug that you'd like to fix which isn't mentioned in the issue tracker, feel free to create a new issue to discuss it.
For any pull request which adds new code, tests should also be included. All tests must pass before code can be merged.
If you're having an issue with the tool or have a feature request to add, please feel free to raise an issue in the issue tracker.