NodeJS and socket.io ( Just Wondering )

Too smart for my brain, I will have to trust whatever you guys choose, lol

If you have different apps like a chat page and some notifications, I would put them in separate namespaces. The chat app could have rooms, like a public general room and private rooms. Rooms you can join and leave. You could build something like slack or discord.

1 Like

I really wonder how you will plan a visual interface. it would actually make sense to have a preview and get feedback from users.

We were thinking a bit like with the flows, you have endpoints listening to specific messages that trigger then a specific flow. So a bit like server connect but then with live data connection and two direction communication. On client and server you then have methods to send messages with data and on the other site you react to them using something like our flows.

1 Like

That makes sense.

I am assuming that those endpoints, data and messages will be exposed somehow in case we need to integrate them with other libraries or custom code. Same as with everything in Wappler.

It would be like with the routes, it will auto generate the listeners to listen to a specific message in some specific namespace and execute a flow when it receives the a message.

Here a sample, it is just an idea, there is no implementation at this moment. We would have some json that defines the endpoints like:

{
  "/chat": {
    "message": "incoming_message",
    "join": "join_room",
    "leave": "leave_room"
  }
}

This would generate code like:

io.of('/chat').on('connection', (socket) => {
  socket.on('message', runFlow('incoming_message'));
  socket.on('join', runFlow('join_room'));
  socket.on('leave', runFlow('leave_room'));
});

The flows are like you already know them in Wappler, they will have extra actions to emit messages, join/leave rooms etc.

On the client-side it would be the same, probably some app connect component that will be used to listen to messages and you then trigger flows to do something with the message and data you receive. We still have nothing created for this, so any input is welcome.

You can also write your own JavaScript code, but then you will be missing the integration with Wappler and with App/Server Connect.

3 Likes

Hello @patrick
I don’t want to write my own javascript code. It is better and understandable for me to be fully integrated with wappler. Of course, specific codes can be added. But it is not necessary for now.
Is there more time for real-time data and socketio integration?

1 Like

@patrick checking in on this and the progress to integrate socket.io into Wappler. Any ideas around timeframes?

2 Likes

The first few updates will mainly focus on bug fixes, stability and perhaps some small new features. After that we will have a look on which new features we will include and socket.io is one of them, but can’t say any timeframe at this moment.

4 Likes

Ok, thank you!

I would be interested in using the real time data update for an auction platform. example user a bids it updates certain fields, also with the bid user b page would update with the new bid price. Another sample would be when a new bid comes in there would be a sound to alert the user of the need bid and maybe even have that auction item flash as well.

2 Likes

Also very interested in this feature for fintech native app.

Waiting for this feature also.

2 Likes

Currently developing a virtual auction a need this

3 Likes

Hi, yeah, I hope the Wappler team can have this feature ready soon. Since Wappler introduced node.js into my life, I can’t stop thinking about all the things i’ll do in the near future. I’ve been playing around with Node a bit, but socket.io is what I really need to be able to move forward in new applications and make a really important difference to me to make the switch from php to Node.js. I know you are with mobile applications now guys, but please don’t forget about this important feature. :pray: :raised_hands:

3 Likes

The socket.io package is already included with the node server but it will take a while until we have implemented it completely with Wappler.

We currently don’t have a user configuration and default it is not running. You can enable it by adding enableSockets: true to the config.json in the app/config folder. For now the only way to use the sockets server is by editing the sockets.js in the lib/setup folder, but we will update this file in the future and the file can be overwritten then.

4 Likes

Hello @patrick,

We have obtained very good results in our company application similar to the examples above. The completion of the integration will be exciting. Is there more time to integrate the UI with socket.io? because we think we will proceed faster and more confidently with the UI.

3 Likes

Hi Patrick,

We need this too. We’re building a CRM Application. The use-case is that it has to integrate with a call centre application (dialler).

Once a lead is dialled from the dialler, the dialler will call one of our APIs with the lead number and agentID (agent is logged into our CRM) and we need to be able to open a custom popup on the agent dashboard based on the agentID we receive.
(Happy to share more details on this)

UI for sockets would be game-changer for us for this use-case.

4 Likes

you can use sip client .