How 2096955/gcpdevgenius works
Project Type and Purpose
• This is a full-stack, AI-powered GCP solution architect tool.
• It provides an interactive Streamlit frontend for users to design GCP architectures via natural-language chat, and generates infrastructure-as-code (Terraform, CDK, Deployment Manager), cost estimates, and documentation.
File Structure Analysis
• Top-level directories and files:
• .cursor, .roo, .roomodes: internal rules/workflows for the AI agent.
• chatbot/: Python Streamlit app and modules (chat engine, A2A agents, code generators, utils, tests, styles).
• lib/: serverless functions (edge Lambda in JS, Python Lambdas for specific tasks) and a shared Python layer.
• scripts/: CLI utilities (GCP dependency checks, reports).
• cdk.json, tsconfig.json, package.json: Node/CDK configurations.
• requirements.txt & chatbot/requirements.txt: Python dependencies.
• Inside chatbot/:
• agent.py: Streamlit entrypoint.
• a2a/: Agent-to-agent framework (agents, client/server, base classes).
• gemini/: abstraction for Vertex AI.
• dynamodb.py, upload.py, utils.py: local JSON storage and utility functions.
Insights from README
• Frontend: Streamlit UI.
• AI integration: Vertex AI (via gemini/provider).
• Local JSON storage for chat logs and feedback.
• Infrastructure-as-Code outputs: Terraform, Deployment Manager, CDK.
• Cost estimation via GCP Pricing APIs.
• Optional A2A (Agent-to-Agent) orchestration.
a. Main Components
• Streamlit Frontend
• Chat Engine / Orchestrator (agent.py + layout/styles)
• A2A Framework & Agents (code conversion, data migration, host agent)
• AI Provider: Vertex AI
• IAC Generators: Terraform Generator, CDK Generator, Deployment Manager Generator
• Cost Estimator & Documentation Generator
• Storage: Local JSON files (and optional DynamoDB)
• GCP Integration Layer (REST/gRPC calls to Compute, IAM, Pricing APIs)
• Serverless Artifacts: Edge Lambda, Python Lambdas
• CLI Utilities (scripts/)
b. Relationships and Data Flows
• User → Streamlit UI → Chat Engine
• Chat Engine ↔ A2A Framework ↔ Specialized Agents
• Chat Engine → Vertex AI Provider → AI responses
• Chat Engine → IAC Generators → Template files
• Chat Engine → Cost Estimator → GCP Pricing API → Cost data
• Generators & Estimator → Storage (local JSON or DynamoDB)
• CLI scripts invoke underlying modules directly for reports or checks
• Lib Lambdas are packaged as deployable artifacts for edge or serverless deployment
c. Architectural Patterns
• MVC-style separation: Streamlit (View) / agent.py (Controller) / generate_*/utils (Model)
• Plugin-like modules for each IAC type
• Internal micro-workflow via Agent-to-Agent calls
• External abstraction layer for AI provider (gemini) and GCP APIs
d. Key Technologies
• Python 3.10+, Streamlit
• Vertex AI (via gemini/provider)
• Terraform, AWS-style CDK (Node.js 16+), Google Deployment Manager
• GCP REST APIs (Compute, IAM, Pricing)
• Node.js & TypeScript for CDK integration
• Local JSON storage, optional DynamoDB