I have created a chatbot using Telegram nodes option and it works fine with my home pc(aws server),I will also share its code in future when I get sometime for sure.
Problem here is Telegram is a social site and is NOT allowed in most of the organizations, so I decided I will create my own simple screen for getting input from user and showing output to user. I read link https://nodered.org/docs/creating-nodes/first-node but not understanding it completely(apologies for it), how could I create one and embed it with my existing project?
Any guidance will be appreciated, I need not to be given full code; because I want to code myself,if experts could give guidance from where to start and whatever topics could be covered, will be really grateful.
When you say “a screen to collect information from users”, can you explain how these users communicate/interact with it? You wrote about your current situation with Telegram, a platform I’m familiar with. For example, a Telegram bot can be controlled through a client that is the existing app on desktop and mobile platforms. How would your screen ask for this information, and most of all, where/how would you ask that? For example, a dedicated app of your own, a webpage, a form on the standard node-red-dashboard, et cetera.
The answer to that question would bring the first step to designing and creating your node, as it would interact with that screen. But without knowing where it lives or how it interacts, I could only offer very basic suggestions that would match most of what you read on the link you provided.
Perhaps worth noting here that you probably should be accessing Telegram on your own phone when on your organisations or a customers site since you are interfacing with your home system. As such, simply turn off the Wi-Fi or run a VPN client on your phone and it will work anyway.
As you will be aware, to do something another way (a perfectly fine test of your own skills by the way, not criticising). You will either need to run a server outside your home or you will need to make changes to your firewall to allow you connect to a web page in your home network or you will need to write something that pushes data out from your home network to somewhere reachable.
Each of these brings their own complexities and security issues.
When you say “a screen to collect information from users”, can you explain how these users communicate/interact with it?
I apologies if I am not clear in this one, what I meant is to create a simple UI which users will access from a link(url). Like we get usual chatbot screens in modern days. But I will try to write a simple UI in JS.
How would your screen ask for this information, and most of all, where/how would you ask that?
User hits the link(url) and then in screen user types the option(eg--> help) then BOT should act accordingly.
Now my question is: I could try to create screen in JS but, how could I make node and integrate with it,any tutorial will help on that one will be my first step towards learning.
I appreciate your help and guidance here, will be grateful if experts could guide here more.
Hi Ravinder,
Would the ui_form widget node that is part of the existing node-red-dashboard be able to do what you need? https://flows.nodered.org/node/node-red-dashboard
Another alternative found in an already existing node is to utilise uibuilder, which brings capabilities to node-red to build any UI through html/css/JavaScript in node-red that you might possibly want, and add it on a custom url endpoint to your node-red installation. https://flows.nodered.org/node/node-red-contrib-uibuilder
It is made by @TotallyInformation, whose last paragraph in the above post in this topic is worth an extra read-over. If your locally exposing your page/form/screen to others you’re good, but if they need access to it remotely, make sure your install is secure. This page in the docs is a good place to get started. https://nodered.org/docs/user-guide/runtime/securing-node-red
Once an insecure install of node-red is exposed to the internet, it’s usually a matter of minutes or hours before it is utilised by hackers for everything from infecting it for nefarious purposes of their own use or setting it up as bitcoin miner for example.