Firebase

Synchronization with firebase

This feature is under development.

Plan for implementation

  • Connect local database with firebase cloud database

  • Use a separate script if you want to reset the firebase database to the current local database

  • If you use this script from serveral devices with the same firebase database,
    • Data is only synchronized (downloaded) with firebase database at app startup or when explicitly requested

    • Data is uploaded continuously (each time something in the database is modified locally)

Creating a firebase database

_images/firebase_create_project.png
  • Go to the database section

  • Create a new database

_images/firebase_create_database.png
  • Select “Start in test mode”

  • Go to the “Rules” tab

  • Replace the content of the text box with the following:

{
  "rules": {
    ".read": "auth.uid !== null",
    ".write": "auth.uid !== null"
  }
}
  • Click on “Enable”

Downloading the firebase credentials

  • Go to the settings of your firebase project

  • Go to the “Service accounts” tab

  • Click on “Generate new private key”

  • Save the json file somewhere on your computer

  • In the vocabuilder config file, set the path to the json file in the “Firebase” section:

[Firebase]
credentials = /path/to/credentials.json

Saving the database URL

  • Go to the realtime database section of your firebase project

  • Go to the data tab

  • Copy the URL of your database

  • In the vocabuilder config file, insert the URL in the “Firebase” section:

[Firebase]
databaseURL = https://your-project.firebasedatabase.app