** UNDER CONSTRUCTION **
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.
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.
- IBM Cloud account
- basic Node-RED & Docker knowledge
The backend app receives https requests, performs some actions and returns the result.
- on the IBM Cloud install Node-RED, create a Cloudant service and bind the Cloudant service to the Node-RED app, see A SHORT INTRODUCTION OF THE NODE-RED STARTER KIT ON IBM CLOUD FOR HACKATHONS
- import the Node-RED flow
- deploy the flow
- Create doc
- Get all docs
- Get/read doc
- Update doc
- Delete doc
The backend app could also integrate with external systems or perform some data processing, but this is not implemented yet.
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.
Use the Postman collection to test the backend. Then go ahead and install the simple forwarding server.