Deeper into the fire: Google Firebase

Christian Garrovillo
4 min readFeb 24, 2020

This is article 2 of my Google Firebase series. In the last article, I covered a little concept of idea hell — where development of an idea turns out to be harder than expected. I also covered Firebase, when to know Firebase is a good fit for your application and how you can save time to focus on other tasks at hand.

On this article, we will explore how to build your app’s foundation using Firebase.

Requirements

To get started with Firebase, you first need the following:

  • A Google Account

That’s it! It is that simple. Firebase will handle all the nitty-gritty stuff for you like dealing with the GCP, which I talk about below:

GCP + Firebase

Structural Concepts

Before we go into starting our app, I want to cover a few basic structural concepts first. If you already know or could care less about the theory, you can move forward to the Create a Firebase Project

Firebase App

A Firebase App is — well exactly what it is. It is an application that can either be an iOS, Android or Web App. These Firebase Apps belong to a Firebase Project:

Firebase Project

A Project is basically a container that shares resources for your app. Any resources contained in your Project such as: User Management, Databases, Configs etc. can be shared across multiple apps that belong to that Project.

Google Cloud Project

In my last article, I covered how one of the benefits of using Firebase is the access to Google’s infrastructure. This means that on top of the Analytics, User management etc. you also get access to — you guessed it — Google Cloud. When a Firebase Project is created, a project on the Google Cloud Platform (GCP) is actually created behind the scenes. This GCP project is the virtual container that has the data, code, configuration and services specific to Firebase. This is essentially how your app works behind the scenes — on the Google Cloud Platform.

Creating a Firebase Project

Now that we have the bureaucratic stuff out of the way, we can go ahead and build our foundation. First things first, lets setup a Project in Firebase.

While logged in to your Google account, head to https://console.firebase.google.com/ and click on ‘Create a project’

It will ask you for a name for the project. Provide your project name and accept the Firebase terms.

Keep clicking continue until you reach the confirmation that your project has been created. You’ll know it was successful when you land on this page right here:

Congrats! You successfully created your first Firebase project. Next, you can select what kind of app(s) will exist in this project. You can select this by selecting one of the four options: iOS, Android, Web or Unity.

For the purposes of this tutorial, I will select Web.

Once again, click through the prompts until you have an app registered on the Firebase project.

Once you have an app registered, you will see a code snippet that is ready to be used in your project. It should look something similar to this:

For simplicity’s sake, I will not be covering how to properly secure your GCP projects, including Firebase. This is a whole different topic on it’s own and is not the focus of this article series. However, if you want to read more about it (and I suggest you do before you go into production), head over to this medium post to find out how to secure your API keys.

Using our newly-found API keys from our project, we can now add it to our application!

Create the Firebase configuration for your app

Initialize the app using the config you just provided

and you are done! Firebase is now added to your project. You can confirm it exists by doing a console.log() of the Firebase object

And you should see your Firebase config settings in the object returned

That is all that it takes to add Firebase to your project. Next we will get into actually executing on your idea and creating your App.

This is article 2 of my Firebase series. For the previous one, check it out here.

--

--

Christian Garrovillo

A software developer who loves developing platform-independent web apps. New writer on Medium.