Node-red Prelude. Blind inception
Tags: iot, node, javascript, programming
Published: 2023-09-27 20:08:53

## TL;DR
The hidden inception of a big trouble. Skip if you already know about [node-red][nr] or don't wanna read simple things.

It's my debut on the [dev.to][d2] and I wanna tell a story about an IoT on the [node-red][nr]. I discover interesting things overall about it and want to share exp. It's a prelude article, don't worry, the second one will be more exciting.

<img width="100%" style="width:100%" src="https://media.giphy.com/media/KfkuVMlL2SCKaKfKpD/giphy.gif">

These are overall thoughts about the [node-red][nr] like a platform to derive IoT and not even IoT things further.

## Prerequisites
Firstly you must have knowledge of JS and maybe about JS infrastructure. And a little bit with IoT, might not, but why are u there?
... knowledge of the [NodeJS](https://nodejs.org/en)

_JS concerns are like..._

![JS triangle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sz8460tkus6f44gapysc.png)


## What?
The main idea of [node-red][nr] is to allow devs to write some functions to deliver something from the first to the endpoint. It might be something from the IoT world or you can use it as a platform for proceeding data from one to another place. But never mind it's a platform with a certain path, from 1 dot to another. Or you can use it like a tracker or reflector for some events, whatever you want.

## Alternatives
Umm, there are a lot of tools for automating workflow, like [n8n](https://n8n.io/), [noflo](https://noflojs.org/) or [AWS IoT](https://aws.amazon.com/iot/) for IoT targetly. Worth noting [Total JS](https://www.totaljs.com/flow/) like a good alternative for it.

## Add-ons
I worked with flowforge, but now it's called [flowfuse](https://flowfuse.com/) also if you're interested in forks for node-red, pay attention to [fork](https://github.com/telligro/opal-node-red), it's opal fork of node-red

## Why?
It's the simplest way to deliver your code, data, some files, or even creds or secret things to the cloud or on the device. It has a huge infrastructure, not as React :c, but great too.

## Infrastructure
There are a lot of different protocols to work with different types of devices, a couple of packages to work with UI side, yeah, UI side under the workflow app 🙄, a lot of pckgs to work with time, like sun events or cronjobs, integration with most of the databases like MongoDB, FluxDB, MySQL or even Redis, whatever, a lot of packages to work with cycles, countdowns and also it includes simple ways to archive, work with I\O operation (that important with NodeJS) and more, more other things.

A couple of words about `flowfuse`, this one would be used for better managing node-red, like doing snapshots, uploading it on the devices, and more things like this. Also, it includes user management, roles, accessibility, etc.

## Lightweight
It's an absolute lightweight thing, but about the dark side of the Moon we will talk in the next article 😋.

<img width="100%" style="width:100%" src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMDhxcWpzOWYydHlyNzI1bmpubnJoc3pjYXd5YTRnZTZoamN3eXZmZiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/V5t9NlcSBgzvlsNdiH/giphy.gif">

## Conclusions
If you are a dev with no experience with this technology, just try it. If you want to practice with IoT at home, just try it. If you know about the pros and cons, why are u there 🧐, ...just use it.

## Further dive...
The delivery is absolutely incredible, but you just need to know about, hm, at least a couple of concerns to use it in the production way, ...and it will be a theme of the next article.

## Helpful links
[Node-red for production cloud](https://github.com/knolleary/node-red-in-production-workshop)
[Node-red dashboards comparison](https://flowfuse.com/blog/2023/03/comparing-node-red-dashboards/)
[Node-red library(infrastructure)](https://flows.nodered.org/)
[Node-red for home-assistance](https://github.com/hassio-addons/addon-node-red)
[Node-red overall](https://nodered.org/about/)
[Getting started guide](https://www.toptal.com/nodejs/programming-visually-with-node-red)

[nr]: https://nodered.org/
[d2]: https://dev.to/