ข้ามไปยังเนื้อหาหลัก

Gemini 4 Hydrogen Tutorial: Build a Full-Stack App Using Gemini 4 Hydrogen and Antigravity CLI

A beginner-friendly guide to building, testing, and deploying an AI-generated application using MCP servers, agent skills, Next.js, Supabase, and Vercel.
· 14 นาที อ่าน

สำรวจด้วย AI

Google released Gemini 4 Hydrogen on November 12, 2026, a fast, low-cost model built for everyday coding and agentic workflows. I wanted to see how far it could get on a real build, so I gave it a single prompt and asked for a full-stack app.

The result is MindTrack, a CBT journaling app with separate patient and therapist dashboards. Gemini 4 Hydrogen, running through Google's Antigravity CLI, built, tested, and deployed it in under 5 minutes for $2.25 in API usage. It also left a few gaps, which I cover below.

The idea came from therapy itself. Therapists often recommend a daily journal, especially with cognitive behavioral therapy (CBT): you write down your thoughts, moods, and experiences during the week, then bring the notes to your next session. I wanted a web app where patients keep that journal and share chosen entries directly with their therapist, so the therapist can follow mood trends between appointments.

In this article, I'll show how to build and deploy an app with Gemini 4 Hydrogen and Antigravity CLI, covering setup, MCP servers and agent skills, the build prompt, and hands-on testing as both a patient and a therapist. You can also see our guides to the Antigravity CLI, agent skills, and Google AI Studio.

If you haven't used a command-line coding agent before, start with our Antigravity CLI tutorial. 

In a Nutshell

  • Model: Gemini 4 Hydrogen is Google's fast, cost-efficient model for coding and agentic work, priced at $1.50 per million input tokens and $7.50 per million output tokens.
  • Tool: Antigravity CLI connects to Gemini 4 Hydrogen with a Gemini API key from Google AI Studio.
  • Result: One prompt produced MindTrack, a deployed full-stack CBT journaling app, in under 5 minutes for $2.25.
  • Stack: Next.js, TypeScript, Tailwind CSS, Supabase, and Vercel, connected through MCP servers.
  • Caveat: The patient side worked well, the therapist side is limited, and the security policies still need independent testing.

What Is Gemini 4 Hydrogen?

Gemini 4 Hydrogen is Google's fast, cost-efficient model for everyday coding and agentic workflows, released on November 12, 2026.

It is adapted from Gemini 4 Carbon, the frontier model in the same family, and uses the model ID gemini-4-hydrogen, according to Google's model card.

It supports a 1-million-token context window and four thinking levels: low, medium, high (the default), and xhigh. Google prices it at $1.50 per million input tokens and $7.50 per million output tokens, flat across the full context window, as stated in its launch announcement.

It also scored 51 on the Artificial Analysis Intelligence Index at its default high thinking level, slightly ahead of Gemini 4 Argon at 50. That balance of speed, cost, and intelligence makes it a practical choice for vibe coding on a budget.

For the full benchmark breakdown, see our Gemini 4 Hydrogen guide.

What We Are Building: MindTrack?

MindTrack is a CBT journaling platform we're going to build. Patients get a personal space to journal, track their moods, and complete structured CBT exercises. Therapists get a separate dashboard to view shared entries, follow mood patterns, and review progress over time.

  • Patients: Can create an account, write daily journal entries, track their moods, identify negative thoughts, and complete structured CBT thought records.
  • Therapists: Can access a separate dashboard to view assigned patients, read journal entries those patients have chosen to share, and monitor mood trends and progress over time.

The app uses Next.js, TypeScript, and Tailwind CSS for the application, Supabase for authentication and the PostgreSQL database, and Vercel for deployment.

For this experiment, I asked Gemini 4 Hydrogen to build the whole application, not just a few components.

The agent configures its own MCP servers, finds and installs the skills it needs, plans the app, builds the frontend and backend, sets up the database, writes and runs tests, pushes everything to GitHub, and deploys to Vercel.

I also want it to test the deployed website like a real user, rather than assume everything works because the deployment succeeded.

The challenge is simple: I won't write a single line of code or manually set up the project. I'll give the agent instructions and step in only when authentication or permission approvals are required. I won't set up the technologies individually either, so Gemini has to work out how to connect them.

Note: MindTrack is an educational prototype, not a clinically validated medical application. We'll use fictional patient data for development and testing.

Step 1: Install Antigravity CLI and Connect Gemini 4 Hydrogen

