2
votes

Hey I love Play Framework Scala and I also am falling in love with Firebase. I was wondering though, I'm planning on building an app using AngularFire and I'm going to need to do some server-side logic/computation and make some server-side queries to Firebase. Is this possible to do with a Play Framework Scala setup? If so what is the recommended approach? If not, is it coming? If so when? I think it's so cool that the Firebase guys used Scala to build Firebase, but I'm bummed there is no Scala API to work with (that I can see). Maybe I could use the Java API somehow, but write still write the app in Scala? Any help would be great. Thanks!

2

2 Answers

4
votes

Scala is highly interoperable with Java (compiles to the same bytecode) so you should be able to use the Java API straight-up without any issues.

While some libraries add Scala-specific wrappers to make an API more idiomatic and pleasant for a functional programming style and to smooth some rough edges, it's often not strictly necessary.

If for some reason you didn't want to use the Java client libs, you could also interface with the Firebase REST API via Play 2's very convenience and succinct web services library.

2
votes

Should be no problem with either their Java SDK (when using Firebase on the backend) or the JavaScript SDK (when using it on the client). But you won't have native support for Scala or Play, especially no support for Iteratee/Enumeratee in Play.

The Java API looks quite good and seems to be event driven. So it should be no problem to integrate it in Play in a scalable way.