Connecting a Personal Trainer App to Firebase with Gemini

Devin Chasanoff walks through sign-in, database security and a live workout test with Gemini guiding each setup step.

DCDevin ChasanoffSpeaker · AI Builder Advocate
Channel
Google Cloud Tech
Published
Nov 21, 2026
Video
16:07
Read
4 min
Original
English
Open on YouTube
Scroll to read and the video shrinks to the bottom-right corner. Captions follow your reading language.
Reading languageAvailable in 2 languages
You're reading the original English.
SUMMARY

In 30 seconds

A prototype personal trainer gains sign-in and persistent data when Devin Chasanoff connects it to Firebase and Cloud Firestore. Gemini prepares the integration, then guides him through project creation, authentication providers, security rules and server access one step at a time. A seed script adds 41 exercises. He signs in with Google, accepts a four-day workout plan and checks that the user profile, conversation and plan appear in Firestore.

  1. 1Check the agent's environment before integrating the databaseChasanoff asks Gemini whether the workspace needs any skills or MCP servers for Firestore. Gemini finds the guidance is already installed.
  2. 2Ask for one Firebase setup step at a timeAfter Gemini prepares the integration, he asks it to guide him through creating the missing project, with each step confirmed before the next.
  3. 3Turn on sign-in and create Firestore in production modeHe enables email/password and Google sign-in, creates the database and then publishes the access rules supplied by Gemini.
  4. 4Seed the database and verify a real sign-inA script populates 41 exercises; a Google login and server logs show the session and profile connected to Firestore.
  5. 5Follow a generated workout into the databaseThe trainer produces a four-day plan. After accepting it, Chasanoff checks the app's weekly view and locates the saved plan in Firestore.

Takeaways

  1. Ask the coding agent what project-specific guidance or tools it needs before integrating a backend.
  2. Request one setup step at a time and confirm each result before continuing.
  3. Enable the sign-in providers the application needs, then publish database rules that restrict who can read and write.
  4. Test a real login and a representative user workflow, then inspect the database for the resulting records.
FULL TEXT

Read the edited text by chapter

Transcript only
01

Prepare Gemini for the Firestore integration

The trainer app has a frontend and an implementation plan. Chasanoff checks whether the coding agent needs additional instructions or tools, then asks it to implement Firebase authentication and database access.

Our smart personal trainer already has a frontend and an implementation plan. The next step is to connect a database, using Cloud Firestore, and let users authenticate.

In the Google Antigravity workspace, I start by asking Gemini whether I should install any skills or MCP servers before connecting Firestore. I want the agent to have the relevant guidance for setting up the backend. In my workspace, the needed instructions are already in place.

I return to the implementation plan and ask Gemini what remains. It identifies the real Firebase integration and authentication, so I ask it to proceed. When it asks whether a Firebase project and web credentials already exist, I choose the option that assumes they do, intending to set them up afterward.

Gemini spends about 14 minutes completing the integration and gives me a summary, verification results and instructions for adding web credentials to the local environment file. I have not actually created the Firebase project yet, so I ask it to walk me through the process one step at a time and wait for my confirmation after each step.

02

Create the Firebase project and register the web app

Gemini provides setup instructions one at a time. Chasanoff creates the project, registers a web app and copies its configuration into the local environment file.

I open the Firebase console, create a project called AI trainer app and leave Google Analytics disabled for now. Once the project is ready, I tell Gemini and ask for the next step.

The next instruction is to register a web app and obtain its configuration values. I add a web app, give it a nickname and register it without setting up Firebase Hosting. I then fill the local environment file using Gemini's template and the values shown in the console.

03

Enable sign-in and protect Firestore data

Email/password and Google sign-in are enabled in the console. A production-mode database and published security rules control access to user data.

For authentication, Gemini directs me to enable email/password and Google providers. The console navigation is slightly different from its instructions, but I find Authentication under security, enable email/password and add Google sign-in with a support email.

Next I create a Cloud Firestore database. I choose the standard option, the default database ID and location, and start in production mode. Once it is created, the console shows the data, rules and indexes tabs.

