Skip to content

gdgriga/firebase-kotlin-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About the workshop

In this workshop we will explore what Firebase Functions are and setup project for writing these functions in Kotlin. To get there we will touch some other interesting topics like Firebase Realtime Database and TypeScript.

Prerequisites:

What are we building:

The Ultimate Currency converter

Let's make a backend for the ultimate currency convertion app - a user enters the price in euro and the backend converts it to other currencies.

The backend will work as follows:

  • The client app pushes a new "conversion" object with a euro value into conversions table
  • A function gets triggered and picks up this object and calculates values in all other currencies
  • Data gets written back to the same object with a timestamp

Firebase Realtime Database structure:

{
    "rates" : {
        "usd" : 1.175,
        "czk" : 25.88,
        "pln" : 4.303,
        "rub" : 68.52
    },
    "conversions" : {
        "<hash1>" : {
            "eur" : 3.0
        },
        "<hash2>" : {
            "timestamp" : 1507570800,
            "eur" : 1.0,
            "usd" : 1.175,
            "czk" : 25.88,
            "pln" : 4.303,
            "rub" : 68.52
        }
    }
}

Contents:

Disclaimer:

I am not a JavaScript expert, therefore the JS code here is far from optimal. Apologies to JS fans or experts that get eye-bleeds.

About

Lets try to blend Firebase Functions and Kotlin.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 100.0%