Antigravity CLI (the agy command) is Google's terminal-based coding agent and the successor to Gemini CLI. Before getting started, you'll need Node.js, Git, and Vercel CLI installed. You'll also need accounts for Google AI Studio, GitHub, Supabase, and Vercel.

First, open your terminal and install Antigravity CLI using the official installation script:

curl -fsSL https://antigravity.google/cli/install.sh | bash

Next, add Antigravity CLI to your system PATH:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Verify that the installation was successful:

agy --version

For this tutorial, I'm using version 1.5.12. Your installed version may differ.

Configure your Google AI Studio API key

Visit Google AI Studio, sign in to your Google account, and generate an API key.

We'll use this API key to access Gemini through Antigravity CLI instead of signing in with a Google account.

First, create the Antigravity configuration directory:

mkdir -p ~/.gemini/antigravity-cli

Then create the configuration file. Note: this command overwrites settings.json. If the file already exists, edit it to add "modelProvider": "gemini" instead.

cat > ~/.gemini/antigravity-cli/settings.json <<'EOF'
{
  "modelProvider": "gemini"
}
EOF

Next, enter your API key securely. If you use bash, run:

read -rsp "Enter your Gemini API key: " GEMINI_API_KEY
echo
export GEMINI_API_KEY

The -p option in that command only works in bash. If you use zsh, the default shell on macOS, run this instead:

read -rs "GEMINI_API_KEY?Enter your Gemini API key: "
echo
export GEMINI_API_KEY

Either way, this sets the API key for your current terminal session without saving it in your shell history. Antigravity CLI only checks that the key is not empty at startup, so an invalid key shows up on your first prompt. It also reads the key only from the environment variable, not from .env files.

Create the MindTrack project

Now create a project directory and launch Antigravity CLI:

mkdir -p mindtrack
cd mindtrack
agy

Antigravity CLI uses your API key because modelProvider is set to gemini, so it skips the Google account sign-in and opens directly. Setting GEMINI_API_KEY without that setting has no effect.

Select Gemini 4 Hydrogen

Inside Antigravity CLI, enter:

/model

Select Gemini 4 Hydrogen from the available models with medium reasoning.

Selecting Gemini 4 Hydrogen with medium reasoning in Antigravity CLI

Medium reasoning is a practical starting point for generating code, configuring tools, and implementing application features without using a higher reasoning budget than necessary.

You can switch to high for complex architecture decisions or difficult debugging tasks.

Step 2: Set Up MCP Servers and Agent Skills in Antigravity CLI

Model Context Protocol (MCP) servers give a coding agent access to external tools, such as GitHub or a database. Agent skills are instruction sets the agent loads only when it needs them.

Rather than set everything up manually, we'll ask Antigravity CLI to configure the MCP servers and install the required skills. For background, see our guides to MCP and agent skills.

Copy and paste the following prompt into Antigravity CLI:

Prompt:

Set up and configure the following MCP servers in Antigravity CLI using the latest official documentation:

- GitHub MCP: Repository creation and source-code management.
- Supabase MCP: Database management, authentication, and migrations.
- Vercel MCP: Project management, deployment, and logs.
- Context7 MCP: Retrieve the latest documentation for Next.js, Supabase, and Vercel.

Use npx skills find to discover relevant agent skills and npx skills add to install them, covering:

- Next.js and React best practices
- Creative frontend and modern UI design
- Tailwind CSS and responsive layouts
- Supabase authentication and database security
- Browser automation, testing, and accessibility

Automatically configure the MCP servers, install the most relevant skills, and verify that everything works. Use official sources and avoid unnecessary dependencies.

When authentication is required, provide the exact commands or initiate the OAuth login process, then ask me to complete authentication before continuing.

Do not expose credentials, create paid resources, or modify existing production projects. Keep responses concise to minimize Gemini API usage.

Once setup is complete, verify all MCP connections and installed skills, and report their status.

After submitting the prompt, Antigravity will search for the MCP servers and relevant skills, then begin configuring and installing them.

It may ask for permission to run installation commands. Review the commands and approve them if they are safe and expected.

Antigravity CLI searching for MCP servers and agent skills and asking permission to run installation commands

Once the setup is finished, type:

/mcp

This opens the MCP manager. Select each server one by one, press Enter, and follow the instructions to authenticate your GitHub, Supabase, Vercel, and Context7 accounts.

