Setting Up Firebase

Edit this page

Guide on how to ready up a new Firebase project for Firelayer.

Resume video guide for the instructions bellow:

# 1. Create a project

Open the Firebase Console and create a new project.

# 2. Setup Authentication Methods

We will need to sign up new users in our application so we are going to enable the email / password basic authentication method.

  1. Click on Authentication on the Navigation menu under Develop
  2. Click "Set up sign-in method"
  3. Enable Email/Password provider

# 3. Setup Realtime Database and Firestore

To persist the data of our applications we have at our disposal two databases, very easy to setup.

  1. Click on Database on the Navigation menu under Develop
  2. Click "Create Database" and select the region where you want your to store your databases and storage bucket. More on regions here.

# 4. Setup Storage

To store files and our backups we will need a storage bucket. So let's create our default one.

  1. Click on Storage on the Navigation menu under Develop
  2. Click "Get Started" and follow the prompts.

# 5. Setup Hosting

Firebase also handles your website hosting so to get it started just:

  1. Click on Hosting on the Navigation menu under Develop
  2. Click "Get Started" and follow the prompts.

That creates your default hosting site repository.

# Multiple Sites

If you're starting with the Starter Template (default) and add the Landing Template you will need two hosting targets, two different websites, one for the administration dashboard and other for the landing page website.
To create a second hosting site, click on "Add another site" on the bottom of the page and on the prompt write the name you wish to set your new website.

You will need to define this hosting names on .firebaserc once your project is setup:

#.firebaserc example file for starter template + landing template { "projects": { "default": "my-new-firelayer" }, "targets": { "my-new-firelayer": { "hosting": { "landing": [ "my-new-firelayer" ], "admin": [ "my-new-firelayer-admin" ] } } } }

# Service Account Key

If you haven't already follow the step on the Getting Started - Get the Firebase Service Account key so your Cloud Functions and Firelayer CLI helpers can work locally.

# Create Web Application (Optional)

Initiating a new project using firelayer init will prompt you to create a new web application if you don't have any web application on the project you selected.

You can create it now in the Firebase Console and then select it on firelayer init.

# All set

After all these steps we are all set to start our Firelayer project firelayer init mynewproject

Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!