Skip to content

Firebase Setup

Firebase is Google’s mobile platform — it provides analytics, authentication, database, storage, and crash reporting in one place. It’s one of the most common backends for Flutter apps.

The Prompt Library includes a Firebase Analytics template to help you get started quickly.

Analytics is the simplest Firebase service to set up and a good starting point. Once you have the base configuration in place, adding other Firebase services is much easier.

  1. Create a Firebase project

    Go to console.firebase.google.com and create a new project. You can disable Google Analytics during setup and add it later — it doesn’t matter either way.

  2. Add an Android app

    In your Firebase project, click “Add app” and select Android. Use your app’s package name from Primio project settings (Workspace → Project Settings).

  3. Download google-services.json

    Firebase generates this configuration file after you register your app. Download it — you’ll paste its contents into Primio.

  4. Open Prompt Library → Firebase Analytics (Minimal Setup)

    In Primio, click the attachments button in the chat input, then open the Prompt Library. Select the Firebase Analytics template.

  5. Follow the template

    The prompt template guides you through pasting the JSON config and setting up basic event tracking. Send it and let the AI configure everything.

After analytics is working, you can ask Primio to add more Firebase services one at a time. Each service shares the same google-services.json configuration, so no additional Firebase setup is needed.

Authentication:

  • “Add Firebase Authentication with Google Sign-In”
  • “Add Firebase Authentication with email and password”

Database (Firestore):

  • “Add Firestore to read and write user data”
  • “Connect to a Firestore collection called ‘recipes’ with fields: title, description, imageUrl, userId, createdAt”

Note: Create your Firestore collections and security rules in the Firebase Console. Then ask Primio to write the code that connects your app to those collections.

Storage:

  • “Add Firebase Storage for image uploads”
  • “Let users upload a profile photo to Firebase Storage”

Crash reporting:

  • “Add Firebase Crashlytics for crash reporting”

Set up one service at a time. Adding Firebase Auth, Firestore, and Storage all in one prompt is likely to cause issues. Add one, test it in the Live Preview, then move on to the next.

Test each integration before adding the next. If something breaks, it’s much easier to debug when you’ve only changed one thing. Use Rollback if an integration doesn’t work as expected.

The google-services.json file is shared. You only download it once. All Firebase services in your app use the same configuration file.

Supabase Setup

Supabase is an open-source alternative to Firebase with a PostgreSQL database.

Prompt Library

Browse the Prompt Library for more integration templates.