reactjs - Using Firebase to make a simple group chat app, alongside an already existing django-react app -


i have basic project uses django backend , reactjs frontend. basically, shows home page when user logs in, , that's it. sign of new users handled through django.admin panel.

now, want create group chat users logged in using firebase. here's problem since can't understand workflow on how should proceed. basic idea that,

  1. frontend gets username , password backend,
  2. frontend posts them firebase
  3. firebase sends unique id token frontend,
  4. now frontend logged in both django , firebase,
  5. users logged in joins in group chat

is there guidelines on how should proceed this? have read docs can't understand should doing go through this.

you want @ docs firebase.database().ref().on(<event here>) <event here> 1 of firebase database events such on, child_added, value

basically you'll doing rendering database ref, say: firebase.database().ref('livechat').on('value', snap => {render snapshot}) every client (to view chat). then, user posts 'livechat' ref. can add additional info users posted data (like uid) can later filter 'livechat' node uid (or like). make sense?

where gets bit trickier when want have 1 on 1 chats. can accomplish in same way - maybe use 1 of users uid ref. like: firebase.database().ref(`chat/${user.uid}`).push(message_here when render chat in client have individual conversations.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -