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
- Step 2: Configure Cloud Firestore Database
- Step 3: Enable Firebase Authentication
- Step 4: Upgrade to the Blaze plan
- Step 5: Create Service Account and Key
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.
- Choose a location as close as possible to your users for optimal performance. For non-default location please refer to configuring non-default location for Firestore Database.
- Set security rules by selecting “Start in production mode”. It is essential to update these rules to secure your database. See the Firestore Security Rules section below for more details.
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.
- Go to Google Cloud Console -> Service Accounts.
- Select your Firebase project.
- Create a new service account (e.g.,
platfone-firebase-backend-installer) with the roleOwner.
Generate a Service Account Key
- In the Google Cloud Console, click the three dots next to the service account you created and select “Manage keys”.
- Click “Add key” and choose “JSON” to download the service account key.
- Store the downloaded JSON key file securely, as you will need it during the installation process.