Structuring a chat app to use notifications and how to store messages
Structuring a chat app to use notifications and how to store messages
I'm building a niche social app that will allow users to connect and chat with each other on a 1 to 1 basis. My front end components are nearly there, however I'm quickly learning that the back end for such an app can be extremely complex.
I've come up with a couple of ideas of how I should structure this and have prototyped some but to little success.
I'm using node, socket.io, and a NoSQL database, however the structure of this is becoming increasingly frustrating. I want to be able to send notifications and store messages but not sure how to go about it.
One possibility I've thought of is to track whether messages have been read by passing an acknowledgement callback along with each message emitted. Id then update an array called unreadMessages depending on whether the callback was executed.
Im also debating whether to store the messages in a database or locally on the device. Could anyone point me in the right direction? I've looked at different examples but seen nothing that seems to handle the receipt of messages.
Thanks
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.