<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Haseeb's Tech Journal]]></title><description><![CDATA[A personal tech journal where I share my projects, learning experiences, and experiments in Artificial Intelligence, Generative AI, Cloud Computing, Python, and]]></description><link>https://haseeb-tech.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 24 Oct 2026 02:58:48 GMT</lastBuildDate><atom:link href="https://haseeb-tech.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building Gemini Reflection Journal: A Secure AI Journaling App with Gemini, Firebase & Cloud Run]]></title><description><![CDATA[Building a secure AI journaling app with Gemini, Firebase Authentication, Firestore and Google Cloud Run.]]></description><link>https://haseeb-tech.hashnode.dev/building-gemini-reflection-journal-a-secure-ai-journaling-app-with-gemini-firebase-cloud-run</link><guid isPermaLink="true">https://haseeb-tech.hashnode.dev/building-gemini-reflection-journal-a-secure-ai-journaling-app-with-gemini-firebase-cloud-run</guid><category><![CDATA[google cloud]]></category><category><![CDATA[gemini]]></category><category><![CDATA[Firebase]]></category><category><![CDATA[cloud run]]></category><category><![CDATA[generative ai]]></category><dc:creator><![CDATA[Syed Haseebullah Hussaini]]></dc:creator><pubDate>Wed, 26 Aug 2026 16:15:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/d01e4a4c-adaa-4f42-a9b6-1cce1c8f1a58.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction:</h2>
<p>AI becomes far more useful when it can work with personal context while still keeping user data secure. That idea inspired me to build <strong>Gemini Reflection Journal</strong>, a secure, user-authenticated AI journaling application that combines personal reflection with generative AI.</p>
<p>The application allows users to sign in securely, write private journal entries, optionally record their mood, and receive thoughtful AI-powered reflections from <strong>Gemini</strong>. Entries are stored separately for each authenticated user, allowing reflection history and mood trends to remain available across sessions.</p>
<p>The project brings together <strong>Firebase Authentication</strong>, <strong>Cloud Firestore</strong>, the <strong>Gemini API</strong>, and <strong>Google Cloud Run</strong> to create a production-deployed AI application with authentication, persistent storage, and server-side AI integration.</p>
<p>In this article, I'll walk through what I built, how the different Google Cloud and Firebase services work together, and some of the features I added to turn the original concept into a more complete reflection experience.</p>
<p><strong>#AccelerateAIwithCloudRun</strong></p>
<h2>What I Built:</h2>
<p><strong>Gemini Reflection Journal</strong> is a personal AI reflection workspace designed around three ideas: privacy, continuity, and useful AI-assisted reflection.</p>
<p>After signing in with Google, each user gets an isolated journaling space where they can create entries and continue multi-turn reflections with Gemini. Instead of generating a single response and forgetting it, the application preserves the conversation as part of the journal entry so users can return to their previous reflections.</p>
<p>I also extended the application with optional <strong>mood tracking</strong>. Users can select from Positive, Calm, Motivated, Neutral, Stressed, or Confused before submitting a reflection. These self-reported moods are stored with the journal entry and used as additional context for Gemini.</p>
<p>The <strong>Reflection History</strong> page brings everything together with saved entries, search, mood filters, mood badges, and a Recent Mood Insight section that summarizes the user's recently logged moods. These insights are intentionally presented as personal reflection trends rather than medical or diagnostic information.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/954534be-539a-4eb9-aec9-3fec374e6338.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/d3d3400a-a29c-4ac7-9523-050a9a245649.png" alt="" style="display:block;margin:0 auto" />

