# sanjeevmurthy/le-terraform architecture

> Architecture diagram of the GitHub repository sanjeevmurthy/le-terraform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sanjeevmurthy/le-terraform
- Repository: https://github.com/sanjeevmurthy/le-terraform

## Overview

This repository is a multi-cloud Terraform practice project whose most complete example is LinkForge, a three-tier URL shortener on GCP. A user submits and manages links through the web UI; the API stores link records and click counts in Firestore, while short-link visits redirect to their targets. The GCP infrastructure, Kubernetes deployment, and documented CI/CD capabilities are shown alongside the Azure and AWS self-managed-cluster examples. Unsampled infrastructure wiring is represented only where the README documents it; source excerpts support the application flow.

Main entry points: [`GCP/linkforge/main.tf`](https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/linkforge/main.tf) (GCP root stack), [`Azure/k8s-cluster/main.tf`](https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/k8s-cluster/main.tf) (Azure VM cluster), [`k8s/30-ingress.yaml`](https://github.com/sanjeevmurthy/le-terraform/blob/main/k8s/30-ingress.yaml) (Ingress routing), [`app/api/main.py`](https://github.com/sanjeevmurthy/le-terraform/blob/main/app/api/main.py) (Link API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["LinkForge application"]
  node_web["Web UI<br/>[app.js]"]
  node_api["Link API<br/>[main.py]"]
  node_firestore[("Firestore<br/>[main.tf]")]
end

subgraph group_runtime["GKE runtime"]
  node_ingress["Ingress routing<br/>[30-ingress.yaml]"]
  node_k8s["Kubernetes workloads"]
  node_app_pipeline["App pipeline<br/>[gcp-app.yml]"]
end

subgraph group_gcp["GCP infrastructure"]
  node_infra_pipeline["Infra pipeline<br/>[gcp-infra.yml]"]
  node_gcp_stack["GCP root stack<br/>[main.tf]"]
  node_gcp_network["VPC network<br/>[main.tf]"]
  node_gcp_gke["GKE cluster<br/>[main.tf]"]
  node_registry["Artifact Registry<br/>[main.tf]"]
  node_workload_identity["Workload identity<br/>[main.tf]"]
  node_github_oidc["GitHub OIDC<br/>[main.tf]"]
end

subgraph group_azure["Azure cluster"]
  node_azure_stack["Azure VM cluster<br/>[main.tf]"]
  node_azure_bootstrap["Kubernetes bootstrap<br/>[main.tf]"]
  node_azure_vm["Azure VM<br/>[main.tf]"]
  node_azure_nic["Network interface<br/>[main.tf]"]
  node_azure_ssh["SSH key<br/>[main.tf]"]
  node_azure_pipeline["Azure infra workflow"]
end

subgraph group_aws["AWS cluster"]
  node_aws_stack["EC2 Kubernetes cluster<br/>[main.tf]"]
  node_ec2_module["EC2 instance module<br/>[main.tf]"]
  node_aws_pipeline["AWS infra workflow"]
end

node_visitor(("Visitor"))

node_visitor -->|"visits"| node_ingress
node_ingress -->|"routes web"| node_web
node_ingress -->|"routes API"| node_api
node_web -->|"calls API"| node_api
node_api -->|"reads and writes"| node_firestore
node_app_pipeline -->|"deploys app"| node_k8s
node_infra_pipeline -->|"runs Terraform"| node_gcp_stack
node_azure_pipeline -->|"runs Terraform"| node_azure_stack
node_aws_pipeline -->|"runs Terraform"| node_aws_stack
node_gcp_stack -.-> node_gcp_network
node_gcp_stack -.-> node_gcp_gke
node_gcp_stack -.-> node_registry
node_gcp_stack -.-> node_firestore
node_gcp_stack -.-> node_workload_identity
node_gcp_stack -.-> node_github_oidc
node_azure_stack -.-> node_azure_bootstrap
node_azure_stack -.-> node_azure_vm
node_azure_stack -.-> node_azure_nic
node_azure_stack -.-> node_azure_ssh
node_aws_stack -.-> node_ec2_module

click node_web "https://github.com/sanjeevmurthy/le-terraform/blob/main/app/web/app.js"
click node_api "https://github.com/sanjeevmurthy/le-terraform/blob/main/app/api/main.py"
click node_firestore "https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/firestore/main.tf"
click node_ingress "https://github.com/sanjeevmurthy/le-terraform/blob/main/k8s/30-ingress.yaml"
click node_k8s "https://github.com/sanjeevmurthy/le-terraform/tree/main/k8s"
click node_app_pipeline "https://github.com/sanjeevmurthy/le-terraform/blob/main/.github/workflows/gcp-app.yml"
click node_infra_pipeline "https://github.com/sanjeevmurthy/le-terraform/blob/main/.github/workflows/gcp-infra.yml"
click node_gcp_stack "https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/linkforge/main.tf"
click node_gcp_network "https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/network/main.tf"
click node_gcp_gke "https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/gke/main.tf"
click node_registry "https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/artifact-registry/main.tf"
click node_workload_identity "https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/workload-identity/main.tf"
click node_github_oidc "https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/github-oidc/main.tf"
click node_azure_stack "https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/k8s-cluster/main.tf"
click node_azure_bootstrap "https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/modules/k8s-bootstrap/main.tf"
click node_azure_vm "https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/modules/vm/main.tf"
click node_azure_nic "https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/modules/nic/main.tf"
click node_azure_ssh "https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/modules/ssh-key/main.tf"
click node_azure_pipeline "https://github.com/sanjeevmurthy/le-terraform/blob/main/.github/workflows/k8s-cluster-infra-azure.yaml"
click node_aws_stack "https://github.com/sanjeevmurthy/le-terraform/blob/main/AWS/ec2-k8s-cluster/main.tf"
click node_ec2_module "https://github.com/sanjeevmurthy/le-terraform/blob/main/AWS/modules/ec2-instance/main.tf"
click node_aws_pipeline "https://github.com/sanjeevmurthy/le-terraform/blob/main/.github/workflows/k8s-cluster-infra.yaml"

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_web,node_api,node_firestore toneBlue
class node_ingress,node_k8s,node_app_pipeline toneAmber
class node_infra_pipeline,node_gcp_stack,node_gcp_network,node_gcp_gke,node_registry,node_workload_identity,node_github_oidc toneMint
class node_azure_stack,node_azure_bootstrap,node_azure_vm,node_azure_nic,node_azure_ssh,node_azure_pipeline toneRose
class node_aws_stack,node_ec2_module,node_aws_pipeline,node_visitor toneIndigo
```

## Components

### LinkForge application

- [Web UI](https://github.com/sanjeevmurthy/le-terraform/blob/main/app/web/app.js): `app/web/app.js`
- [Link API](https://github.com/sanjeevmurthy/le-terraform/blob/main/app/api/main.py): `app/api/main.py`
- [Firestore](https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/firestore/main.tf): `GCP/modules/firestore/main.tf`

### GKE runtime

- [Ingress routing](https://github.com/sanjeevmurthy/le-terraform/blob/main/k8s/30-ingress.yaml): `k8s/30-ingress.yaml`
- [Kubernetes workloads](https://github.com/sanjeevmurthy/le-terraform/tree/main/k8s): `k8s`
- [App pipeline](https://github.com/sanjeevmurthy/le-terraform/blob/main/.github/workflows/gcp-app.yml): `.github/workflows/gcp-app.yml`

### GCP infrastructure

- [Infra pipeline](https://github.com/sanjeevmurthy/le-terraform/blob/main/.github/workflows/gcp-infra.yml): `.github/workflows/gcp-infra.yml`
- [GCP root stack](https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/linkforge/main.tf): `GCP/linkforge/main.tf`
- [VPC network](https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/network/main.tf): `GCP/modules/network/main.tf`
- [GKE cluster](https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/gke/main.tf): `GCP/modules/gke/main.tf`
- [Artifact Registry](https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/artifact-registry/main.tf): `GCP/modules/artifact-registry/main.tf`
- [Workload identity](https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/workload-identity/main.tf): `GCP/modules/workload-identity/main.tf`
- [GitHub OIDC](https://github.com/sanjeevmurthy/le-terraform/blob/main/GCP/modules/github-oidc/main.tf): `GCP/modules/github-oidc/main.tf`

### Azure cluster

- [Azure VM cluster](https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/k8s-cluster/main.tf): `Azure/k8s-cluster/main.tf`
- [Kubernetes bootstrap](https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/modules/k8s-bootstrap/main.tf): `Azure/modules/k8s-bootstrap/main.tf`
- [Azure VM](https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/modules/vm/main.tf): `Azure/modules/vm/main.tf`
- [Network interface](https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/modules/nic/main.tf): `Azure/modules/nic/main.tf`
- [SSH key](https://github.com/sanjeevmurthy/le-terraform/blob/main/Azure/modules/ssh-key/main.tf): `Azure/modules/ssh-key/main.tf`
- [Azure infra workflow](https://github.com/sanjeevmurthy/le-terraform/blob/main/.github/workflows/k8s-cluster-infra-azure.yaml): `.github/workflows/k8s-cluster-infra-azure.yaml`

### AWS cluster

- [EC2 Kubernetes cluster](https://github.com/sanjeevmurthy/le-terraform/blob/main/AWS/ec2-k8s-cluster/main.tf): `AWS/ec2-k8s-cluster/main.tf`
- [EC2 instance module](https://github.com/sanjeevmurthy/le-terraform/blob/main/AWS/modules/ec2-instance/main.tf): `AWS/modules/ec2-instance/main.tf`
- [AWS infra workflow](https://github.com/sanjeevmurthy/le-terraform/blob/main/.github/workflows/k8s-cluster-infra.yaml): `.github/workflows/k8s-cluster-infra.yaml`

### Other components

- **Visitor**

## Connections

- Visitor → Ingress routing: visits (evidence: `README.md`)
- Ingress routing → Web UI: routes web (evidence: `README.md`)
- Ingress routing → Link API: routes API (evidence: `README.md`)
- Web UI → Link API: calls API (evidence: `app/web/app.js`)
- Link API → Firestore: reads and writes (evidence: `app/api/main.py`)
- App pipeline → Kubernetes workloads: deploys app (evidence: `README.md`)
- Infra pipeline → GCP root stack: runs Terraform (evidence: `README.md`)
- Azure infra workflow → Azure VM cluster: runs Terraform (evidence: `README.md`)
- AWS infra workflow → EC2 Kubernetes cluster: runs Terraform (evidence: `README.md`)
- GCP root stack → VPC network
- GCP root stack → GKE cluster
- GCP root stack → Artifact Registry
- GCP root stack → Firestore
- GCP root stack → Workload identity
- GCP root stack → GitHub OIDC
- Azure VM cluster → Kubernetes bootstrap
- Azure VM cluster → Azure VM
- Azure VM cluster → Network interface
- Azure VM cluster → SSH key
- EC2 Kubernetes cluster → EC2 instance module
