Introduction to Google Gemini AI-Assisted Web Development for Beginners
A Quick Note on "Magic Spells": In software engineering, the reusable blocks of text in this guide are called structured prompt templates (or context-priming instructions)—specifically designed to configure the AI's behavior, project parameters, and MCP tool orchestration. Because copying and pasting these exact phrases summons complex automated setups behind the scenes, we will playfully refer to them as "Magic Spells" throughout the rest of this tutorial.
1 Subscribe to "Google AI Pro"
Visit https://one.google.com/ai, or go to https://gemini.google.com/ and navigate to Settings > Upgrade.
Note: You must use a personal Gmail account, and the account holder must be 18 years or older. An older, well-established Gmail account is preferable - if your Gmail account is less than 10 years old, it may trigger an identity verification process.
2 Download, Install & Sign In to Google Antigravity
Download the Antigravity application from https://antigravity.google/. Install the app, launch it, and sign in with your Google AI Pro account.
3 Configure Antigravity Permissions
Open Settings > General > Permissions > This Computer and select Turbo from the dropdown menu.
4 Quit Antigravity Completely & Restart as Administrator
The Setup Magic Spell installs (or upgrades) the Hearth Portable Web Server as a background Windows Service, which requires Windows Administrator permission.
5 Cast the Setup Magic Spell (2-in-1 Install + Upgrade Prompt)
Start a + New Conversation in Antigravity. Select Gemini 4 Neon (Low) as your model, and verify that the permission mode is set to Turbo.
Choosing a model: Gemini 4 Neon (Low) is recommended as your everyday default. It is the most capable model while keeping thinking effort low to balance quality and quota usage. For very complex coding and reasoning tasks, you can raise Gemini 4 Neon's thinking effort (Medium, High, or Extra High), though it will use up your quota faster. Gemini 4 Carbon is a high-end model for complex tasks, and Gemini 4 Hydrogen is the lightest, fastest, and most cost-efficient option if you want to conserve your usage quota.
Copy and paste The Setup Magic Spell below into the chat box. You can run this exact same prompt on Day 1 for a brand-new PC, and run it again anytime in the future to upgrade your tools to the latest release without wiping your existing websites or saved FTP accounts:
Perform a 2-in-1 fresh installation or safe version upgrade of my AI web development environment:
1. Global AI Behavior Tuning:
Create or update %USERPROFILE%\.gemini\config\AGENTS.md (UTF-8 without BOM). Add or keep rules to:
- Always read entire source files in full by omitting StartLine and EndLine; never micro-slice files into small line ranges.
- When investigating across multiple files, read all related files in parallel in a single turn to build a complete holistic understanding.
- Keep source files modular and under ~600 lines when practical so each file can be read in full in a single call.
2. Check, Download & Upgrade Tools in C:\tools\:
Check the latest GitHub release version against any existing local installation for each tool below (install if missing, upgrade if a newer release exists, or skip download if already on the latest version):
- Hearth Portable Web Server (choose the zip with "Bundled-PHP-Python-NodeJS" in its name; ships with both HearthPortableWebServer.Manager.exe and mcp-webserver.exe):
https://github.com/ASP-NET-Web-Forms-Club/Hearth-ASPNET-Server/releases/latest -> C:\tools\hearth-web-server\
- MCP-Browser:
https://github.com/adriancs2/MCP-Browser/releases/latest -> C:\tools\mcp-browser\
- MCP-SQLite:
https://github.com/adriancs2/MCP-SQLite/releases/latest -> C:\tools\mcp-sqlite\
- MCP-FTP:
https://github.com/adriancs2/MCP-FTP/releases/latest -> C:\tools\mcp-ftp\
Upgrade safety rules:
- Before extracting an update to Hearth, back up C:\tools\hearth-web-server\manager_sites.json if it exists, stop HearthManagerService if running so files are not locked, extract the update, and restore my backed-up manager_sites.json. If this is a brand-new install with no prior user sites, initialize manager_sites.json as an empty JSON array [] (do NOT create any sample or default websites yet).
- When upgrading MCP-FTP, preserve the existing C:\tools\mcp-ftp\profiles\ folder so saved FTP accounts and encrypted passwords are never overwritten.
- Ensure the root folder C:\www\ exists (leave it empty if new; do not create any website yet).
3. Verify & Configure Bundled Runtimes in User PATH:
Test whether python, pip, and node work from any directory via python --version, pip --version, and node --version (ignore the Microsoft Store WindowsApps stub). For each one that does not work, add the bundled Hearth runtime path to the User PATH environment variable (skip any that already work):
- C:\tools\hearth-web-server\runtimes\python
- C:\tools\hearth-web-server\runtimes\python\Scripts
- C:\tools\hearth-web-server\runtimes\node
4. Verify & Install All 4 MCP Servers in Antigravity:
Create or merge the following entries into %USERPROFILE%\.gemini\config\mcp_config.json (UTF-8 without BOM, preserving any other existing MCP servers):
- "mcp-webserver": command "C:\\tools\\hearth-web-server\\mcp-webserver.exe", args []
- "mcp-browser": command "C:\\tools\\mcp-browser\\MCP-Browser.exe", args []
- "mcp-sqlite": command "C:\\tools\\mcp-sqlite\\MCP-SQLite.exe", args []
- "mcp-ftp": command "C:\\tools\\mcp-ftp\\mcp-ftp.exe", args []
5. Verify & Install Hearth Windows Service + Desktop Shortcut:
- First check whether this session is already running with Administrator (elevated) privileges:
* If ALREADY running as Administrator, proceed directly to install/update and start the service without interrupting me.
* If NOT running as Administrator, pause and explain to me in plain beginner-friendly language BEFORE running the elevated command that a Windows permission window ("User Account Control - Do you want to allow this app to make changes to your device?") will pop up on screen (or blink on the taskbar) and that I should click "Yes" to continue.
- Install (or update) and start the Windows Service "HearthManagerService" with BinaryPathName:
"C:\tools\hearth-web-server\HearthPortableWebServer.Manager.exe" --service
and StartupType: Automatic.
- Confirm HearthManagerService status is Running.
- Create a shortcut on the Desktop named "Hearth Server Manager" pointing to C:\tools\hearth-web-server\HearthPortableWebServer.Manager.exe.
- Report a clear summary of installed/upgraded versions and service status. Do NOT create any website yet.
6 Restart Antigravity Normally & Verify All 4 MCP Tools
Once The Setup Magic Spell completes, quit Antigravity from the system tray (right-click the tray icon > Quit) and reopen Antigravity normally. Administrator permission is no longer needed for everyday web development!
Start a + New Conversation and enter this quick verification check:
Are you able to see mcp-webserver, mcp-browser, mcp-sqlite, and mcp-ftp?
- If the AI answers "No", restart your computer once so Windows applies the updated
PATHenvironment variables, then test again. - If the AI answers "Yes", your development machine is 100% ready!
7 Begin Your Web Development Project (The 3 Project Magic Spells)
There are 3 main magic spells (prompts) involved in building and publishing your web projects:
Tells the AI to use our specific technology, system architecture, and engineering patterns (provided below).
Tells the AI your project name, optional FTP hosting details, and optional local project folder.
Publishes and syncs your website files to your live web server whenever you are ready.
Explanation in a Nutshell
-
The Tech Stack:
- Tells the AI to use specific technology, system architecture, and engineering patterns.
- This exact text is provided for you right below in this tutorial.
-
Your Project Info:
- Your project name: Any name related to your project, such as
personal-blog,shop website,billing, orstock inventory. - Online web server or shared hosting FTP info (optional when developing locally; needed when you want to publish online).
- Your project folder on your computer (optional): If omitted, the default location is automatically
C:\www\{your-chosen-project-name}.
- Your project name: Any name related to your project, such as
Important: The First Spell (Tech Stack) and the 2nd Spell (Your Project Info) are cast together in the same prompt!
First Spell: The Magic Spell for the Tech Stack
This is a specially arranged combination of local tech stack and tools designed to work in orchestration with you for developing and deploying web applications. Follow these standards throughout this conversation:
Core Web Tech Stack:
php, sqlite (high concurrency: wal mode, sync normal, temp=ram, foreign key off, busy time 10s, transaction BEGIN IMMEDIATE), universal OS font Segoe UI, icon=local host font awesome. Sqlite db auto-created inside /App_Data/ (use "local.db" on localhost/127.0.0.1 and "prod.db" on live server; auto-generate .htaccess & web.config in /App_Data/ to deny public download). Save all code and config files as standard UTF-8 without BOM.
Auto-upgrade the SQLite schema on startup: track the schema version with PRAGMA user_version and apply only the new changes in order (new tables, new columns, indexes), so an existing prod.db on the live server is upgraded without losing data. Never require deleting the database.
Local runtimes: python, pip, and node.js are already installed and available in user PATH for running scripts or custom tasks.
Code structure: keep files modular and under ~600 lines each (split by logical responsibility: shared DB/layout, page views, API endpoints, CSS, and JS, without over-fragmenting). Place page-specific CSS in /assets/css/<page>.css and static JavaScript in /assets/js/<page>.js (loaded with ?v=<?= filemtime(...) ?> using the filesystem path for cache busting) instead of inlining large <style> or <script> blocks in .php files. If JS needs initial PHP values, pass only a tiny JSON config object inline (e.g., window.APP_CONFIG) or fetch via API.
Orchestrated MCP Tools:
- mcp-webserver: Responsible for hosting local live development (Hearth Portable Web Server) and managing multi-project profiles. Each project uses the Project Name (<name>) mapped to local folder C:\www\<name> (unless a custom Project Folder is specified) and an auto-assigned localhost port.
- mcp-browser: Specialized AI-controlled browser capable of screenshots, console checks, and custom JavaScript execution for debugging and diagnosis. Always test and verify every feature you build or update in mcp-browser before finishing.
- mcp-sqlite: Convenient tool to inspect and work directly with the SQLite database (/App_Data/local.db).
- mcp-ftp: Convenient tool for cPanel / shared hosting FTP operations and automation with multi-profile support (note: mcp-ftp tools and C:\tools\mcp-ftp\profiles\*\ftp_config.json use snake_case keys: profile_name, host, port, security_mode, username, local_folder, remote_folder, website_url; never expose password_protected). Keep profile_name identical to the Project Name (<name>), mapped to local_folder, with exclude rules protecting App_Data/local.db and dynamic user content folders (such as uploads/). Never ask for FTP passwords in chat - call ftp_create_profile (with show_ui: true and snake_case fields profile, local_folder, host, port, security_mode, username, remote_folder, website_url, excludes) to open mcp-ftp's local dialog pre-filled so I can enter the password safely.
Project Safety Guardrails (Mandatory Step-0 Pre-Flight Audit Before Touching Any Files):
1. Always Inspect All 3 Sources First: Before creating folders, registering profiles, or writing/modifying any code, ALWAYS inspect mcp-webserver (webserver_list_sites: snake_case keys name, port, url, status, root), mcp-ftp (ftp_list_profiles and C:\tools\mcp-ftp\profiles\*\ftp_config.json: snake_case keys profile_name, host, port, security_mode, username, local_folder, remote_folder, website_url), and the existing folders inside C:\www\.
2. When Starting a NEW Project:
- Check for BOTH exact collisions AND ambiguous/similar lookalike names (e.g., spaces vs. hyphens like "stock inventory" vs "stock-inventory", case differences, or partial matches) across mcp-webserver sites (name / root), C:\www\ folders, and mcp-ftp profiles (profile_name / local_folder).
- If FTP details are provided, also check whether another existing mcp-ftp profile already targets the same host / remote_folder / website_url, or if the target local_folder already contains files.
- If ANY exact match, lookalike ambiguity, non-empty folder, or duplicate FTP target is found: STOP immediately, show me what already exists, and ask for my explicit confirmation before doing anything.
3. When CONTINUING an Existing Project:
- Verify that the specified Project Name / Folder actually exists. If no exact match exists (for example, a typo or space/hyphen difference like "stock inventory" vs "stock-inventory"), NEVER silently create a new empty folder! Instead, STOP, list the closest existing project(s) found on this PC, and ask me to confirm which one I meant.
- Verify 3-way alignment: confirm that the local project folder, the mcp-webserver site root, and the matching mcp-ftp profile's local_folder all point to the exact same directory (warn me immediately if any of them mismatch).
4. Upload / Sync Confirmation Gate:
- Whenever I say "Upload the files to web server" or "sync the files to the web server" (or ask to deploy/upload), inspect the project's mcp-ftp profile first (profile_name, local_folder, website_url, remote_folder, and host), display a clear pre-flight summary (Project Name, Local Folder, Target Live Website URL / FTP Host), and wait for my "Yes" before running ftp_sync. On a brand-new project's very first sync, list remote files first and warn me if another website already exists in that remote_folder.
To Begin:
- Run the Mandatory Step-0 Pre-Flight Audit above first!
- If I ALREADY provided my Project Info below and every pre-flight check passes cleanly with zero ambiguity: set up or load the project in mcp-webserver (and open the pre-filled mcp-ftp dialog if FTP info is supplied and not yet saved), then proceed with my build/update request (or ask what to build if no requirements were included yet).
- If I have NOT provided a Project Name yet: do not write code yet - display any existing projects found in a numbered list (Project Name, Local Folder, Localhost URL, Status, and Live Website URL) and guide me to pick one or provide a new Project Name, optional FTP info, and what I want to build.
- Occasionally remind me where I can view this web project full-screen by copying its local URL (e.g., http://localhost:8090) into a web browser (Chrome, Firefox, Edge, etc.).
2nd Spell: Examples of Your Project Info
Option A: Basic Minimum (Local Development Only)
Project Info:
- Project Name: stock inventory
Notice above that no FTP information is supplied. FTP is only required when you want to upload files to your live online web server. You can obtain your FTP details anytime from your web hosting administration panel (such as cPanel Linux shared hosting).
Option B: Full (Local Development + Online Upload)
Project Info:
- Project Name: stock inventory
- Website: https://www.example.com
- FTP Host: ftp.example.com
- FTP Port: 21
- FTP Security: Explicit FTPS
- FTP Username: example@example.com
By default, the AI automatically creates and saves your project files inside C:\www\{project-name}. In this example, your project folder will be:
C:\www\stock inventory\
Or you can also manually specify a custom project folder:
Option C: Full + Specify Custom Project Folder
Project Info:
- Project Name: stock inventory
- Website: https://www.example.com
- Project Folder: C:\www\stock inventory\
- FTP Host: ftp.example.com
- FTP Port: 21
- FTP Security: Explicit FTPS
- FTP Username: example@example.com
When you include FTP info (Option B or Option C), the AI agent will automatically pop up the secure local dialog window below pre-filled with your details, leaving you to simply fill in your FTP Password, click Test Connection, and click Save Profile:
8 Recap: Combining Both Spells & Building Your Application
Whenever you want to start a new project or continue a project in a "+ New Conversation", paste both magic spells together at the start of the conversation:
To Start a New Project:
I want to start a new project.
{paste magic spell - tech stack}
{paste project info}
Project Requirements:
{paste project requirements}
To Continue a Project in a "+ New Conversation":
I want to continue a project.
{paste magic spell - tech stack}
{paste project info}
Project Requirements:
{paste project requirements}
After casting the magic spells above, simply tell the AI what website or application you want to build or update!
Examples of Starting a New Project
Personal Blog
Project Requirements:
I want to build a personal blog. It should have a homepage listing recent posts, individual post pages, and a simple about page. I'd like to write posts in Markdown, and the design should be clean and mobile-friendly. Add sample data.
Coffee Shop Billing System
Project Requirements:
Build a coffee shop billing system. Staff should be able to pick menu items, set quantities, apply a discount, and generate a printable receipt with tax. It should also keep a daily record of sales. Add sample data.
Stock Inventory System
Project Requirements:
I need a stock inventory system. It should track items with quantities and prices, let me record stock coming in and going out, and warn me when an item runs low. A simple search and a summary of current stock would be helpful too. Add sample data.
Examples of Continuing a Project in a New Conversation
Personal Blog
Project Requirements:
I'm continuing work on my personal blog. The basic pages and Markdown posts already work. Now I'd like to add tags and categories, a search bar, and an RSS feed. Please review the existing code first and keep the current style. Add sample data.
Coffee Shop Billing System
Project Requirements:
I'm continuing my coffee shop billing system, which already handles orders and receipts. Next I'd like to add a sales report (daily and weekly totals), a best-sellers list, and an option for staff to edit menu items and prices. Please build on the existing code. Add sample data.
Stock Inventory System
Project Requirements:
I'm continuing my stock inventory system, which already tracks items and stock movements. Next I'd like to add supplier details, a reorder list generated from low-stock items, and CSV export of the inventory. Please check the existing structure before making changes. Add sample data.
Tip for continuation prompts: Because your Project Info gives the AI your exact project name and folder (C:\www\{project-name}), Antigravity will read your existing project files directly from disk. If you ever reference external files outside your project folder, let the AI know their file paths so it never has to guess the current state.
What Is Happening Behind the Scenes? (How the AI Manages & Displays Your Projects)
Assuming this is the Project Info that you supply:
Project Info:
- Project Name: stock inventory
- Website: https://www.example.com
- FTP Host: ftp.example.com
- FTP Port: 21
- FTP Security: Explicit FTPS
- FTP Username: example@example.com
In summary, here is what the AI automatically does behind the scenes:
- First, it checks any existing settings on your computer that appear to match
stock inventory. -
If the project does not exist yet:
- Automatically creates a new project folder at
C:\www\stock inventory. - Automatically adds a new website entry in Hearth Portable Web Server (via
mcp-webserver). - Automatically assigns an available local port number (such as
8090,8091,8092, or8093- whichever is free). - Automatically creates a matching FTP profile named
stock inventoryand pops up the local dialog window for you to key in your FTP password.
- Automatically creates a new project folder at
-
If another similar or ambiguous project name already exists (for example:
my-stock,simple-stock-inventory, orinventory system):- Stops immediately and asks you for clarification so it never modifies or overwrites the wrong project by mistake.
-
If the project is a 100% match (when continuing an existing project):
- Immediately loads and works on that exact project folder.
- Uses the matching
stock inventoryFTP profile whenever you upload files to your live web server.
How to View Your Web Project in Your Browser
Each project is assigned its own unique local port number so you can test multiple websites on your computer without conflicts. At any time, you can ask the AI: "What is the local port number of this web project?"
For example, if your project's local port number is 8090, open your favorite web browser (Chrome, Firefox, Edge, etc.) and enter the URL directly in the address bar for a full-screen view:
http://localhost:8090
9 Upload & Deploy to the Internet (3rd Magic Spell)
When you feel it is time to deploy/publish your work to the internet, you can simply say:
Upload the files to web server
or:
sync the files to the web server
Why is App_Data/local.db excluded automatically? Your computer uses local.db for safe testing, while your live web server automatically maintains its own real customer database (prod.db). Excluding local.db ensures uploading code updates will never overwrite your live data!
Download and Backup the Whole Site
When downloading or backing up your whole site, supply the destination folder path where you want to save the backup. It is strongly recommended NOT to save backups inside your active project folder - instead, save to a dedicated backup folder such as one of the following:
C:\backups\stock inventory\D:\backups\stock inventory\D:\web-projects-backup\stock-inventory\
Download and backup the whole site to this folder: D:\backups\stock inventory\
10 When to Stay in the Current Chat vs. Start a "+ New Conversation"
Each conversation has a context length limit, although it is not directly visible because Antigravity manages it automatically behind the scenes. Currently, the context window is 1 million tokens, which is considerably long.
As your default, you can comfortably continue working in the same conversation thread until you run into one of the situations below. Knowing when to keep replying in the same chat and when to start a + New Conversation keeps the AI accurate, fast, and gentle on your usage quota.
Stay in the Current Conversation When
- You are tweaking, fixing, or polishing what the AI just built (such as adjusting a layout, fixing an error, or saying
sync the files to the web serverright after testing). - The conversation is still focused on the current feature.
Start a "+ New Conversation" When
- You finished one feature (e.g., billing) and want to build a separate sub-system (e.g., membership).
- You want to switch to a different website project.
- The current chat has become very long with many back-and-forth replies (long chats re-send the entire history on every message, using more quota and slowing focus).
- The AI gets stuck repeating a mistake - a fresh conversation gives it a clean slate.
Starting a "+ New Conversation" never deletes your project! All of your website files and databases stay safely stored in C:\www\<project-name>. Just paste the Tech Stack + Your Project Info spells into the new conversation and pick up right where you left off!