Skip to content

Latest commit

 

History

History
161 lines (134 loc) · 10.1 KB

FIREBASE.md

File metadata and controls

161 lines (134 loc) · 10.1 KB

In the .droidconKE app we are using the following Firebase SDKs

  1. Cloud Firestore
  2. Cloud Messaging
  3. Crashlytics
  4. Cloud Functions
  5. Authentication
  6. Cloud Storage
  7. Remote Config

For those who want to run the code for the .droidconKE app, follow the setup steps below for each of the Firebase SDKs as outlined below.

Authentication Setup

The .droidconKE uses Google sign up for users to easily sign up/in to the app. Firebase has a couple of authentication methods but are only using Google Sign in. In your Firebase Console, Go to Authentication and click on the Sign-in method tab and enable Google.

Cloud Storage Setup

All the images for the .droidconKE app are stored in Cloud Storage. The images are grouped into folders for easier identification. The following are the folders in the cloud storage.

1. agenda_icons/ - This contains icons for the conference agenda. Example of the agendas include lunch, after hours, codelabs etc. You can have your own icons and place them in these folder and add their names as:

  1. codelabs.png
  2. lunch.png
  3. afterhours.png
  4. etc

2. designs/ - This folder contains the designs for the conference.Example images in this folder are:

  1. hack_bounty.png
  2. sponsor_slots.png
  3. pitching.png

3. organizers/ - This folder contains the logos for the organizers of the conference. Example images in this folder are:

  1. organizer_one.jpeg
  2. organizer_two.png

4. sessions/ - This folder contains the designs for each session of the conference. Example images in this folder are:

  1. jetpack_compose.png
  2. compassionate_android_developer.png

5. speakers/ - This folder contains the profile pictures for the various speakers at the conference . Example images in this folder are:

  1. speaker_one.png
  2. speaker_two.png

6. sponsors/ - This folder contains the logos for the companies that sponsor the conference. Example images in this folder are:

  1. sponsor_one.png
  2. sponsor_two.png

The images can either be .png/jpeg/jpg. You can add as many folders as need be.

Cloud Functions

Cloud Functions are for listening when a user "stars" or favourites a session. When a favourited session is about to begin, the cloud functions will trigger cloud messaging to send notifications to all users who have starred/favourited the session. The code for the cloud functions can be found here

Cloud Messaging

For Cloud Mesaging, no additional configurations are needed. The default console settings are good to go with.

Crashlytics

The Crashlytics setup has already been done in gradle files according to the following instructions.

Remote Config

We depend on Remote Config for the data which can change during the conference and the data that is required to change quickly and reflect to the users upon change. The remote config defaults can be found in this file. Add the parameters according to their key in the file in the Remote Config section of Firebase Console.

Cloud Firestore

