-
Notifications
You must be signed in to change notification settings - Fork 55
Technical documentation
This is the main documentation for eRouška project.
Firebase User ID, unique for each phone number, generated by Firebase Authentication after sign-in, 28 chars or more.
Broadcasted user ID, unique for each registration, generated by Firebase function after registration, 10 bytes
Transmitted user ID, actually transmitted over Bluetooth, each BUID gets about 100 TUIDs after registration, client picks a different one every hour or so, privacy measure to prevent tracking individual device/user, 10 bytes
Firestore is not readable or writable to user, only Functions.
- Key: FUID
Attributes:
- createdAt (timestamp of creation)
- registrationCount (number of BUIDs)
- Key: BUID
Attributes
- fuid
- platform (android/ ios)
- platformVersion (system version, e.g. 10.0.4)
- manufacturer (phone manufacturer, e.g. Samsung)
- model (phone model, e.g. Galaxy S7)
- locale (phone language, e.g. cs_CZ)
- createdAt (timestamp of creation)
- pushRegistrationToken (push token from Firebase Cloud Messaging)
- Key: TUID
Attributes
- fuid
- buid
- createdAt (timestamp of creation)
User can only upload data about his FUID, can't read other data.
- Key: FUID/BUID
- Filename: $timestamp.csv
Metadata
- version (version of CSV model, current 4)
CSV columns
- tuid
- timestampStart (millis)
- timestampEnd (millis)
- avgRssi (average signal strength)
- medRssi (median signal strength)
Main API for the app and other parts of the system, scales automatically, region: europe-west3
Input and output are dictionaries. Functions doesn't return anything, unless specified here (but can throw error).
Creates a new registration after authentication.
Input
- platform: string (android/ ios)
- platformVersion: string (system version, e.g. 10.0.4)
- manufacturer: string (phone manufacturer, e.g. Samsung)
- model: string (phone model, e.g. Galaxy S7)
- locale: string (phone language, e.g. cs_CZ)
- pushRegistrationToken: string (push token from Firebase Cloud Messaging)
Output
- buid: string (created BUID)
- tuids: string[] (list of TUIDs)
Deletes all CSVs for one BUID.
Input
- buid: string
Deletes all data related to BUID.
Input
- buid: string
Deletes all data related to FUID, including phone number in Firebase Authentication.
Changes push token for BUID.
Input
- buid: string
- pushRegistrationToken: string
Checks if FUID and BUID still exists
Input:
- buid: string Output:
- boolean (active/inactive)
Contains constants which we can changed later without updating the app.
- App asks the user to enter the phone number.
- App sends the phone number to Firebase Authentication.
- Firebase sends back SMS with verification code
- User verifies the device registration by entering the verification code from the SMS into the app (This is done automatically on most devices.)
- After a successful authorization, the app finishes the registration by calling the
registerBuids
function.
- An epidemiologist asks the user for the permission to use the data from eRouška and asks to upload the data.
- User gives permission by tapping "Upload data" in the eRouška. CSVs can be uploaded only once per 15 minutes. The file is saved in Firebase Storage in the collection
proximity
. - Every 30 minutes Keboola creates a phones.csv file with phone numbers in a dedicated AWS S3 bucket.
- Epidemiologist uses a web GUI to see a data for a particular phone number:
- Web app fetches a FUID related to the phone number.
- A blob is loaded for the particular FUID from the Firebase Storage.
- After the raw data is analysed, the TUIDs of people the person met are loaded from the blob, with:
- their respective phone numbers from the collection
users
- a flag representing whether the person met was in close contact or not
- their respective device names
- their respective phone numbers from the collection
- Epidemiologist contacts the possibly newly infected.