Gemini supplies Firestore security rules for me to publish. I ask it to explain them first: the rules are server-side checks on database requests intended to restrict which users can read and write data. I replace the rules in the console and publish them.

04

Give the server access and seed exercises

A service-account key lets the server connect and verify tokens. Gemini runs an approved script that inserts 41 exercises into Firestore.

For server access, the walkthrough generates a Firebase Admin SDK service-account key. Chasanoff explains that the server uses this access to interact with Firestore and verify authentication tokens. The console downloads a JSON key file containing the credentials.

I am unsure how to put the key into the local environment file, so I ask Gemini. It offers either copying the file's contents or pointing to its path. I choose to paste the contents into the local environment file and tell Gemini it is done.

Gemini asks permission to run a seed script that fills the exercise repository used for workout recommendations. I approve it; the connection succeeds and the script adds 41 exercises to the Firestore exercises collection.

In the Firebase console, I inspect that collection. Each exercise has details such as its category, form tips and instructions, which the trainer can use when putting a workout together.

05

Test a login, workout and saved records

Chasanoff signs in through Google, asks the coach for a weekly schedule and accepts its plan. He inspects the database and finds the user's profile, chats and weekly plan.

I open the app to test authentication. The interface offers account creation, sign-in, equipment and preference settings. I select Google sign-in, approve the requested permissions and get into the app.

Before trying the coach, I ask Gemini to confirm the setup. It checks the server logs and reports that the Firebase ID token was verified, the session is authenticated and my profile is connected to Firestore.

Instead of following a prescribed test prompt, I ask the coach to make a weekly workout schedule. It takes a little time, then proposes a four-day muscle-building plan tailored to the dumbbells and adjustable bench I entered.

The proposal puts upper-body training on Monday and lower-body work on Tuesday, with sessions also on Thursday and Friday. I accept it and check that the app's weekly view reflects the plan.

Back in Firestore, I find a users collection with a document for my profile and weekly chats. At first I cannot see the workout plan or completed exercises and ask Gemini what happened.

Gemini says the storage is working, and in this case the mistake is mine: I only needed to scroll to find the weekly plan. The app has saved the data in the database. Gemini also commits the changes as a checkpoint for this stage.

The implementation roadmap still has more work. Deployment is likely the next step, when the app will be put online.

More from this channel

27:24EN
Google Cloud Tech· Nov 20, 2026A browser can run private AI search, but the device decides how muchAja Hammerly, Jason MayesJason Mayes explains local document search, model sizing and when a browser AI app should fall back to the cloud.Vector searchRAG & knowledgeModel routing & gateways+2
2 slides10:21EN
Google Cloud Tech· Nov 19, 2026Why AI applications use two kinds of graph—and when to skip themAnnie Wang · Google CloudA refund demo separates control of the work from retrieval of connected facts, while showing the cost of both.Agent orchestrationAI agentsWorkflow automation+1
4 slides15:19EN
Google Cloud Tech· Nov 17, 2026Give a Voice Agent Memory Without Sending Its Whole TranscriptLaxmi Harikumar, Miles Libbey · Google CloudA 40-word window and persistent facts cut classifier input in a Scribant demo while keeping user preferences across sessions.Agent memoryAgent engineeringAI agents+2
6 slides31:46EN
Google Cloud Tech· Nov 17, 2026Build an Inspector That Makes UI States Easy to TestDevin Chasanoff · Google CloudDevin Chasanoff isolates real components, adds state presets and turns the workflow into reusable agent skills.Agent skillsCoding agentsAI interface design+1
2 slides16:12EN
Google Cloud Tech· Nov 16, 2026Looker CLI Lets Agents Discover and Run Admin TasksChrissie Goodrich, Mike DeAngelo · Google CloudMike DeAngelo explains how command discovery and JSON templates let agents use Looker’s API without loading every tool description at once.Developer workflows & testingAgentsMCP+2
6 slides55:11EN
Google Cloud Tech· Nov 14, 2026A no-code AI app build: diagnose the system before asking for a fixDevin Chasanoff · Google CloudDevin Chasanoff builds a workout coach in stages, using tests and context tracing to fix an API connection and unintended plan changes.AI interface designSoftware engineeringDeveloper workflows & testing+2