Skip to content

Latest commit

Β 

History

History
74 lines (59 loc) Β· 2.3 KB

firebase-setup-guide.md

File metadata and controls

74 lines (59 loc) Β· 2.3 KB

Firebase Setup Guide

Go to Firebase Console

Create a project in Firebase Console

  • Follow the steps below:

Configure Firebase Project Credentials

  • Follow the steps below:

    🚧 Save the credentials from last image to use in a step ahead!

Apply Firebase Database rules

  • Follow the steps below:

    • Paste the following rules in last screen input:
      {
        "rules": {
          "rooms": {
            ".read": false,
            ".write": false,
            "$roomId": {
              ".read": "!root.child('/rooms/' + $roomId + '/endedAt').exists() || data.child('authorId').val() == auth.uid ",
              ".write": "auth != null && (!data.exists() || data.child('authorId').val() == auth.uid)",
              "questions": {
                ".read": "!root.child('/rooms/' + $roomId + '/endedAt').exists()",
                ".write": false,
                  "$questionId":{
                    ".read": true,
                        ".write": "auth != null && !root.child('/rooms/' + $roomId + '/endedAt').exists() && (!data.exists() || data.child('author/id').val() == auth.uid)",
                    "likes": {
                      ".read": true,
                      ".write": "auth != null"
                    }
                  }
              }
            }
          }
        }
      }
    • Click on the Publish button to save the rules:

    Example of Rules