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.
- 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.
- 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.
- 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.
- 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.
- 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
- Ask the coding agent what project-specific guidance or tools it needs before integrating a backend.
- Request one setup step at a time and confirm each result before continuing.
- Enable the sign-in providers the application needs, then publish database rules that restrict who can read and write.
- Test a real login and a representative user workflow, then inspect the database for the resulting records.
Read the edited text by chapter
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.
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.
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.
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.
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
10:21EN
15:19EN
31:46EN
16:12EN
55:11EN