Prepare Firebase Project

Prepare Firebase Project

Before installing the Platfone Firebase Backend, follow these steps to set up your Firebase project.

Step 1: Create a Firebase Project

Create a new Firebase project or use an existing one in the Firebase console.

Step 2: Configure Cloud Firestore Database

In the Firebase console, go to Build -> Firestore Database -> Create Database to set up a Firestore database.

Firestore Security Rules

Copy the content of the backend/firestore.rules file into the Firestore Rules tab in the Firebase console, and then click “Publish.” These rules are critical for securing your database.

For more guidance, see the Firestore documentation.

Step 3: Enable Firebase Authentication

In the Firebase console, go to Build -> Authentication -> Get Started. Enable the authentication providers your users will need. You can start with the Email/Password provider and add others as necessary.

Step 4: Upgrade to the Blaze Plan

Upgrade your Firebase project to the Blaze plan (“Pay as you go”). Most Firebase services include generous free quotas, but the Blaze plan ensures you only pay for what you use. For more details, review the Firebase pricing.

Step 5: Create Service Account and Key

This service account is used to deploy the Firebase Cloud Functions and enable required Google APIs. It can be either disabled or deleted after the installation process.

  1. Go to Google Cloud Console -> Service Accounts.
  2. Select your Firebase project.
  3. Create a new service account (e.g., platfone-firebase-backend-installer) with the role Owner.

Generate a Service Account Key

  1. In the Google Cloud Console, click the three dots next to the service account you created and select “Manage keys”.
  2. Click “Add key” and choose “JSON” to download the service account key.
  3. Store the downloaded JSON key file securely, as you will need it during the installation process.