Authenticating the installed MCP servers one by one in Antigravity CLI

After authentication, check the installed skills by typing:

/skills

Installed agent skills listed in Antigravity CLI

You should now have the MCP connections and development skills ready to build MindTrack.

Step 3: Build and Deploy MindTrack With One Gemini 4 Hydrogen Prompt

With the MCP servers and skills configured, we're ready to build MindTrack. I'll give Gemini 4 Hydrogen a single prompt to handle everything from start to finish.

The agent plans the application, generates the code, configures Supabase, runs tests, creates a GitHub repository, and deploys the finished website to Vercel. I'll also ask it to test the deployed application so we can see whether it actually works.

Give Gemini one prompt to build everything

Copy and paste the following prompt into Antigravity CLI:

Build and deploy MindTrack, a full-stack CBT journaling application using Next.js, TypeScript, Tailwind CSS, Supabase, and Vercel.

The application should include:

- Patient dashboard: Daily journaling, mood tracking, CBT thought records, and journal history.
- Therapist dashboard: View assigned patients, access journal entries explicitly shared by patients, and track mood trends and progress.
- Authentication: Secure patient and therapist login using Supabase Auth.
- Database: Store journal entries, moods, and CBT records securely using Supabase PostgreSQL with row-level security.

Use Context7 for the latest documentation and installed skills for frontend design, Next.js development, security, and testing.

Complete the entire workflow automatically:

1. Plan the application and build the frontend and backend.
2. Create and configure the Supabase database and authentication.
3. Design a modern, responsive, and user-friendly interface.
4. Run tests, fix errors, and verify security and permissions.
5. Create a private GitHub repository and push the code.
6. Deploy the application to Vercel using MCP or CLI.
7. Test the live application as a user, including patient and therapist workflows, and fix any deployment issues.

Use fictional patient data only. Ensure therapists can access only records explicitly shared by patients. Do not add AI diagnoses or treatment advice.

Work autonomously from start to finish. Don't ask me to run commands manually.

Once everything is working, provide the live Vercel URL, GitHub repository link, and a short summary of the test results.

Do not claim success unless the deployed application has been verified. Clearly report anything that could not be tested.

Let the agent handle the development

After I submitted the prompt, Antigravity started working on the application. It explored the project files, checked the development environment, retrieved documentation through Context7, and began setting up the Next.js project.

Antigravity CLI exploring the project and using MCP tools and skills to start building

The agent occasionally needed permission to execute commands or access external services. It also required authentication or approval when creating resources on services such as Vercel.

Apart from those approvals, I didn't need to manually create the components, configure the database, or write deployment commands.

MindTrack is built and deployed

In my run, the agent built and deployed the application in under 5 minutes. It returned a summary of everything it had created, along with links to the deployed website, GitHub repository, and Supabase project.

Antigravity CLI summary after Gemini 4 Hydrogen built, tested, and deployed MindTrack

What surprised me was how much functionality it had included. The patient dashboard came with daily mood tracking, journal history, structured 7-column CBT thought records, and controls for sharing entries with therapists.

The therapist dashboard included assigned patients, shared journal entries, mood trends, and progress summaries.

The agent also reported implementing authentication, database-level access controls, and row-level security policies to keep private patient records separate from shared information.

GitHub repository and Supabase database

I opened GitHub to check whether the agent had actually created and pushed the project.

MindTrack source code in a private GitHub repository

And there it was: a private repository containing the Next.js application, source files, tests, and project configuration.

Next, I checked Supabase. The agent had created a new project and configured the database schema for the application.

MindTrack database tables and authentication in Supabase

The schema included tables for user profiles, therapist-patient assignments, mood logs, journal entries, and CBT thought records.

I didn't have to create these tables or write SQL migrations manually. The agent handled the setup through its connected tools.

Of course, having the database and security policies in place doesn't automatically mean every permission is correct. Those still need to be verified through testing.

Open the live MindTrack website

The final step was opening the deployed application to see what the agent had built.

You can check out the live version here:

Live app: https://mindtrack-pi.vercel.app/

Please don't enter real personal information into the live app. It is a public prototype with open sign-up, so anyone can create an account. Use the demo accounts or fictional data only.

MindTrack landing page deployed on Vercel

The website loaded successfully, with a clean landing page, a green-and-white design, and sections explaining daily journaling, CBT thought records, patient privacy, and therapist access.

It was great to see a complete application running on Vercel without having to manually configure the frontend, backend, and deployment.

