Firebase Module
Overview
Documentation
Features
- Create a connection to the Firebase Realtime Database functionality. Make easy to use Message Definition to fill and maintain the Realtime database.
- Create a connection to the Firebase Storage. Making it easy to store images and documents in Firebase and generate URL's instead of having the files stored in Mendix.
- Make it easy to manage, maintain and authenticate users in Firebase via microflows.
Implementation
- Create a new Firebase Project.
- Add the Admin page to the navigation.
- Implement the java-actions where needed. You can use the example pages to see some implementations of these actions.
Getting the JSON FIle:
Go to the Firebase console.
Project overview -> Service accounts -> Generate PrivateKey
Upload this file in the Admin page as the Firebase JSON File.
Setting up the database:
Go to the Firebase console.
Database -> Create new database.
You have now created the database.To find the realtime database URL click next to the big title at the top saying Database and click on Realtime Database. Here you can find the URL for the Database.
Setting up the Firebase Storage:
Go to the Firebase console.
Click on Storage and create the storage if you havn't yet. You should now be on the page with the Storage URL. ALERT: Make sure you remove the 'gs://' at the start and the / at the end when putting the URL in Mendix.
Setting up Firebase Users:
Go to the Firebase console.
Click on Authentication.
Now you have to setup a login method. For most usecases Anonymous is fine since you generate AccessTokens with the Java actions and set the Database Rules to only interact with data that has the same UserID. (check the documentation for Database Rules). After setting up atleast one login method you can use the User java-actions.
Future plans:
- Making a custom uploader widget to only upload to firebase and not to mendix.