DEV Community

Discussion on: Building a chat - Browser Notifications with React, Websockets and Web-Push 🤯

Collapse
 
toan1606 profile image
Toan1606

Thanks. But I have some questions.

  1. Is Your solution for chat and real time the best ?
  2. I'm a Java Developer so I can do it in Java instead of React. So Can you compare between them ?

Thanks

Collapse
 
nevodavid profile image
Nevo David • Edited

Hi Toan1606, Thank you for asking.

  1. There are many ways to write it with different libraries and different languages, but the main goal is to stick to the browser limitation. If you want two way communication between the browser and the server you have to use websockets. You can find more information about it on the first article.

  2. Unfortunately, you can't use Java for the frontend. You can change React to any other frontend or just a vanilla js. You can definetly replace Java with node.js for the websockets. I am not a big Java expert but a quick google brought this:
    github.com/TooTallNate/Java-WebSocket

Collapse
 
toan1606 profile image
Toan1606

Thanks. I will learn React and using my next project.