Use a low-code programming approach to create event-driven applications from scratch by wiring together hardware devices, APIs, and online services
▶Book Description
Node-RED is a free and open source flow-based programming tool used to handle IoT data that allows programmers of any level to interconnect physical I/O, cloud-based systems, databases, and APIs to build web applications without code.
Practical Node-RED Programming is a comprehensive introduction for anyone looking to get up to speed with the Node-RED ecosystem in no time. Complete with hands-on tutorials, projects, and self-assessment questions, this easy-to-follow guide will help you to become well versed in the foundations of Node-RED. You'll learn how to use Node-RED to handle IoT data and build web applications without having to write complex code. Once you've covered the basics, you'll explore various visual programming techniques and find out how to make sample flows as you cover web development, IoT development, and cloud service connections, and finally build useful real-world applications.
By the end of this book, you'll have learned how to use Node-RED to develop a real-world application from scratch, which can then be implemented in your business.
▶What You Will Learn
-Understand the history of Node-RED and why you need to learn a flow-based programming tool
-Use Node-RED to build Node.js-based applications
-Handle data for IoT devices using Node-RED flows
-Explore advanced Node-RED features such as connecting repositories and customizing the flow editor
-Find out what the MQTT protocol is and how it relates to Node-RED
-Create and publish your own nodes and flows using the Node-RED library
▶Key Features
-Discover how you can automate the Internet of Things (IoT) without writing huge blocks of code
-Learn how to wire together flows using a browser-based visual editor
-Handle IoT data with little to no coding knowledge
▶Who This Book Is For
This Node-RED book is for web developers and IoT engineers with some background in JavaScript and Node.js. Although not necessary, familiarity with the concepts of electronics will help you to make the most out of this book.
▶What this book covers
- Chapter 1, Introducing Node-RED and Flow-Based Programming, teaches us what Node- RED is. The content also touches on flow-based programming, explaining why Node-RED was developed and what it is used for. Understanding this new tool, Node-RED, is helpful to improve our programming experience.
- Chapter 2, Setting Up the Development Environment, covers setting up the development environment by installing Node-RED. Node-RED can be installed for any OS Node.js can run, such as Windows, macOS, Rasberry Pi OS, and so on. We install Node-RED on each environment with the command line or using the installer. This chapter covers important notes for specific OSes.
- Chapter 3, Understanding Node-RED Characteristics by Creating Basic Flows, teaches us about the basic usage of Node-RED. In Node-RED, various functions are used with parts called nodes. In Node-RED, we create an application with a concept called a flow, like a workflow. We will create a sample flow by combining basic nodes.
- Chapter 4, Learning the Major Nodes, teaches us how to utilize more nodes. We will not only learn about the nodes provided by Node-RED by default but also how to acquire various nodes published on the internet by the community and how to use them.
- Chapter 5, Implementing Node-RED Locally, teaches us best practices for leveraging Node-RED in our local environment, our desktop environment. Since Node-RED is a tool based on Node.js, it is good at building server-side applications. However, servers aren't just on beyond the network. It is possible to use it more conveniently by using Node-RED in a virtual runtime on the local environment of an edge device such as Raspberry Pi.
- Chapter 6, Implementing Node-RED in the Cloud, teaches us best practices for leveraging Node-RED on a cloud platform. Since Node-RED is a tool based on Node.js, it is good at building server-side applications. It is possible to use it more conveniently by using Node- RED on any cloud platform, so we will make flows with Node-RED on IBM Cloud as one of the use cases with cloud platforms.
- Chapter 7, Calling a Web API from Node-RED, teaches us how to utilize the web API from Node-RED. In order to maximize the appeal of web applications, it is essential to link with various web APIs. Its application development architecture is no exception in Node-RED. Understanding the difference between calling a web API from a regular Node.js application and calling it from Node-RED can help us get the most out of Node-RED.
- Chapter 8, Using the Project Feature with Git, teaches us how to use source code version control tools in Node-RED. With Node-RED, the project function is available in version 1.x and later. The project function can be linked with each source code version control tool based on Git. By versioning the flows with the repository, our development will be accelerated.
- Chapter 9, Creating a ToDo Application with Node-RED, teaches us how to develop standard web applications with Node-RED. The web application here is a simple ToDo application. The architecture of the entire application is very simple and will help us understand how to develop a web application, including the user interface, using Node-RED.
- Chapter 10, Handling Sensor Data on the Raspberry Pi, teaches us application development methods for IoT data processing using Node-RED. Node-RED was originally developed to handle IoT data. Therefore, many of the use cases where Node-RED is still used today are IoT data processing. Node-RED passes the data acquired from sensors for each process we want to do and publishes it.
- Chapter 11, Visualize Data by Creating a Server-Side Application in the IBM Cloud, teaches us about application development methods for IoT data processing using Node-RED on the cloud platform side. We usually use the data from edge devices on any cloud platform for analyzing, visualization, and so on. Node-RED handles the data subscribed from the MQTT broker and visualizes it for any purpose.
- Chapter 12, Developing a Chatbot Application Using Slack and IBM Watson, teaches us how to create a chatbot application. At first glance, Node-RED and chatbots don't seem to be related, but many chatbot applications use Node-RED behind the scenes. The reason is that Node-RED can perform server-side processing on a data-by-data basis like a workflow. Here, we create a chatbot that runs on Slack, which is used worldwide.
- Chapter 13, Creating and Publishing Your Own Node on the Node-RED Library, teaches us how to develop nodes ourselves. For many use cases, we can find the node for the processing we need from the Node-RED Library. This is because many nodes are exposed on the internet thanks to the contributions of many developers. Let's aid a large number of other Node-RED users by developing our own node and publishing it to the Node-RED Library.