Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

What is Firebase?

Slide 3

Slide 3 text

What is Firebase ● They call it mobile platform that helps you quickly develop high-quality apps, grow your user base, and earn more money. ● Firebase is collection of tools and infrastructure to power up a business-ready solution. ● Contains lot of features to fulfil different tasks.

Slide 4

Slide 4 text

Developers Section ● Authentication (common authentication API, configurable via console, plugable with different providers, f.e. Facebook, Twitter) ● Object-oriented File storage ● Hosting Solution (SSL protected, CDN powered hosting) ● Realtime Database (Document-oriented DB with one document) ● Cloud Messaging (Chrome, iOS & Android notifications) ● Remote Config ● Crash reporting (Detailed information on crashes)

Slide 5

Slide 5 text

Stage 0: Setup

Slide 6

Slide 6 text

Application description & demo 4-column task manager Features: ● Login, Register, Logout users; ● Show avatar for active one; update it according to karma ● Create, Edit, Delete tasks; Update status moving “up” & “down” ● Attach/Delete file to task; ● Assign tasks to users

Slide 7

Slide 7 text

Start your engines! Checkout repository (pick your poison): ● https://github.com/gdgriga/firebase-< android | web | ios > Switch to “setup” branch ● Create Firebase project in Firebase Console ● Checkout docs https://firebase.google.com/docs/{platform}/setup ● Change corresponding configuration files

Slide 8

Slide 8 text

Stage 1: Auth

Slide 9

Slide 9 text

What does it do? ● Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. ● It supports: ○ Authentication with email and password ○ Authentication via federated identity providers like Google ○ Authentication via Facebook, Github, Twitter.

Slide 10

Slide 10 text

How does it work? ● SDK provides you with specific methods createUserWithEmailAndPassword, loginUserWithEmailAndPassword, sendPasswordResetEmail, etc ● SDK provides you with certain Events like onAuthStateChanged to respond during runtime ● currentUser object has predefined methods and arguments, like emailVerified or photoUrl

Slide 11

Slide 11 text

Stage 2: Realtime Database

Slide 12

Slide 12 text

Database ● Whenever data is updated in Firebase, it sends the update down to every listening client ● NoSQL JSON data store ● Cross-platform client-side SDKs ● Offline out-of-the-box ● Auto-scaling ● RESTful API

Slide 13

Slide 13 text

Database Security ● Access rules written in JSON { "rules": { "foo": { ".read": true, ".write": "!data.exists()" } } }

Slide 14

Slide 14 text

User-Based { "rules": { "users": { "$uid": { ".read": true, ".write": "auth.uid === $uid" } } } }

Slide 15

Slide 15 text

Schema Validations "rules": { "profile": { ".validate": "newData.hasChildren(['id', 'name'])", "name": { ".validate": "newData.isString() && newData.val().length < 50" }, "$other": { ".validate": false } } }

Slide 16

Slide 16 text

Our database structure: Tasks "tasks" : { "-KP7LzcIbY1h9IaE1zPv" : { "assignee" : "08eZugcUm6M6ronTtIYThSJS08m2", "attachment" : "gs://....appspot.com/attachments/....jpg", "collection" : "in_progress", "title" : "Create users" }, ...

Slide 17

Slide 17 text

Our database structure: Users "users" : { "08eZugcUm6M6ronTtIYThSJS08m2" : { "email" : "[email protected]", "karma" : 0, }, "-KP4nyKM-F3H-C4JeAvh" : { "avatar" : "https://lh4.googleusercontent.com/.../photo.jpg", "email" : "[email protected]", "karma" : 0, }, ...

Slide 18

Slide 18 text

Stage 3: Storage

Slide 19

Slide 19 text

Storage Firebase Storage provides file uploads and downloads for your Firebase. You can use it to store images, audio, video, or other user-generated content. Firebase storage is ● Robust ● Secure ● Scalable

Slide 20

Slide 20 text

Short Break

Slide 21

Slide 21 text

Stage 4: RemoteConfig

Slide 22

Slide 22 text

Remote Configuration Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your app without requiring users to download an app update. ● Quick roll-out ● A/B testing

Slide 23

Slide 23 text

Stage 5: Analytics