Inspiration
The inspiration for this project was to explore how Generative AI could be integrated into an existing, complex microservices architecture to create something useful but also fun. The Bank of Anthos application provided a good starting point. I wanted to add a feature that went beyond simple transactions, something that could help users with financial planning. This led to the idea of a "what-if" analysis tool, powered by the Gemini API, to simulate financial scenarios and provide users with actionable insights.
How It's Built
The project was built by extending the Bank of Anthos application with a new set of components:
whatifMicroservice: A Python-based service built with FastAPI. It serves as the brain of the new feature.- It integrates with the Gemini API to dynamically generate financial scenarios.
- It uses a SQLite database to store these scenarios for consistency.
- It communicates with the existing
balancereaderandtransactionhistoryservices to pull the necessary data for analysis. - It exposes a REST API for the mobile application to consume.
Flutter Mobile App: A cross-platform mobile app that acts as the user interface. It allows users to log in, view a list of generated scenarios, select one, and see a detailed analysis of its potential impact on their finances.
GKE Deployment: The new
whatifservice is containerized and deployed to the same GKE cluster as the rest of the Bank of Anthos services. Kubernetes manifests were created to manage its deployment, networking (via a LoadBalancer service), and secrets management for the Gemini API key.
Challenges Faced
- Service Integration: The primary challenge was understanding the existing Bank of Anthos architecture and figuring out the best way to integrate a new service. This involved tracing API calls and ensuring the new
whatifservice could securely and reliably communicate with the other microservices. - Kubernetes Networking: Correctly configuring the Kubernetes service and ingress to expose the
whatifservice to the public internet so the mobile app could reach it proved to be a complex task, requiring significant debugging. Prompt Engineering: Crafting the right prompts for the Gemini API was an iterative process. It took several attempts to get the model to generate financial scenarios that were both realistic and relevant to a user's transaction history.
** I also ran into a very annoying bug with PyJWT even the best LLMs could not figure out, only good old StackOverflow (https://stackoverflow.com/questions/67602828/decoding-jwt-token-with-pyjwt-in-python-giving-error-algorithm-not-supported)
What I Learned and accomplishments
This project was a fantastic learning experience. I gained hands-on experience with:
- Microservice Architecture: Deepened my understanding of how to design, deploy, and manage microservices in a real-world application. Even though I have worked with Kubernetes yaml files in the past, Skaffold was new to me. Never heard of it before.
- Google Kubernetes Engine (GKE): Learned the intricacies of deploying and managing applications on GKE, including service discovery, networking, and secrets management. I often have Devops guys handle this part at work so it was fun getting my hands dirty
- Generative AI Integration: Gained practical skills in integrating a powerful LLM like Gemini into an application to create a novel user feature.
- Full-Stack Development: Honed my skills across the stack, from backend development in Python to mobile app development in Flutter, and the DevOps practices required to tie it all together.
What's next
Keep building, keep shipping

Log in or sign up for Devpost to join the conversation.