The agent had also been instructed to test the live application. However, opening the landing page only confirms that the website is accessible. We still need to test the actual patient and therapist workflows to see how well everything works.

That's what we'll do in the next sections.

How Much Does It Cost to Build an App With Gemini 4 Hydrogen?

The entire MindTrack build cost $2.25 in Gemini API usage, at Gemini 4 Hydrogen's pricing of $1.50 per million input tokens and $7.50 per million output tokens.

That's only the AI model cost. I used the free tiers of Supabase, Vercel, GitHub, and all the other integrations, so there were no additional charges for the database, hosting, or deployment.

You can check your own API usage and charges in the Google AI Studio billing dashboard. Keep in mind that your costs may vary depending on the number of requests, debugging iterations, and thinking level.

Testing MindTrack as a Patient

While trying to create a new patient account, I ran into my first issue: Supabase returned an email rate-limit error. The built-in email service is meant for testing and allows only 2 emails per hour. You can raise that limit only by setting up a custom SMTP provider, as the Supabase rate limits documentation explains.

My guess is that the agent used up the allowance while setting up the demo patient and therapist accounts. Rather than waiting for the limit to reset, I tested the application using the demo accounts it had already created.

Thankfully, the login page has 2 convenient buttons: Fill Demo Patient and Fill Demo Therapist. I clicked Fill Demo Patient, which automatically entered the demo credentials, and signed in.

Signing in to MindTrack as a demo patient

Once logged in, I was taken to the patient dashboard, which has 4 main sections:

  • Overview & Mood
  • Daily Journal
  • CBT Thought Records
  • Care Team

I started with Overview & Mood. Here, you can record your daily mood on a scale of 1 to 10, select how you're feeling, rate your energy level, and add notes about anything that might have affected your mood.

The dashboard also displays a mood trend chart showing your recent check-ins and average mood score. Since the demo account already had some records, I could immediately see how the chart worked.

MindTrack patient dashboard with mood overview and mood trend chart

Next, I opened the Daily Journal tab to see if I could create and manage journal entries.

The form lets you add a title, write about your experiences, assign a mood score, and include tags to organize your thoughts. I tried writing an entry about finding it difficult to socialize.

One feature I particularly liked was the option to keep an entry private or share it with your therapist. There's a simple checkbox for this, so you can decide what you want your therapist to see.

On the right, you can view your journal history, search through previous entries, and delete records. Each entry also shows whether it's private or shared.

MindTrack daily journal entry form with a private or shared option

After that, I moved to the CBT Thought Records section, which is a little different from regular journaling.

This section guides you through a structured CBT exercise rather than free writing. You start by describing a situation, identifying your automatic thoughts, and recording your emotions and their intensity.

Then, you can identify cognitive distortions, provide evidence for and against your thoughts, and come up with a more balanced perspective.

For example, I entered a situation where I felt that my sister wasn't listening to me. I added my automatic thought, selected anger as the emotion, and started filling in the supporting evidence.

On the right, I could also see previous thought records, including the original thoughts, balanced alternatives, and changes in emotional intensity.

I like this feature because it gives patients a more structured way to reflect on their thoughts than a daily journal alone.

MindTrack CBT thought record entry form

Finally, I checked the Care Team section.

This is where patients can manage their connections with therapists. You can see the available therapists, connect with one, or revoke access if you no longer want to share your information with them.

In my demo account, Dr. Jordan Vance was already connected, and there was an option to revoke access.

The idea is that patients remain in control of their information, while therapists can only access the journal entries and CBT records that patients explicitly choose to share.

MindTrack Care Team tab showing the connected therapist

Testing MindTrack as a Therapist

Next, I switched to the therapist account to see how the application works from the other side.

I used the Fill Demo Therapist option on the login page and signed in as Dr. Jordan Vance.

The therapist dashboard is quite simple compared to the patient dashboard. On the left, there's a list of assigned patients, and on the right, you can see their shared mood trends, average mood scores, and CBT progress.

In my case, the demo therapist was connected to Maya Lin, the same patient account I had just tested.

What I liked was that the dashboard only showed information the patient had explicitly shared. Private mood check-ins and journal entries were hidden, at least as indicated by the interface.

I could also see Maya's shared average mood score of 6.5/10, along with an average CBT emotional intensity reduction of 38%.

Signing in to the MindTrack therapist workspace and reviewing the dashboard

