Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Workshop: Firebase - rule all platforms!

GDG Riga
August 27, 2016

Workshop: Firebase - rule all platforms!

During this workshop you will explore possibilities of the Firebase in following platforms: iOS, Android and Web (JS). So, if you are one of these - come to the workshop, bring your teammates and let's hack together!

This time format will be really interesting, we will split into groups with developer from each platform and try to bring a truly cross-platform app during the event with Firebase as a backend.

GDG Riga

August 27, 2016
Tweet

More Decks by GDG Riga

Other Decks in Technology

Transcript

  1. 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.
  2. 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)
  3. 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
  4. 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
  5. 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.
  6. 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
  7. 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
  8. Database Security • Access rules written in JSON { "rules":

    { "foo": { ".read": true, ".write": "!data.exists()" } } }
  9. User-Based { "rules": { "users": { "$uid": { ".read": true,

    ".write": "auth.uid === $uid" } } } }
  10. Schema Validations "rules": { "profile": { ".validate": "newData.hasChildren(['id', 'name'])", "name":

    { ".validate": "newData.isString() && newData.val().length < 50" }, "$other": { ".validate": false } } }
  11. Our database structure: Tasks "tasks" : { "-KP7LzcIbY1h9IaE1zPv" : {

    "assignee" : "08eZugcUm6M6ronTtIYThSJS08m2", "attachment" : "gs://....appspot.com/attachments/....jpg", "collection" : "in_progress", "title" : "Create users" }, ...
  12. 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, }, ...
  13. 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
  14. 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