Integration to IoT, often require pulling together different APIs, online services and hardware devices in new and interesting ways. Time spent figuring out how to access a Serial port, or to complete an OAuth flow against Twitter is not time spent on creating the real value of a solution. We need tools that make it easier for developers at all levels to create applications and allow them to focus on what is important. https://ibm.biz/NRWorkshop
browser and allows you to create applications by drawing flows of events. Each node in a flow represents a well-defined piece of functionality, such as updating a value, making a database query or sending a tweet. The developer configures each node as required, focused on what it does, not how it does it. When the flow is deployed to the Node-RED runtime, each node becomes a running piece of code and messages start passing through the flow. “Flow-based programming for event-driven applications” https://ibm.biz/NRWorkshop
Node-RED. The Runtime is a node.js application. It is responsible for running the deployed flows. The Editor is a web application where the user can edit their flows. The main installable package includes both components, with a web-server to provide the Editor as well as a REST Admin API for administering the runtime. Internally, these components can be installed separately and embedded into existing Node.js applications. node-red runtime editor HTTP Admin API @node-red/editor-api Client-side Editor @node-red/editor-client Flow Runtime @node-red/runtime Core Nodes @node-red/nodes Node Registry @node-red/registry Common Utils @node-red/util https://ibm.biz/NRWorkshop
nodes that are wired together. A node can have multiple output ports and a single port can have multiple wires connected to it. The flow is stored as a JSON object – providing the configuration for all of its nodes and how they are connected. The flow JSON can be imported and exported between Node-RED instances, making it easy to share flows. https://ibm.biz/NRWorkshop
flow are JavaScript Objects. By convention they will have a payload property that contains the ‘interesting’ information. This is the property most nodes will operate on by default. topic: “weather/uk” payload: “sunny!” … … https://ibm.biz/NRWorkshop
of a flow. Nodes that sit at the start of a flow will be waiting for some external event to occur, such as an incoming HTTP request, a timer event or a hardware IO event. They then pass messages onto the nodes they are connected to. Nodes receive those messages, do some work, and then pass them on down the flow. payload: “Jedi are totally amazing!” payload: “Jedi are totally amazing!” sentiment: { score: 4 } In this example, a Sentiment analysis node has examined the ’payload’ property of the message, assessed its sentiment and added its result as a new property of the message. https://ibm.biz/NRWorkshop
Node-RED can be extended by the community. They consist of two parts: - A node.js module that defines the runtime behavior of the node. - An HTML file that provides its appearance, edit dialog and help text for the Editor These are packaged as a Node.js module and distributed via the NPM package repository. The project hosts https://flows.nodered.org that automatically indexes the available Node-RED modules on npm https://ibm.biz/NRWorkshop
Part 5 Getting Started with Node-RED Setting up your Cloud environment Deploy you application to the Cloud Connect your app to a cloud-hosted db Setup a deployment pipeline to Cloud
Create a cloud-hosted Cloudant instance and configure the application to use it with separate development and production databases https://ibm.biz/NRWorkshop
Create a deployment pipeline use TravisCI to automatically deploy your application when pushing updates to a GitHub repository https://ibm.biz/NRWorkshop