A Cross-platform Firebase Sample App Featuring Best Practices

We’ve provided a number of different ways for you to get started building your app with the Firebase platform — everything from quickstarts for many of our individual products, to codelabs, to some Getting Started screencasts on our YouTube channel.

But what happens after you’ve gotten started with a feature, and are looking to build something more substantial? How do you learn how to avoid race conditions while writing to the Firebase Database? Or lazily create an infinite feed? Do you wish there were an open-sourced Firebase playbook app that you could use to see real-life use cases in motion? Or an app that demonstrates the use of multiple Firebase products together, so you can follow the same practices in your own app?

For all you developers who want to see an app built for a real life scenario, we’ve created an open sourced narrative app called FriendlyPix. FriendlyPix uses some of the most popular Firebase SDKs, such as Analytics, Cloud Messaging, Cloud Functions, Authentication (with FirebaseUI), Realtime Database, Storage, Remote Config, Invites, and AdMob.

Best Practices

FriendlyPix highlights some of the best practices when using Firebase, such as:

  • Using FirebaseUI for Auth
  • Creating indexes in the Realtime Database for fast search
  • Fanning out simultaneous writes to avoid race conditions
  • Building a data hierarchy of flat, denormalized data for fast access
  • Running ordered, filtered queries for partial data access
  • Creating lazily updated feeds
  • Using the proper file and folder structure when uploading images to Firebase Storage in conjunctions with Cloud Functions

We look forward to seeing you use these best practices in your app, or use FriendlyPix as a starting point for your app.

Get Started

To get started with FriendlyPix, you can read the design document or check out the apps (Android, iOS, and Web) and associated Cloud Functions on GitHub.

The web version is already hosted at https://friendly-pix.com for you to try out, and we are planning to release FriendlyPix on other platforms for you try as well.

We’ll be updating the app and adding further SDKs in the coming weeks, so keep an eye on this blog or watch our Github repos to stay updated.

Questions / Issues / Contribute

You can ask FriendlyPix related questions on StackOverflow with the firebase and friendlypix tags. Issue trackers are hosted on Github in their respective platforms repos: Web, iOS, and Android. We’d love for you to contribute to the project, although before doing so please read our Contributor guide.