javapostgresqlreact-nativesocial-networkinginstant-messaging

How to implement a messaging service in react-native with a java backend?


I am creating an app using React-Native for the front-end, Java for the back-end and PostgreSQL for the database.

One feature of this app is to allow users to add each other as friends and instant message them - just like other social networks. At the moment, security is not a priority but I don't want to create something that I will have to completely redo when I do have to make it secure!

The goal here is to give each user the ability to send/receive messages to/from their friends. They also need to be able to view the message history with each contact.

I just need some advice on the following points to get me going as I haven't gotten very far on my own:

I should point out that I am very new to React-Native, databases and networking so I am finding this very challenging!

I will massively appreciate any help and any examples would be fantastic!


Solution

  • You should use WebSocket on the server. Spring supports it

    Here's a tutorial I wrote about sending messages from PostgreSQL to the browser using WebSocket, which isn't exactly what you're going to do, but can hopefully get you started:

    http://blog.databasepatterns.com/2014/04/postgresql-nofify-websocket-spring-mvc.html