What you're looking for is the Firestore Rest API. Previously I have been started using Firestore, as the app I was creating has a survey area which will filter products according to the chosen criteria. I was able to figure out how to get/post data in the database that is stored as an object.
So far everything was working great except for notifications. I have users subscribed to specific topics which works great if I use the website to send a message. However, I need my iOS app to send a message and google provides amazing documentation on how to do that. So in order to do that, I decided to use an http request to post that information. With all of this, I get the error "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential". I have created new server keys and still get the same error. The following is what I have tried for the Authorization field... without the parenthesis of course:
Bearer (Server Key)
Bearer (New Server Key)
Bearer (Legacy Server Key)
key=(Server Key)
key=(New Server Key)
key=(Legacy Server Key)
Then, after a lot of search I realized that FCM v1 does not send messages from the client, only from a server. I could have to use XMPP to send outgoing messages directly from the client.
However, after gone through your proposal I've completely understood what will be the main functionality, but still I am waiting for your logic.