Firebase Cloud Functions for basic reporting purposes.
For source code check src/functions/
directory. The list of implemented functions:
- reportProgress - HTTPS function for reporting single progress point for any project. Progress entry is saved to Firebase Firestore.
URL https:///reportProgress
Method
POST
Headers
Content-Type: application/json
Request data
Progress object:
project
- string, requiredprogress
- float, requiredtimestamp
- integer, required
Example request:
POST: https://<forebase projects base path>/reportProgress
Headers: Content-Type: application/json
Body:
{
"project": "migration-progress",
"progress" : 80.76,
"timestamp" : 1
}
URL https:///reportProgressBulk
Method
POST
Request data
Progress object:
project
- string, requiredprogress
- float, requiredtimestamp
- integer, required
Example request:
POST: https://<forebase projects base path>/reportProgressBulk
Headers: Content-Type: application/json
Body:
[
{
"project": "migration-progress",
"progress" : 77.11,
"timestamp" : 1
},
{
"project": "migration-progress",
"progress" : 80.76,
"timestamp" : 2
}
]
This is Firestore Function trigger that copy newly created Firestore document into Big Query table.
Firestore document path: progress_tracking/{project}/datapoints/{point}
Big Query setup
Dataset name: reporting_dataset
Table name: datapoints
Database schema:
project STRING REQUIRED
timestamp INTEGER REQUIRED
progress FLOAT REQUIRED
Functions reportProgress
and reportProgressBulk
add documents into Firebase Firestore collections. Collections path:
progress_tracking/{project}/datapoints/{point}
Document scheme:
project
- stringtimestamp
- numberprogress
- number