1

I have a Web Application based on Vue.js, REST(JSON) and Java EE with Payara Server.

Now i want to add a chat. There should be different fixed chat rooms (global, groups) and there should also be the possibility for private user-to-user chats.

I've been looking for a while now and have come across various Vue Chat projects that use 3rd party services e.g. socket.io, PubNub, CometChat. I don't want to outsource any functions in this way. In addition, it probably does not make sense to use finished components, since I have so far not found anything that can meet the above specifications and I would have to modify the component accordingly.

So I think I can't avoid building something new for myself, which is not a problem. However, I don't want to reinvent the wheel and I'm unfortunately not familiar with the best practices of building chat applications.

Roughly off the hook, I would create a database table that is used to store the messages. The messages are delivered and picked up via my REST interface, in whatever way.

Is this direction correct? Can i make it like this? It kind of feels ... dull. I have seen a lot of finished chat servers, do i really need something like this, or can I implement this with my Payara server without major complications?

Unfortunately I could not find any suitable examples. I would be very grateful for a short advice or suggestions.

config
  • 136
  • 1
  • 10

1 Answers1

1

the best advice I can give you is to use a communication protocol which grants real time data. I mean, something like websockets or socket.io, which is a pretty good option. Besides, if you want to develop a chat app, the data will be bidirectional, this means that it will travel from server to client and viceversa. I hope this could help you. Here you have an example of a pretty basic chat app using socket.io. I hope this could help you, regards

elC0mpa
  • 106
  • 5
  • Ah okay, I'm starting to understand. I think I have to deal with web sockets because I would have to set up a NodeJs server for socket.io. Which would be kind of nonsense because I would have an extra server just for the chat. Then I'll take a look at it. Many thanks :) – config Jul 13 '20 at 09:17