<p><em>Gemini Reflection Journal running as a deployed, authenticated AI application.</em></p>
<h2>Architecture &amp; Technology Stack:</h2>
<p>Gemini Reflection Journal uses a secure full-stack architecture where authentication, user data, AI generation, and deployment each have a clearly defined role.</p>
<p><strong>Firebase Authentication</strong> handles Google Sign-In and provides each authenticated user with a unique identity. This identity is used to keep journal data isolated between users.</p>
<p><strong>Cloud Firestore</strong> provides persistent storage for journal entries, conversation turns, mood information, and reflection history. User data is organized under owner-specific paths so that each account accesses its own journal collection.</p>
<p><strong>Gemini API</strong> powers the AI reflection experience. Journal content and optional mood context are sent through the application's server-side AI flow, allowing Gemini to generate relevant multi-turn reflections without exposing the Gemini API key in the browser.</p>
<p><strong>Google Cloud Secret Manager</strong> is used to securely manage the Gemini API credential rather than embedding the secret directly into the application's public source code.</p>
<p><strong>Google Cloud Run</strong> hosts the production application and provides the publicly accessible deployment. This brings the frontend, authenticated workflow, Firestore integration, and server-side Gemini functionality together in a scalable cloud environment.</p>
<p><strong>Technology Stack:</strong></p>
<ul>
<li><p>Frontend: React + TypeScript</p>
</li>
<li><p>Authentication: Firebase Authentication with Google Sign-In</p>
</li>
<li><p>Database: Cloud Firestore</p>
</li>
<li><p>AI: Gemini API</p>
</li>
<li><p>Secret Management: Google Cloud Secret Manager</p>
</li>
<li><p>Deployment: Google Cloud Run</p>
</li>
</ul>
<p>Architecture diagram:</p>
<p>User</p>
<p>↓</p>
<p>Google Sign-In</p>
<p>↓</p>
<p>Firebase Authentication</p>
<p>↓</p>
<p>Gemini Reflection Journal on Cloud Run</p>
<p>├──→ Cloud Firestore → Private journal history</p>
<p>|──→ Server-side Gemini API → AI-powered reflection</p>
<p>↑</p>
<p>Secret Manager</p>
<h2>Secure Authentication &amp; User Data Isolation:</h2>
<p>Security and user privacy were important parts of the application architecture. <strong>Firebase Authentication</strong> provides Google Sign-In, allowing users to access the journal through their own authenticated account.</p>
<p>After authentication, each user's journal entries are stored in <strong>Cloud Firestore</strong> under a user-specific path:</p>
<p><code>users/{userId}/journals/{journalId}</code></p>
<p>This structure keeps journal data associated with its authenticated owner and prevents different users' reflection histories from being mixed together.</p>
<p>Firestore security rules complement this structure by restricting access based on the authenticated user's identity. As a result, journal entries, conversation history, and self-reported mood information remain associated with the correct account.</p>
<p>Authentication also persists across sessions, creating a smoother experience while maintaining the separation between users.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/33581949-49d8-4966-9e67-6a3afac79206.png" alt="" style="display:block;margin:0 auto" />

<p><em>Authenticated reflection history with user-specific Firestore persistence and optional mood tracking.</em></p>
<h2>Gemini-Powered Multi-Turn Reflection:</h2>
<p>The core AI experience of Gemini Reflection Journal is powered by the <strong>Gemini API</strong>. Instead of treating journaling as a simple question-and-answer interaction, the application supports <strong>multi-turn reflection</strong>, allowing users to continue exploring the same thought through follow-up responses.</p>
<p>When a user submits a journal entry, the application sends the reflection to the server-side Gemini integration. Gemini generates a thoughtful response designed to help the user examine ideas, challenges, accomplishments, and possible next steps.</p>
<p>Optional mood information can also provide additional context. For example, a user may mark an entry as <strong>Motivated</strong>, <strong>Calm</strong>, or <strong>Confused</strong> before submitting it. The selected mood is validated against a fixed set of supported values before being included as reflection context.</p>
<p>The AI experience is intentionally designed for personal reflection rather than medical or clinical assessment. Mood information is treated as self-reported context, and the generated responses remain non-diagnostic.</p>
<p>Most importantly, the <strong>Gemini API key remains server-side</strong>. It is not embedded in the client application or committed to the public GitHub repository.</p>
<h2>A Typical Reflection Flow</h2>
<ol>
<li><p>The user signs in using Google.</p>
</li>
<li><p>The user creates a new journal entry.</p>
</li>
<li><p>They optionally select a mood.</p>
</li>
<li><p>The reflection is submitted to the server.</p>
</li>
<li><p>Gemini generates an AI-assisted reflection.</p>
</li>
<li><p>The user can continue with follow-up messages.</p>
</li>
<li><p>The completed entry and conversation are persisted in Firestore.</p>
</li>
<li><p>The entry becomes available from Reflection History.</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/28f668a5-c4f2-41fa-ae3f-ab1708dab6b4.png" alt="" style="display:block;margin:0 auto" />

<p><em>Gemini generating contextual, multi-turn reflection from an authenticated user's journal entry</em>.</p>
<h2>Beyond the Base App: Mood &amp; Insight Tracker:</h2>
<p>To extend the starter application beyond basic AI journaling, I built a lightweight <strong>Mood &amp; Insight Tracker</strong> using Google AI Studio.</p>
<p>Before submitting a reflection, users can optionally choose from six self-reported moods: <strong>Positive, Calm, Motivated, Neutral, Stressed, or Confused</strong>. Mood selection remains completely optional, keeping the journaling experience simple.</p>
<p>The selected mood is validated before being processed, stored alongside the user's journal entry in Firestore, and supplied to Gemini as additional contextual information rather than as an instruction.</p>
<p>I also added a <strong>Recent Mood Insight</strong> section to Reflection History. It examines only the authenticated user's recent entries and identifies simple patterns such as their most frequently logged mood.</p>
<p>Users can also filter their history by mood, making it easier to revisit reflections written in a particular context.</p>
<p>This feature was deliberately designed to remain lightweight and non-diagnostic. It provides a way to observe self-reported reflection patterns without making psychological, medical, or predictive claims.</p>
<h3>What the enhancement adds</h3>
<ul>
<li><p>Optional mood selection during journaling</p>
</li>
<li><p>Mood-aware Gemini reflection context</p>
</li>
<li><p>Persistent mood information in Firestore</p>
</li>
<li><p>Mood badges on saved reflections</p>
</li>
<li><p>Mood-based history filtering</p>
</li>
<li><p>Recent Mood Insight</p>
</li>
<li><p>Strict per-user isolation of mood information</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/1bd18470-d133-4aca-ace0-ebc9e697d4c1.png" alt="" style="display:block;margin:0 auto" />