Scrolling down, I could see the patient's shared journal entries and CBT thought records.

For example, one journal entry was about reframing work feedback, where the patient had reflected on jumping to conclusions after receiving a comment.

The CBT thought records were the most useful part. I could see the situation, automatic thought, cognitive distortion, balanced thought, and how the intensity of the emotion had changed.

One record showed anger decreasing from 70% to 40% after completing the exercise. Another showed anxiety dropping from 80% to 35%.

This is exactly the kind of information I originally wanted therapists to be able to access. Rather than waiting for the next appointment and relying on patients to remember everything, therapists could review the reflections patients had chosen to share.

MindTrack therapist dashboard with shared journal entries and CBT thought records

However, I found the therapist side a bit limited compared to the patient dashboard.

It does a good job of displaying shared information, but there isn't much else a therapist can do. For the next iteration, I'd like to add more detailed patient profiles, better progress visualizations, session notes, and perhaps a way for therapists to give feedback on shared CBT thought records.

Final Thoughts

Gemini 4 Hydrogen built, tested, and deployed a working full-stack app from a single prompt in under 5 minutes, for $2.25 in API usage. The patient side held up well in my testing. The therapist side was thinner, and the row-level security policies still need testing beyond what the interface shows.

The model wrote the code, but deciding what to build and checking that it's secure was still my job. That's where I'd spend my time with an agent like this: planning the application, choosing the right tools, writing clear prompts, and evaluating the results. The model and its agent harness handle most of the implementation.

For the next iteration, I'd like to improve the UI, create a proper logo, expand the therapist dashboard, and strengthen the privacy and security controls.

If you're keen to learn more about building apps with AI coding agents, I recommend checking out our Vibe Coding with Replit course.

Gemini 4 Hydrogen FAQs

What is Gemini 4 Hydrogen?

Gemini 4 Hydrogen is Google's fast, cost-efficient model for everyday coding and agentic workflows, released on November 12, 2026. It is adapted from Gemini 4 Carbon and supports a 1-million-token context window. Our Gemini 4 Hydrogen guide covers its benchmarks and pricing in detail.

How do I use Gemini 4 Hydrogen with Antigravity CLI?

Install Antigravity CLI, add "modelProvider": "gemini" to ~/.gemini/antigravity-cli/settings.json, and export your Google AI Studio key as GEMINI_API_KEY. Then run agy and choose Gemini 4 Hydrogen with the /model command.

How much does Gemini 4 Hydrogen cost?

Gemini 4 Hydrogen costs $1.50 per million input tokens and $7.50 per million output tokens on the paid API, flat across its 1-million-token context window. It is also available on a rate-limited free tier in the Gemini API and Google AI Studio. Building MindTrack cost me $2.25 in API usage.

How does Gemini 4 Hydrogen compare with Gemini 4 Argon and Carbon?

Gemini 4 Carbon is the frontier model for the hardest tasks, and Gemini 4 Argon is a larger general-purpose model. Gemini 4 Hydrogen is built for faster, cheaper execution, and it scores 51 on the Artificial Analysis Intelligence Index at its default high thinking level against 50 for Argon.

Can Gemini 4 Hydrogen build a full-stack app on its own?

In my test, it built, tested, and deployed MindTrack from one prompt in under 5 minutes, with me approving permissions and authentication along the way. The patient workflows worked, but the therapist dashboard was limited and the security policies still need independent testing. MindTrack is a prototype that uses fictional data, so don't enter real personal information.

What thinking levels does Gemini 4 Hydrogen support?

Gemini 4 Hydrogen supports four thinking levels: low, medium, high (the default), and xhigh. Higher levels improve results on harder tasks but increase latency and token usage, so start with medium or high and move up only when a task needs it.

Abid Ali Awan

ผู้เขียน

Abid Ali Awan

As a certified data scientist, I am passionate about leveraging cutting-edge technology to create innovative machine learning applications. With a strong background in speech recognition, data analysis and reporting, MLOps, conversational AI, and NLP, I have honed my skills in developing intelligent systems that can make a real impact. In addition to my technical expertise, I am also a skilled communicator with a talent for distilling complex concepts into clear and concise language. As a result, I have become a sought-after blogger on data science, sharing my insights and experiences with a growing community of fellow data professionals. Currently, I am focusing on content creation and editing, working with large language models to develop powerful and engaging content that can help businesses and individuals alike make the most of their data.

หัวข้อ

ที่เกี่ยวข้อง