Step 1: Go to Firebase Console

To get started with Firebase, you need to access the Firebase Console:

Go to Firebase Console

Create a new firebase project to attach to your golex app.

Step 2: Create a Firebase Web App

First, you’ll need to create a Web App within your Firebase project:

  1. From your Firebase Console, select your project
  2. Click on the web icon (</>) on the project overview page
  3. Give your app a nickname (like “Golex Web App”)
  4. Check the box for “Also set up Firebase Hosting”
  5. Click “Register app”

Step 3: Copy Your Firebase Config

After registering your app, Firebase will provide configuration details. This is how your app will know which Firebase project to connect to.

  1. In the “Add Firebase SDK” step, you’ll see a code snippet that looks like this:
const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "your-project-id.firebaseapp.com",
  projectId: "your-project-id",
  storageBucket: "your-project-id.appspot.com",
  messagingSenderId: "123456789012",
  appId: "1:123456789012:web:abc123def456"
};
  1. Copy this entire firebaseConfig object - you’ll need to paste it into your Golex dashboard later

Step 4: Download Your Service Account Key

To allow Golex to securely access your Firebase project’s resources, you’ll need a service account key:

  1. In the Firebase Console, go to Project Settings (the gear icon near the top of the sidebar)
  2. Select the “Service accounts” tab
  3. Click “Generate new private key” button
  4. Confirm by clicking “Generate key”
  5. A JSON file will download to your computer - keep this file secure!

Step 5: Set Required Permissions

Your service account needs specific permissions to work with Golex:

  1. Click manage service accounts from the firebase console services accounts section
  2. In the sidebar, navigate to “IAM & Admin” > “IAM”
  3. Find the service account firebase-adminsdk-[random-string]@[your-project-id].iam.gserviceaccount.com
  4. Click the pencil icon to edit permissions
  5. Add the following roles:
    • Firebase Develop Admin

Step 6: Upload Your Configuration to Golex

Finally, let’s connect everything in the Golex dashboard:

  1. Log in to your Golex account
  2. Go to the webapp you want to connect firebase
  3. Click “Connect Firebase” button in the nav bar
  4. In the “Firebase Config” field, paste the configuration object you copied in Step 3
  5. Upload the service account JSON file you downloaded in Step 4
  6. Click “Connect Firebase”

That’s it! Your Golex web app is now successfully connected to Firebase. You can start integrating firebase features in your application.

If you run into any issues, don’t worry! You can always reach out to Golex support for assistance.

Next Steps

  • Setup and add authentication to your app
  • Add a database to your application