Skip to content

Instantly share code, notes, and snippets.

@shiddugmail
Last active September 11, 2020 21:57
Show Gist options
  • Save shiddugmail/3cefbcf7e08bcd27da0e4eb4d8849971 to your computer and use it in GitHub Desktop.
Save shiddugmail/3cefbcf7e08bcd27da0e4eb4d8849971 to your computer and use it in GitHub Desktop.
Node-red with Strapi as Backend

I am trying to create suite of IOT with rich UI. Following will be my components in use in future.

  1. S7 node for Siemens PLC
  2. Siemens IOT 2000 series

node-red with strapi for the content.

I am not that good in writing but I will try to improvise in future.

If someone wants to work with me to take this forward to make a good suite and a product.

please let me know.

[
{
"id": "1f4ca0f1.d16a4f",
"type": "tab",
"label": "Flow Strapi Testing",
"disabled": false,
"info": ""
},
{
"id": "5c395217.28520c",
"type": "http request",
"z": "1f4ca0f1.d16a4f",
"name": "",
"method": "POST",
"ret": "obj",
"paytoqs": true,
"url": "http://localhost:1337/auth/local",
"tls": "",
"persist": false,
"proxy": "",
"authType": "basic",
"x": 510,
"y": 120,
"wires": [
[
"286a1c4c.d72a04"
]
]
},
{
"id": "51ac8291.5ee72c",
"type": "inject",
"z": "1f4ca0f1.d16a4f",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 180,
"y": 120,
"wires": [
[
"11a2ef2.b7ff511"
]
]
},
{
"id": "286a1c4c.d72a04",
"type": "debug",
"z": "1f4ca0f1.d16a4f",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 690,
"y": 120,
"wires": []
},
{
"id": "11a2ef2.b7ff511",
"type": "function",
"z": "1f4ca0f1.d16a4f",
"name": "",
"func": "msg = {}\nmsg.payload = {};\nmsg.payload.identifier = 'roopa';\nmsg.payload.password = 'Shiddu@123$';\n\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 340,
"y": 120,
"wires": [
[
"5c395217.28520c"
]
]
},
{
"id": "ed79e588.260d28",
"type": "inject",
"z": "1f4ca0f1.d16a4f",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 181.00000762939453,
"y": 204.0000023841858,
"wires": [
[
"350cdc29.fae954"
]
]
},
{
"id": "cce2d241.35fb9",
"type": "debug",
"z": "1f4ca0f1.d16a4f",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 796.0000076293945,
"y": 204.00000190734863,
"wires": []
},
{
"id": "350cdc29.fae954",
"type": "function",
"z": "1f4ca0f1.d16a4f",
"name": "",
"func": "msg = {};\nmsg.payload = {};\nmsg.method = 'get';\n//msg.payload.id = '1';\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 346.00000762939453,
"y": 204.00000190734863,
"wires": [
[
"c4efadbe.3b5bd"
]
]
},
{
"id": "2ee359ae.eb7316",
"type": "json",
"z": "1f4ca0f1.d16a4f",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 626.0000076293945,
"y": 204.00000190734863,
"wires": [
[
"cce2d241.35fb9",
"406b22ec.f6278c"
]
]
},
{
"id": "c4efadbe.3b5bd",
"type": "strapi",
"z": "1f4ca0f1.d16a4f",
"strapiAPIURL": "http://localhost:1337/categories",
"jwtToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwiaWF0IjoxNTk5NzMwNzM1LCJleHAiOjE2MDIzMjI3MzV9.SwpP80elGgmTvZMW_4AiayThBhj5CPg4y12e1kG_1EE",
"x": 496.00000762939453,
"y": 204.00000190734863,
"wires": [
[
"2ee359ae.eb7316"
]
]
},
{
"id": "406b22ec.f6278c",
"type": "ui_table",
"z": "1f4ca0f1.d16a4f",
"group": "c48223a2.c25e3",
"name": "",
"order": 0,
"width": "12",
"height": "8",
"columns": [
{
"field": "id",
"title": "ID",
"width": "",
"align": "right",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "name",
"title": "Category Name",
"width": "",
"align": "center",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
}
],
"outputs": 0,
"cts": false,
"x": 775.6666717529297,
"y": 271.7777805328369,
"wires": []
},
{
"id": "7bfb6f53.10615",
"type": "ui_text_input",
"z": "1f4ca0f1.d16a4f",
"name": "",
"label": "Category Name",
"tooltip": "",
"group": "c48223a2.c25e3",
"order": 1,
"width": "6",
"height": "1",
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "",
"x": 354,
"y": 384.00000286102295,
"wires": [
[
"85a32226.3b63f"
]
]
},
{
"id": "1a2edc82.277c43",
"type": "inject",
"z": "1f4ca0f1.d16a4f",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 178,
"y": 383.00000381469727,
"wires": [
[
"7bfb6f53.10615"
]
]
},
{
"id": "9a85db44.221ce8",
"type": "strapi",
"z": "1f4ca0f1.d16a4f",
"strapiAPIURL": "http://localhost:1337/categories",
"jwtToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwiaWF0IjoxNTk5NzMwNzM1LCJleHAiOjE2MDIzMjI3MzV9.SwpP80elGgmTvZMW_4AiayThBhj5CPg4y12e1kG_1EE",
"x": 657.0000038146973,
"y": 384.00000381469727,
"wires": [
[
"9dc8082a.9a5fd8"
]
]
},
{
"id": "85a32226.3b63f",
"type": "function",
"z": "1f4ca0f1.d16a4f",
"name": "",
"func": "var namein = msg.payload;\nnamein = \"TV\";\nmsg = {};\nmsg.payload = {};\nmsg.method = 'post';\nmsg.payload.name = namein;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 523.0000038146973,
"y": 384.00000381469727,
"wires": [
[
"9a85db44.221ce8"
]
]
},
{
"id": "9dc8082a.9a5fd8",
"type": "debug",
"z": "1f4ca0f1.d16a4f",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 823.0000076293945,
"y": 384.00000381469727,
"wires": []
},
{
"id": "30b8f372.db4e0c",
"type": "catch",
"z": "1f4ca0f1.d16a4f",
"name": "",
"scope": null,
"uncaught": true,
"x": 351,
"y": 461.5555591583252,
"wires": [
[
"a40db5ec.f633d8"
]
]
},
{
"id": "a40db5ec.f633d8",
"type": "debug",
"z": "1f4ca0f1.d16a4f",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 521.0000038146973,
"y": 461.00000381469727,
"wires": []
},
{
"id": "c48223a2.c25e3",
"type": "ui_group",
"z": "",
"name": "Categories",
"tab": "81159780.b90b88",
"order": 1,
"disp": true,
"width": "12",
"collapse": false
},
{
"id": "81159780.b90b88",
"type": "ui_tab",
"z": "",
"name": "Categories",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment