Skip to content

About

Cloud Cost Comparison Tool

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CloudVitta

Problem Statement

Comparing cloud costs today requires visiting each provider's calculator or pricing page separately and manually reconciling different units, currencies, and pricing models. There is no single tool for an apples-to-apples, live-data comparison across all major providers. CloudVitta solves this problem by ingesting live pricing from official cloud provider APIs, normalizing disparate pricing models into canonical units, converting currencies, and serving comparisons through a high-performance REST API and Model Context Protocol (MCP) agent tools.

Live Production API: https://cloudvitta-api-pelqqgz3mq-as.a.run.app

  • Compute Comparison: GET /api/v1/prices/compute?vcpu=2&ram_gb=8&region=us-east
  • Storage Comparison: GET /api/v1/prices/storage?tier=standard&region=us-east
  • Network Comparison: GET /api/v1/prices/network?transfer_type=internet_egress&region=us-east
  • Relational Database (RDBMS): GET /api/v1/prices/database?engine=postgresql&vcpu=4&ram_gb=16&storage_gb=100&region=us-east
  • NoSQL Database: GET /api/v1/prices/database-nosql?data_model=document&pricing_mode=provisioned&read_units=1000&write_units=500&region=us-east
  • Managed Kubernetes: GET /api/v1/prices/kubernetes?tier=standard&cluster_topology=zonal&region=us-east
  • Serverless Compute (FaaS): GET /api/v1/prices/serverless?tier=standard&architecture=x86_64&requests_per_month=5000000&execution_duration_ms=200&memory_mb=512&region=us-east
  • Composite Workload Calculation: POST /api/v1/calculate
  • Model Context Protocol (MCP): POST /mcp (Streamable HTTP, 9 AI Agent Tools)
  • Provider Freshness & Status: GET /api/v1/providers/aws/status
  • Interactive Swagger Documentation: https://cloudvitta-api-pelqqgz3mq-as.a.run.app/docs/
  • Health Check: https://cloudvitta-api-pelqqgz3mq-as.a.run.app/healthz

System Architecture

flowchart TD
    Client(["Client / Browser / Agent"]) --> RootMux["Go net/http Root ServeMux"]
    
    RootMux -->|/healthz, /readyz| Probes["Health & Readiness Probes"]
    RootMux -->|/metrics| Metrics["Prometheus Metrics"]
    RootMux -->|/docs/*| Swagger["OpenAPI Swagger UI"]
    RootMux -->|/mcp| MCP["MCP Streamable HTTP Server"]
    RootMux -->|/api/v1/*| REST["REST Router & 4-Step Rate Limiter"]
    RootMux -->|/*| SPA["Embedded SPA Static Asset Handler"]
    
    subgraph CoreService["CloudVitta Service Layer"]
        REST --> PricingSvc["Pricing Service"]
        REST --> CalcSvc["Calculate Service"]
        REST --> AuthSvc["Auth Service"]
        REST --> FreshSvc["Freshness Service"]
        MCP --> PricingSvc
        MCP --> FreshSvc
        
        PricingSvc --> Matching["7 Strategy SKU Scorers"]
        CalcSvc --> PricingSvc
        CalcSvc --> Matching
    end
    
    subgraph DataCache["Data & Cache Layer"]
        PricingSvc --> Cache[("Redis Cache (Upstash)")]
        PricingSvc --> Singleflight["singleflight.Group"]
        Singleflight --> Postgres[("Serverless Postgres (Neon)")]
        AuthSvc --> Postgres
        FreshSvc --> Postgres
        FreshSvc --> DLQ[("Redis DLQ")]
    end
    
    subgraph IngestionPipeline["Ingestion Pipeline"]
        Scheduler["Cloud Scheduler"] --> IngestJob["cmd/ingest Worker"]
        IngestJob --> Adapters["Provider Adapters (7 Providers)"]
        Adapters --> GCS[("GCS Raw JSON Archive")]
        Adapters --> Normalizer["Streaming Parser & Anomaly Detector"]
        Adapters --> QSink["Quarantine Sink"]
        Normalizer --> Postgres
        Normalizer --> Cache
    end
Loading

Architecture & Technical Documentation

Document Description
System Architecture High-level system architecture and infrastructure topology
Data Model ERD Entity relationship diagram and polymorphic JSONB attribute schemas for 7 categories
Ingestion Flow Diagram Ingestion orchestrator lifecycle, multi-component splitting, quarantine isolation, and event-driven cache warming
Calculator Request Lifecycle Single-category cache-miss flow, composite calculation fan-out, and 9 MCP tools lifecycle
Auth Token Rotation & Theft Containment Refresh token family rotation, idempotency replay cache, and theft detection
Package Structure & Dependencies Modular monolith package hierarchy and dependency rules
Architectural Decision Records (ADRs) Index of 45 architectural decision records with context, trade-offs, and alternatives
Master Development Guide Local environment setup, frontend & backend testing, and quality standards
Production Deployment Guide Cloud Run service configuration, Google Cloud Secret Manager wiring, and CI/CD pipelines

Local Development Quickstart

1. Prerequisites

  • Go 1.27+ installed
  • Node.js 26.12.1+ installed
  • PostgreSQL instance (or Neon connection string)
  • Redis instance (or Upstash connection string)
  • tern migration tool: go install github.com/jackc/tern/v2@latest

2. Setup Environment

cp .env.example .env
# Edit .env with your local PostgreSQL and Redis credentials

3. Run Database Migrations

tern migrate -m migrations -c tern.conf

4. Start the Application

# Start API server (port 8080)
go run cmd/api/main.go

# Start Frontend development server (port 3000)
cd web && npm run dev

# Run Ingestion worker
go run cmd/ingest/main.go

5. Run Test Suite

# Backend unit and race detection tests
go test -race ./...

# Backend static analysis
go vet ./...

# Frontend component & E2E tests
cd web
npm test
npm run test:e2e

About

Cloud Cost Comparison Tool

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages