I have created a react chat application using Firestore Database. Firestore Database is a real time database which allows real time communication.
In this app i have developed a complete Authentication System that you can use everywhere not just firebase which allows a user to login within the application.
Authentication Architecture that i have used will also work for rest api authentication
you can clone project from github
Youtube Tutorial is also available for this project