Mobile application API

Hey I am a fresher in backend development and I have to make an API for messaging between friends whom we have followed
so like whoever the installed the app you will see everyones profile and then you can choose whom to follow and whom not to and then you can talk to the person via an in app chatting facility
so my question is how am i supposed to start and also if i create a collection named MESSAGE where am i supposed to do my all socket programming
Thanks

For something like that you might want to look at socket.io, I believe a community member made a package for this here: StrapIO the ez to use socket.io configurator

And typically you would handle the socket.io stuff in ./config/functions/bootstrap.js