ArchitectAI

AI-powered AWS cloud architecture generator - from requirements to production-ready diagrams, cost breakdowns, and implementation roadmaps in seconds.

Inspiration

Designing cloud infrastructure is slow and error-prone. Engineers spend hours researching AWS services, drawing diagrams, estimating costs, and writing implementation plans - often repeating the same work across projects with minor variations.

I wanted to eliminate that friction. Describe what you want to build in plain English, get back a complete, production-aware architecture - the kind a senior cloud architect would design - in under a minute.

What it does

ArchitectAI takes a natural language description (e.g. "a real-time e-commerce platform with 100k daily users, PostgreSQL, and a recommendation engine") and generates:

  • Architecture diagram - interactive drag-and-drop canvas with color-coded AWS service nodes and connection arrows, plus an editable Mermaid flowchart view
  • Cost breakdown - per-component monthly and annual estimates with stacked cost bars (compute, storage, I/O, data transfer), scenario comparisons, and top cost drivers
  • Optimization suggestions - categorized by Cost / Performance / Security, ranked by impact and effort, with step-by-step implementation guidance
  • Implementation roadmap - phased delivery plan with tasks, deliverables, risks, validation criteria, and IaC snippets (Terraform, base structure, still WIP)
  • Export - Draw.io XML with real AWS mxgraph icons, and Mermaid code for embedding in docs

How I built it

Frontend - Next.js 14, TypeScript, Tailwind CSS, Framer Motion, Recharts, Mermaid, and a fully custom drag-and-drop canvas built without any graph library.

Backend - FastAPI, SQLAlchemy + Alembic, PostgreSQL, Redis, Poetry.

AI - Amazon Bedrock with Nova Lite for architecture generation (complex structured JSON, ~30s) and Nova Micro for optimizations and roadmaps (faster, lower cost). Prompts are engineered to produce consistent, validated JSON matching my schema.

Cost engine - A custom Python service that maps AWS service types to realistic cost formulas (per instance size, storage tier, I/O patterns), then scales breakdowns proportionally to Nova's estimates to produce accurate per-category figures.

Deployment - Docker Compose for local and EC2, ECS Fargate + RDS + ElastiCache for production, Vercel for frontend.

Challenges I ran into

Consistent AI output - Getting Nova to reliably return valid, schema-conforming JSON for 10–20 component architectures required significant prompt iteration, strict output validation, and graceful fallbacks.

Accurate cost breakdowns - Nova returns a single total cost per component, but I needed per-category breakdowns (compute vs. storage vs. I/O). Building a scaling system that maps service-specific formulas to Nova's estimates - without inflating any single category - took several iterations, especially for multi-node services like Aurora and ElastiCache.

Diagram consistency - The interactive canvas and Mermaid views represent the same architecture but looked completely different. Making them visually consistent without sacrificing the strengths of each format was a careful design challenge.

Mermaid + SSR - Mermaid's browser-only rendering required dynamic imports and unique render IDs to avoid SSR crashes and DOM conflicts between re-renders.

Accurate and reliable architecture diagram - Building a smooth, accurate architecture diagram is harder than it looks. Getting service groupings, connection semantics, and layout hierarchy right - so the diagram actually reflects the architecture and not just a pretty graph - took significant iteration.

Accomplishments I'm proud of

  • End-to-end in ~30 seconds - plain English input to full architecture with diagram, cost analysis, optimizations, and a multi-phase roadmap
  • Custom drag-and-drop diagram - built from scratch with React + SVG overlays, no external graph library
  • Accurate cost modeling - per-service formulas with proportional category breakdowns, producing realistic and explainable estimates
  • Layered deployment options - from a single EC2 instance ($17/mo) to full ECS Fargate + RDS production stack, with clear docs for each
  • Fully typed, zero mock data - every feature is backed by real AI calls and a real database

What I learned

  • Prompt engineering is software engineering - I versioned prompts like code and ran regression tests across architecture scenarios. The biggest reliability gains came from structural changes: injecting canonical field examples inline, constraining enums explicitly, and splitting node generation from edge/connection logic into separate prompt stages to cut cross-field hallucination.

  • Model selection is an architectural decision - Nova Lite and Nova Micro aren't interchangeable at different price points; they have different output characteristics under load. Nova Lite handled complex 10–20 component graphs where reasoning depth matters. Nova Micro handled scoped, lower-entropy tasks - optimizations, roadmap phases - where speed wins. Treating this as a pipeline design choice, not a cost dial, changed how I decomposed the whole generation flow.

  • Structured output reliability is a systems problem - Good prompts get you to 85%. The other 15% is a defense-in-depth validation layer: Pydantic schema validation on every response, a surgical repair pass for common malformations (missing fields, bad nesting, stray prose before the JSON fence), and circuit-breaker retry logic that reduces component count when generation hits token limits mid-output.

  • Diagram UX is harder than it looks - A smooth draggable canvas requires understanding browser event timing, avoiding unnecessary re-renders, and carefully deciding what information belongs in each view.

  • Deployment complexity scales fast - Even a "simple" app touches a surprising number of AWS primitives. Documenting the deployment surface carefully saves significant time.

What's next for ArchitectAI

  • Multi-cloud support - Azure and GCP alongside AWS
  • IaC snippets - Generate all architecture with Terraform / CloudFormation
  • Diagram improvements - have the same view in all tabs
  • Architecture versioning - track design evolution, diff between versions
  • Team collaboration - share architectures, leave comments, fork designs
  • Live cost tracking - connect to AWS Cost Explorer to validate estimates against actual spend
  • CI/CD integration - generate GitHub Actions or GitLab CI pipelines alongside IaC output
  • Compliance profiles - pre-baked constraint sets for HIPAA, SOC 2, GDPR that shape generation toward compliant architectures
  • Fine-tuning and human feedback loop - collect expert architect feedback on generated outputs to fine-tune Nova on domain-specific patterns, progressively improving service selection, topology accuracy, and cost precision

Built With

Share this project:

Updates