Data for that app is stored in Cloud Firestore. There are collections and in each collection, there is a couple of documents related to that document. The following are the collections for the .droidconKE app:

  • about_droidconKE - This collection has a document that has details about .droidconKE in general. The document has the following key fields:

    • bio - string description of the .droidconKE conference
    • id - id which is an integer, of the document(Its not autogenerated,choose any unique id system that works for your use case)
    • logoUrl - Cloud Storage download url string for the logo of the conference
    • name - string title of the document
  • agenda - This collection has documents that are about the agenda of the .droidconKE conference . It has a list of documents and each document has the following fields:

    • background_color - string Hex Value for the color of the agenda. For example #8BC34A
    • iconUrl - Cloud Storage download url string for the icon of the agenda
    • id - integer id of the agenda
    • time - the start and end time string of the agenda eg 10:00 AM - 10:50 AM
    • title - the string title for the agenda eg Lunch
  • day_one - This collection contains a list of documents which have sessions which are for day one. Each day one session has the following fields:

    • id - interger for session id
    • speaker_id - an ArrayList of speaker id's for the session
    • room_id - id for the room where the session will happen
    • room - string title for the room where the session will happen
    • time - string for the time the session will happen
    • title - string representing the title ofthe session
    • topic - string representing the topic in Android which the session will cover
    • url - session url on the .droidconKE website
    • duration - time in string the session will take eg 50 Minutes
    • description - string description of what the session is about
    • session_color - hex color in string format for the session eg #9b9b9b
    • type - string value identifying the type of session. A session can be a codelab, keynote, reqular session or a lightning talk.
    • day_number - string number representing the day number for the session
    • time_in_am - string value representing time in am/pm format eg 11:00 AM or 02:00 PM
    • am_pm_label - string value representing the time label whether AM or PM
    • photoUrl - Cloud Storage download url string for the session image
  • day_two - This collection contains a list of documents which have sessions which are for day two.The fields in each document are similar to the one listed in day one

  • eventFeedback - This collection contains a list of documents which have the feedback from users for the whole event. Each feedback document contains the following field:

    • eventFeedback - a string representing user feedback
  • event_types - This collection contains a list of documents which have the event types. Each document has the following fields.

    • description - string description of the event type
    • id - id which is an integer, of the document
    • eventImageUrl - Cloud Storage download url string for the event image
    • name - string title of the event
  • organizers - This collection contains a list of documents which has information about the orgarnizer of the .droidconKE conference . Each document has the following fields:

    • bio - string description of the organizers
    • id - id which is an integer, of the organizer in the collection
    • logoUrl - Cloud Storage download url string for the logo of the organizer
    • name - string title of the organizer
    • site - string for url of the organizer's website
  • rooms - This has a list of documents which have the room details. Each room document has the following fields:

    • descrpition - string descriptionn of the room
    • id - integer id of the room
    • name - string title of the room
  • session_topics - This has a list of documents which have the session topics details. Each topic document has the following fields:

    • id - integer id of the topic
    • name - String title of the topic
  • session_types - This has a list of documents which have the session type details. Each session type document has the following fields:

    • id - integer id of the session type
    • name - String title of the session type
  • sessionsFeedback - This collection contains a list of documents which have the feedback from users for a particular session event. Each feedback document contains the following field:

    • session_feedback - a string representing user feedback
    • day_number - a string representing the day number of the session
    • session_id - string id for the session
    • session_title - title of the session in string form
    • user_id - string id of the user giving feedback
  • speakers - This collection contains a list of documents which have the speaker details. Each speaker document has the following fields:

    • bio - string description of the speaker
    • company - string representing the company where the speaker works
    • id - id which is an integer, of the speaker in the collection
    • phtotUrl - Cloud Storage download url string for the profile picture of the speaker
    • name - string title of the speaker
    • twitterHandle - string for url of the speaker's Twitter Handle
  • sponsors - This collection contains a list of documents which have the sponsor details. Each sponsor document has the following fields:

    • bio - string description of the sponsors
    • id - id which is an integer, of the sponsor in the collection
    • logoUrl - Cloud Storage download url string for the logo of the sponsor
    • name - string title of the sponsor
  • starred_sessions - This collection has a list of starred sessions documents. Each document has the following fields:

    • day - a string representing the day number of the session
    • documentId - string id for the session as generated by Firebbase
    • session_id - string id for the session
    • starred - bolean value for stating whether the session is starred or not
    • user_id - string id of the user starring the session
  • users - This collection has a list of users document . Each user document has the following fields:

    • email - string representing user's email
    • photo_url - Profile image url string for the profile picture of the user
    • refresh_token - String representing user's deivice firebase refresh token
    • user_id - string representing unique user id
    • user_name - string representing name of a particular user

    NOTE

    * Make sure all field names in cloud firestore are as in the Cloud firestore section to avoid exceptions in the app.
    * Ensure that the type of the field is maintained
    * The Cloud Firestore data model tends to follow a kind of relational database to avoid repetition of data . This however does not mean that this is the go-to approach, You can come up with a more efficient data model structure a feel free to open a Pull Request. We always Love  a Pull Request
    * The data model structure can be changed depending on your use case