<p><em>The custom Mood &amp; Insight Tracker showing self-reported reflection trends from the user's private journal history.</em></p>
<p><em>Security-First Development:</em></p>
<p>A major goal of this project was to treat security as part of the architecture rather than something added after development.</p>
<p>Before building the application, I configured <strong>Google AI Studio Custom Instructions</strong> with security-focused development directives covering threat modeling, secure coding, authentication boundaries, Firestore data isolation, secret management, and security reviews.</p>
<p>The application follows several important security practices:</p>
<ul>
<li><p><strong>Firebase Authentication</strong> establishes authenticated user identities through Google Sign-In.</p>
</li>
<li><p><strong>Firestore Security Rules</strong> restrict journal access to the authenticated owner using <code>request.auth.uid == userId</code>.</p>
</li>
<li><p>Journal data follows the isolated path <code>users/{userId}/journals/{journalId}</code>.</p>
</li>
<li><p><strong>Google Cloud Secret Manager</strong> is used for sensitive Gemini API credentials.</p>
</li>
<li><p>Gemini requests are handled through the <strong>server-side application layer</strong>, keeping the Gemini API key out of browser code.</p>
</li>
<li><p>Mood inputs are validated against an allowlist before processing or persistence.</p>
</li>
<li><p>User-generated content is treated as data rather than trusted application instructions.</p>
</li>
<li><p>The public repository contains environment-variable placeholders rather than production secrets.</p>
</li>
</ul>
<p>This security-first workflow helped turn the project from a functional AI prototype into a more production-oriented application.</p>
<p>Firestore ownership rule:</p>
<blockquote>
<p>allow read, write:</p>
<p>if request.auth != null</p>
<p>&amp;&amp; request.auth.uid == userId;</p>
</blockquote>
<p>This ensures an authenticated user can access journal documents only within their own user path.</p>
<h2>Deploying to Google Cloud Run:</h2>
<p>After testing the application in Google AI Studio, I published it as a production application using <strong>Google Cloud Run</strong>.</p>
<p>Cloud Run provides the production runtime for the application while connecting the different pieces of the architecture: the React interface, Firebase Authentication, Cloud Firestore persistence, and the server-side Gemini integration.</p>
<p>After deployment, I tested the complete production workflow rather than relying only on the development preview:</p>
<p><strong>Google Sign-In → Journal Entry → Gemini Reflection → Firestore Persistence → Reflection History</strong></p>
<p>I also verified that saved reflections remain available after signing out and signing back in, confirming that the production application is using persistent user-specific storage.</p>
<p>As part of the Cloud Run AI Challenge configuration, the deployed Cloud Run service was also labeled with:</p>
<p><code>dev-tutorial = cloud-run-ai-challenge</code></p>
<p>This completed the production deployment and challenge configuration for the application.</p>
<h2>What I Learned:</h2>
<p>Building Gemini Reflection Journal showed me that creating an AI application involves much more than connecting a model to an interface. Authentication boundaries, database security, secret management, persistent state, deployment, and production testing are equally important.</p>
<p>Google AI Studio helped accelerate development, while Firebase Authentication and Firestore provided identity and persistent user-isolated storage. Gemini provided the intelligence behind the reflection experience, and Cloud Run provided the production environment that brought everything together.</p>
<p>Extending the application with the Mood &amp; Insight Tracker also gave me an opportunity to move beyond the starter specification while keeping the feature aligned with the application's original purpose.</p>
<p>The result is a working, publicly deployed AI application built around both useful AI interaction and secure application architecture.</p>
<h2>Try the Project:</h2>
<p><a href="https://haseeb-reflection-vault.ai.studio">https://haseeb-reflection-vault.ai.studio</a></p>
<p><a href="https://github.com/Syed-0507/gemini-reflection-journal">https://github.com/Syed-0507/gemini-reflection-journal</a></p>
<p>Built for the Cloud Run AI Challenge.</p>
<p><strong>#AccelerateAIwithCloudRun #GoogleCloud #Gemini #Firebase #CloudRun #GoogleAIStudio #GenerativeAI</strong></p>
]]></content:encoded></item><item><title><![CDATA[Building AI Agents with Google Cloud: My Gen AI Academy APAC Journey]]></title><description><![CDATA[My Gen AI Academy APAC journey building AI agents with Google Cloud, ADK, Gemini, BigQuery, MCP, Cloud Run, and Google Sheets.]]></description><link>https://haseeb-tech.hashnode.dev/building-ai-agents-with-google-cloud-my-gen-ai-academy-apac-journey</link><guid isPermaLink="true">https://haseeb-tech.hashnode.dev/building-ai-agents-with-google-cloud-my-gen-ai-academy-apac-journey</guid><category><![CDATA[google cloud]]></category><category><![CDATA[generative ai]]></category><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[gemini]]></category><dc:creator><![CDATA[Syed Haseebullah Hussaini]]></dc:creator><pubDate>Fri, 21 Aug 2026 15:41:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/98afd380-c3ce-456b-85db-3d8457d59a1d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2>
<p>Generative AI becomes much more interesting when it moves beyond simple conversations and starts interacting with real data, tools, and applications.</p>
<p>As part of the Gen AI Academy APAC Edition, I had the opportunity to explore this through hands-on Google Cloud codelabs. Instead of only learning about AI agents conceptually, I built and deployed agents that could analyze datasets, interact with external tools, make data-driven recommendations, and perform actions after receiving user approval.</p>
<p>Throughout this journey, I worked with Google Cloud Run, Agent Development Kit (ADK), Gemma 4, Gemini, BigQuery, Model Context Protocol (MCP), Google Sheets, Python, and other Google Cloud services.</p>
<p>In this article, I'll share what I built, how the different components worked together, and some of the key things I learned while turning AI models into practical agents.</p>
<h2>Deploying Gemma 4 on Google Cloud Run</h2>
<p>One of the first major tasks was deploying a Gemma 4 model using vLLM on Google Cloud Run. This gave me hands-on experience with serving a large language model through cloud infrastructure rather than simply interacting with an existing AI interface.</p>
<p>The deployment involved configuring my Google Cloud project, setting up networking with Direct VPC Egress, configuring service account permissions, allocating GPU and memory resources, and deploying the vLLM container to Cloud Run.</p>
<p>Once deployed, the model was available through an OpenAI-compatible API. Since the Cloud Run service required authentication, I used a Google Cloud identity token when sending requests to the model.</p>
<p>To verify the deployment, I sent the model a simple question: <strong>“Why is the sky blue?”</strong> The model successfully generated a response, confirming that the complete inference pipeline was working.</p>
<h2><strong>Building a Data-Driven AI Agent with ADK and BigQuery MCP</strong></h2>
<p>After deploying the model, I moved from basic model inference to building an AI agent capable of working with real-world data. Using Google’s Agent Development Kit (ADK), I created a data agent that could interact with the NYC Citi Bike dataset stored in BigQuery. The agent was connected to BigQuery through the Model Context Protocol (MCP), allowing it to inspect available tables, understand their schemas, generate SQL queries, and analyze the results based on natural-language requests. I tested the agent with a practical business scenario: “We have budget for 3 coffee trucks. We want to find the best city bike stations to place our coffee trucks.” Instead of returning a generic recommendation, the agent analyzed historical Citi Bike trip activity and identified three of the busiest stations:</p>
<ol>
<li><p>E 17 St &amp; Broadway</p>
</li>
<li><p>Pershing Square North</p>
</li>
<li><p>W 21 St &amp; 6 Ave. This demonstrated how an AI agent can combine natural-language reasoning with structured data analysis to produce useful, data-backed recommendations.</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/62086761-3a0f-4796-acdc-690802bf05b3.png" alt="" style="display:block;margin:0 auto" />

