I have a structural dilemma for my application. Currently I have an application consuming an API Rest made with Node and MongoDB. And I want to add the chat functionality. I was reading and I think the best option is to use the XMPP protocol for it, I found mongooseIM that is oriented to mobile applications. The issue is that it does not support mongoDB (my current BD). Then I thought about using node-xmpp to communicate with mongooseIM and register the user from Node and send the client the auth for mongooseIM and connect the client's chat service to this server. More or less that's how architecture would be.
I am a bit burned from reading both alternatives and documentation, so I would like to ask if it is well planned or I am wrongly directed. If so, which options are better based on your experience. Thank you very much already.