Skip to content

Firebase Documentation

Abimalek Mekuriya edited this page Jun 30, 2022 · 7 revisions

Firebase

This is the documentation of how the app interacts with the firebase database for future maintainers to understand as well as for the current development team to coordinate usage of the database with the software development team.

This Will Include

User Auth



Registration

The authentication process takes takes place within the register method which is located at org.kashmirworldfoundation.WildlifeGeoSnap.Register and is declared as

private void register(String organization, String country)

Step #1: Email Password Registration

Write

The register method will register a new user with an Email and Password into the auth DB.

Data for Email-Password Registration

type AccountRegisterationData struct {
    email: string    \\Get's from UI
    password: string \\Get's from UI
}

Step #2: Member Registration#

Write

After the register method successfully registers a user into auth, it will create a new Member object within the database associated with there UID which is unique identifier for there account.

Data for Initial Member Object Creation

type MemberCreation struct {
    admin:    bool   \\INITIAL SET: False (idk what this field means yet)
    email:    string \\Get's from UI
    fullName: string \\From Registration UI
    job:      string \\Get's from UI (JOB TITLE)
    phone:    string \\Get's from UI (Needs to be migrated to int)
    profile:  string \\INITIAL SET: "profile/kwflogo.jpg" (this is the user's profile picture, data is located within storage in firebase)
    org:      string \\INTIAL SET: Users Organization Directory (This is the basically Orginization/{organization uid})
}


Logging In

The login process takes takes place within the login method which is located at org.kashmirworldfoundation.WildlifeGeoSnap.LoginActivity and is declared as

private void login(String email, String pass)

Step #1: Send Email and Pass to API

Read

Data required for Logging In

type AccountRegisterationData struct {
    email: string    \\Get's from UI
    password: string \\Get's from UI
}
Clone this wiki locally