Skip to content

gitjps/Node-RED-Backend-and-Frontend

Repository files navigation

** UNDER CONSTRUCTION **

Motivation

Node-RED based applications are often used in hackathons and prototypes and I thought it would be nice to have a starter kit, consisting of a simple backend and a database to

  • store, retrieve and change data, and
  • integrate with other systems.

Overview

This solution consists of

  • a database (in this case a Cloudant database, could be a different as well)
  • a backend app (business logic, interfaces to external systems, CRUD requests to a Cloudant database).

For testing and demonstration purposes it als has

  • a simple Node-RED frontend to invoke the CRUD requests, and
  • a simple forwarding server.

Architecture

Prequisites

  • IBM Cloud account
  • basic Node-RED & Docker knowledge

Backend app

The backend app receives https requests, performs some actions and returns the result.

Installation

Endpoints

  • Create doc
  • Get all docs
  • Get/read doc
  • Update doc
  • Delete doc

Node-RED flow

The backend app could also integrate with external systems or perform some data processing, but this is not implemented yet.

How it works

The API key is set when the flow starts (initialization node). When a request is received (e.g. Create doc), the header parameter apikey is checked first. If it is not correct, a 401 error is thrown. Otherwise the requested CRUD action is performed.

A REST calls in Node-RED flows cannot be invoked directly from a web application, a simple forward server is needed. Once it is implemented you can use the simple Node-RED or any other web frontend.

Next steps

Use the Postman collection to test the backend. Then go ahead and install the simple forwarding server.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published