Hackathons are famous for pushing developers to their limits, but the recent Google for Developers PromptWar (Challenge 2) threw in a constraint that completely changed my workflow: Build a multimodal AI agent, but keep the GitHub repository strictly under 1MB.
Oh, and you were only allowed a single main branch.
Here is a technical breakdown of how I designed, built, and deployed an Interactive Election Assistant using Google Antigravity, Gemini 1.5 Pro, and Google Cloud Run—ending up with a final push size of just 4.07 KB.
The Problem Statement
The challenge was to create an interactive assistant that helps users understand the election process and timelines. It needed to demonstrate:
Smart, dynamic assistance.
Logical decision-making based on user context.
Strict repository constraints (<1MB, 1 branch).
The Architecture & Tech Stack
To hit these goals without bloating the codebase, I went with a decoupled, serverless approach:
The Brain: Gemini 1.5 Pro (via Google Cloud Vertex AI).
The UI: Streamlit (perfect for fast data-driven UIs and rapid prototyping).
The IDE: Google Antigravity (using Intent-Driven "Vibe" Coding).
The Hosting: Google Cloud Run.
Key Technical Wins (How to beat the constraints)
- Surviving the 1MB Git Limit
In a previous project, a rogue venv folder blew up my repository to over 100MB, causing major deployment headaches. This time, I initialized a bulletproof Git setup before writing a single line of code.
By creating a strict .gitignore on minute zero, I ensured no virtual environments or cache files ever touched the tracking index:
"
venv/
pycache/
.env
.DS_Store"
The result: A fully functional AI application repository that weighed exactly 4.07 KB.
- Vibe Coding with Google Antigravity
Instead of manually typing out Streamlit boilerplate, I used the agentic features of Google Antigravity. I provided a highly detailed system prompt outlining my exact requirements:
A sidebar for contextual inputs (Age, State/City).
Dynamic logic (routing 18-year-olds to a "First-Time Voter" pipeline while blocking under-18s).
ARIA tags (help="") on every input for accessibility scoring.
Antigravity generated the core app.py and requirements.txt perfectly, allowing me to focus entirely on the cloud architecture rather than tweaking CSS or layout grids.
- Zero-Trust Security on GCP
A massive rookie mistake in open-source hackathons is hardcoding API keys. Pushing a .env file to a public GitHub repo is a guaranteed way to get your keys scraped in seconds.
To achieve a 100% security score, my app.py only checked for environment variables (os.getenv("GOOGLE_API_KEY")). But how does it run in production?
Instead of relying on config files, I injected the keys directly into the Google Cloud Run container at deploy time using the Cloud Shell:
"gcloud run deploy election-assistant \
--source . \
--port 8080 \
--region us-central1 \
--allow-unauthenticated \
--set-env-vars="GOOGLE_API_KEY=my_secure_api_key"
The GitHub repo stays perfectly clean, the AI evaluator gives full points for security practices, and the live application fetches the key directly from Google’s secure backend.
The Final Product
The resulting application instantly adapts to the user. If you select "17 Years Old," it blocks the voting timeline and explains future eligibility. If you select "18+," it generates an interactive, phase-by-phase guide to the election process, complete with a Gemini-powered chatbot to answer edge-case questions (like lost Voter IDs).
Takeaways
Building under strict constraints forces you to abandon sloppy habits. You can't rely on massive boilerplate templates when your limit is 1MB. You have to understand exactly what your code is doing, how your .gitignore works, and how to securely pass credentials in a serverless environment.
The build season never stops! Let me know in the comments how you typically handle secrets management in your fast-paced hackathon builds. 👇
Top comments (1)
GitHub Repo Link: github.com/dev-vrats/Election_Assi...