<h2>Building a Personal Coffee Shop AI Agent with Google Sheets</h2>
<p>During the next codelab, I built a more action-oriented AI agent designed to help manage a coffee shop during a university graduation weekend. The agent used historical 2025 Point-of-Sale (POS) data stored in Google Sheets and compared it with the 2026 graduation schedule. Its goal was to identify demand spikes and recommend inventory and staffing adjustments for the upcoming event. Using Google ADK and Gemini, the agent could read spreadsheet data, analyze historical patterns, identify operational bottlenecks, and generate recommendations. One particularly interesting feature was Human-in-the-Loop approval. Instead of immediately modifying the spreadsheet, the agent first presented its recommendations and asked for permission. For example, the agent identified high-demand periods following graduation ceremonies and recommended actions such as:</p>
<ol>
<li><p>Scheduling a Support Barista during major beverage-demand spikes.</p>
</li>
<li><p>Preparing additional staff for post-ceremony rush periods.</p>
</li>
<li><p>Pre-staging additional inventory such as alternative milk before predicted demand surges. Only after receiving my approval did the agent create a TODO-2026 sheet and write the approved tasks into it. This demonstrated an important concept in agentic AI: an AI system can analyze information and propose actions while still keeping the human in control of consequential changes.</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/fde74c97-9d44-4937-9917-327202130a88.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/6a886796ae3168b95c4abe82/81a48250-db3c-41ec-af3d-a3b9c72d764b.png" alt="" style="display:block;margin:0 auto" />

<h2>Technologies I Worked With</h2>
<p>Throughout the Gen AI Academy APAC journey, I worked with several technologies that together form a modern stack for building and deploying AI agents.</p>
<ul>
<li><p>Google Cloud Run for deploying and hosting AI applications.</p>
</li>
<li><p>Google Agent Development Kit (ADK) for creating and orchestrating AI agents.</p>
</li>
<li><p>Gemma 4 and Gemini as the language models powering the applications.</p>
</li>
<li><p>BigQuery for querying and analyzing structured datasets.</p>
</li>
<li><p>Model Context Protocol (MCP) for enabling the agent to interact with external data tools.</p>
</li>
<li><p>Google Sheets API for reading and updating spreadsheet data programmatically.</p>
</li>
<li><p>Python for implementing agent logic, tools, data processing, and backend functionality.</p>
</li>
<li><p>FastAPI and Uvicorn for serving the Coffee Shop Agent as a web application.</p>
</li>
<li><p>Google Cloud IAM and Service Accounts for authentication and controlled access to cloud resources.</p>
</li>
</ul>
<h2>What I Learned</h2>
<p>The biggest takeaway from these codelabs was understanding that building an AI agent involves much more than simply sending prompts to a language model.</p>
<p>I learned how an agent can be connected to <strong>real data sources</strong>, equipped with <strong>tools</strong>, deployed as a cloud application, and designed to perform actions based on its reasoning.</p>
<p>Working with BigQuery and MCP showed me how natural-language requests can be translated into useful data analysis. The Coffee Shop Agent demonstrated another important concept: <strong>Human-in-the-Loop AI</strong>, where the agent recommends an action but waits for explicit user approval before modifying external data.</p>
<p>I also gained practical experience with cloud deployment, APIs, service accounts, IAM permissions, environment variables, troubleshooting, and integrating multiple Google Cloud services into a working application.</p>
<p>Most importantly, these projects helped me move from simply <strong>using generative AI</strong> to understanding how to <strong>build applications around generative AI</strong>.</p>
<h2>Conclusion</h2>
<p>The Gen AI Academy APAC Edition gave me the opportunity to move beyond learning generative AI concepts and actually build, test, and deploy AI agents on Google Cloud.</p>
<p>Across these hands-on codelabs, I explored how large language models can be connected with real-world data and tools to solve practical problems. From deploying Gemma 4 on Cloud Run, to analyzing Citi Bike data using ADK, BigQuery, and MCP, and finally building a Coffee Shop Agent capable of analyzing Google Sheets data and taking actions after human approval, each project introduced a different part of the agentic AI workflow.</p>
<p>One of my biggest takeaways was that the real power of AI agents comes from combining <strong>reasoning, tools, data, cloud infrastructure, and human oversight</strong>.</p>
<p>There is still much more for me to explore in Generative AI and agentic systems, but this experience has given me a practical foundation to continue building more capable AI applications.</p>
<p>I’m grateful to <strong>Google Cloud and Hack2skill</strong> for organizing the Gen AI Academy APAC Edition and providing an opportunity to learn through hands-on projects.</p>
<p>I look forward to continuing this journey and building more with Generative AI and Google Cloud.</p>
<p>Thanks for reading! ☕🤖</p>
]]></content:encoded></item></channel></rss>