# harshini-ananthan/cloud-cost-optimizer architecture

> Architecture diagram of the GitHub repository harshini-ananthan/cloud-cost-optimizer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshini-ananthan/cloud-cost-optimizer
- Repository: https://github.com/harshini-ananthan/cloud-cost-optimizer

## Overview

Cloud Cost Guardrail is a GCP FinOps console: users provide billing telemetry, explore spend and anomalies, then inspect forecasts, recommendations, and savings scenarios. The README documents CSV and BigQuery ingestion, ML analysis, Active Assist playbooks, and currency-aware presentation. The shown backend wiring supports the API-to-billing path and CSV retraining; several API and frontend component implementations are unsampled, so their links are shown only where the README or excerpts establish them.

Main entry points: [`cloud-cost-guardrail/backend/routers/api.py`](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/routers/api.py) (REST API routes), [`cloud-cost-guardrail/backend/dependencies.py`](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/dependencies.py) (Service registry), [`cloud-cost-guardrail/backend/gcp_billing_service.py`](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/gcp_billing_service.py) (Billing ingestion), [`cloud-cost-guardrail/frontend/src/App.jsx`](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/App.jsx) (FinOps console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Billing ingestion"]
  node_csv["Billing CSV"]
  node_bigquery[("BigQuery export")]
  node_billing["Billing ingestion"]
end

subgraph group_analysis["Spend intelligence"]
  node_ml["ML analysis pipeline<br/>[gcp_ml_pipeline.py]"]
  node_recommender["Active Assist<br/>[gcp_recommender.py]"]
  node_legacyforecast["Legacy forecast service"]
  node_legacyrecommend["Legacy recommendations"]
  node_whatif["What-if service<br/>[what_if_service.py]"]
end

subgraph group_api["API and orchestration"]
  node_api["REST API routes<br/>[api.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_runtime["Application runtime<br/>[main.py]"]
  node_dependencies["Service registry<br/>[dependencies.py]"]
end

subgraph group_console["FinOps console"]
  node_consoleui["FinOps console<br/>[App.jsx]"]
  node_overview["Spend overview<br/>[GcpOverview.jsx]"]
  node_servicesview["Projects and SKUs"]
  node_anomalyview["Anomaly explorer"]
  node_forecastview["Forecast view"]
  node_recommendview["Recommendations view"]
  node_simulatorview["What-if simulator"]
  node_settingsview["Connection settings"]
  node_navbar["Project navigation<br/>[GcpNavbar.jsx]"]
  node_icons["GCP brand icons<br/>[GcpIcons.jsx]"]
end

node_user(("FinOps user"))
node_gcp(("Google Cloud"))

node_user -->|"uses"| node_consoleui
node_consoleui -->|"requests data"| node_api
node_runtime -->|"mounts routes"| node_api
node_runtime -->|"loads models"| node_dependencies
node_api -->|"validates responses"| node_schemas
node_api -->|"queries billing"| node_billing
node_api -->|"analyzes uploads"| node_ml
node_dependencies -->|"creates service"| node_billing
node_dependencies -->|"creates pipeline"| node_ml
node_dependencies -->|"creates engine"| node_recommender
node_dependencies -->|"creates service"| node_legacyforecast
node_dependencies -->|"creates service"| node_legacyrecommend
node_dependencies -->|"creates service"| node_whatif
node_csv -->|"imports billing"| node_billing
node_bigquery -->|"streams export"| node_billing
node_gcp -->|"provides export"| node_bigquery
node_billing -->|"feeds analysis"| node_ml
node_billing -->|"feeds playbooks"| node_recommender
node_api -->|"serves spend data"| node_overview
node_api -->|"serves project data"| node_servicesview
node_api -->|"serves anomalies"| node_anomalyview
node_api -->|"serves forecasts"| node_forecastview
node_api -->|"serves advice"| node_recommendview
node_api -->|"serves scenarios"| node_simulatorview
node_api -->|"configures ingestion"| node_settingsview
node_consoleui -->|"renders"| node_navbar
node_servicesview -->|"uses icons"| node_icons
node_overview -->|"uses icons"| node_icons

click node_consoleui "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/App.jsx"
click node_overview "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpOverview.jsx"
click node_servicesview "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpServicesView.jsx"
click node_anomalyview "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpAnomalyExplorer.jsx"
click node_forecastview "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpForecastingView.jsx"
click node_recommendview "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpRecommendationsView.jsx"
click node_simulatorview "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpWhatIfSimulator.jsx"
click node_settingsview "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpSettingsModal.jsx"
click node_navbar "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpNavbar.jsx"
click node_icons "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpIcons.jsx"
click node_billing "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/gcp_billing_service.py"
click node_ml "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/gcp_ml_pipeline.py"
click node_recommender "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/gcp_recommender.py"
click node_legacyforecast "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/forecast_service.py"
click node_legacyrecommend "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/recommendation_service.py"
click node_whatif "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/what_if_service.py"
click node_api "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/routers/api.py"
click node_schemas "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/schemas.py"
click node_runtime "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/main.py"
click node_dependencies "https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/dependencies.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_csv,node_bigquery,node_billing,node_user toneBlue
class node_ml,node_recommender,node_legacyforecast,node_legacyrecommend,node_whatif toneAmber
class node_api,node_schemas,node_runtime,node_dependencies toneMint
class node_consoleui,node_overview,node_servicesview,node_anomalyview,node_forecastview,node_recommendview,node_simulatorview,node_settingsview,node_navbar,node_icons toneRose
class node_gcp toneIndigo
```

## Components

### Billing ingestion

- **Billing CSV**
- **BigQuery export**
- [Billing ingestion](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/gcp_billing_service.py): `cloud-cost-guardrail/backend/gcp_billing_service.py`

### Spend intelligence

- [ML analysis pipeline](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/gcp_ml_pipeline.py): `cloud-cost-guardrail/backend/gcp_ml_pipeline.py`
- [Active Assist](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/gcp_recommender.py): `cloud-cost-guardrail/backend/gcp_recommender.py`
- [Legacy forecast service](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/forecast_service.py): `cloud-cost-guardrail/backend/forecast_service.py`
- [Legacy recommendations](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/recommendation_service.py): `cloud-cost-guardrail/backend/recommendation_service.py`
- [What-if service](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/what_if_service.py): `cloud-cost-guardrail/backend/what_if_service.py`

### API and orchestration

- [REST API routes](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/routers/api.py): `cloud-cost-guardrail/backend/routers/api.py`
- [API schemas](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/schemas.py): `cloud-cost-guardrail/backend/schemas.py`
- [Application runtime](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/main.py): `cloud-cost-guardrail/backend/main.py`
- [Service registry](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/backend/dependencies.py): `cloud-cost-guardrail/backend/dependencies.py`

### FinOps console

- [FinOps console](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/App.jsx): `cloud-cost-guardrail/frontend/src/App.jsx`
- [Spend overview](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpOverview.jsx): `cloud-cost-guardrail/frontend/src/components/GcpOverview.jsx`
- [Projects and SKUs](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpServicesView.jsx): `cloud-cost-guardrail/frontend/src/components/GcpServicesView.jsx`
- [Anomaly explorer](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpAnomalyExplorer.jsx): `cloud-cost-guardrail/frontend/src/components/GcpAnomalyExplorer.jsx`
- [Forecast view](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpForecastingView.jsx): `cloud-cost-guardrail/frontend/src/components/GcpForecastingView.jsx`
- [Recommendations view](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpRecommendationsView.jsx): `cloud-cost-guardrail/frontend/src/components/GcpRecommendationsView.jsx`
- [What-if simulator](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpWhatIfSimulator.jsx): `cloud-cost-guardrail/frontend/src/components/GcpWhatIfSimulator.jsx`
- [Connection settings](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpSettingsModal.jsx): `cloud-cost-guardrail/frontend/src/components/GcpSettingsModal.jsx`
- [Project navigation](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpNavbar.jsx): `cloud-cost-guardrail/frontend/src/components/GcpNavbar.jsx`
- [GCP brand icons](https://github.com/harshini-ananthan/cloud-cost-optimizer/blob/main/cloud-cost-guardrail/frontend/src/components/GcpIcons.jsx): `cloud-cost-guardrail/frontend/src/components/GcpIcons.jsx`

### Other components

- **FinOps user**
- **Google Cloud**

## Connections

- FinOps user → FinOps console: uses (evidence: `README.md`)
- FinOps console → REST API routes: requests data (evidence: `cloud-cost-guardrail/frontend/src/App.jsx`)
- Application runtime → REST API routes: mounts routes (evidence: `cloud-cost-guardrail/backend/main.py`)
- Application runtime → Service registry: loads models (evidence: `cloud-cost-guardrail/backend/main.py`)
- REST API routes → API schemas: validates responses (evidence: `cloud-cost-guardrail/backend/routers/api.py`)
- REST API routes → Billing ingestion: queries billing (evidence: `cloud-cost-guardrail/backend/routers/api.py`)
- REST API routes → ML analysis pipeline: analyzes uploads (evidence: `cloud-cost-guardrail/backend/routers/api.py`)
- Service registry → Billing ingestion: creates service (evidence: `cloud-cost-guardrail/backend/dependencies.py`)
- Service registry → ML analysis pipeline: creates pipeline (evidence: `cloud-cost-guardrail/backend/dependencies.py`)
- Service registry → Active Assist: creates engine (evidence: `cloud-cost-guardrail/backend/dependencies.py`)
- Service registry → Legacy forecast service: creates service (evidence: `cloud-cost-guardrail/backend/dependencies.py`)
- Service registry → Legacy recommendations: creates service (evidence: `cloud-cost-guardrail/backend/dependencies.py`)
- Service registry → What-if service: creates service (evidence: `cloud-cost-guardrail/backend/dependencies.py`)
- Billing CSV → Billing ingestion: imports billing (evidence: `README.md`)
- BigQuery export → Billing ingestion: streams export (evidence: `README.md`)
- Google Cloud → BigQuery export: provides export (evidence: `README.md`)
- Billing ingestion → ML analysis pipeline: feeds analysis (evidence: `README.md`)
- Billing ingestion → Active Assist: feeds playbooks (evidence: `README.md`)
- REST API routes → Spend overview: serves spend data (evidence: `README.md`)
- REST API routes → Projects and SKUs: serves project data (evidence: `README.md`)
- REST API routes → Anomaly explorer: serves anomalies (evidence: `README.md`)
- REST API routes → Forecast view: serves forecasts (evidence: `README.md`)
- REST API routes → Recommendations view: serves advice (evidence: `README.md`)
- REST API routes → What-if simulator: serves scenarios (evidence: `README.md`)
- REST API routes → Connection settings: configures ingestion (evidence: `README.md`)
- FinOps console → Project navigation: renders (evidence: `cloud-cost-guardrail/frontend/src/App.jsx`)
- Projects and SKUs → GCP brand icons: uses icons (evidence: `cloud-cost-guardrail/frontend/src/components/GcpServicesView.jsx`)
- Spend overview → GCP brand icons: uses icons (evidence: `cloud-cost-guardrail/frontend/src/App.jsx`)
