# srikanth-kola-personal/azure-platform-engineering-lab architecture

> Architecture diagram of the GitHub repository srikanth-kola-personal/azure-platform-engineering-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/srikanth-kola-personal/azure-platform-engineering-lab
- Repository: https://github.com/srikanth-kola-personal/azure-platform-engineering-lab

## Overview

This repository is a hands-on Azure internal developer platform lab. Its main flow is a developer request through GitHub Actions, generated application repository, Terraform provisioning and deployment, endpoint monitoring, and TTL-driven cleanup. The controller supplies the lifecycle state machine, inventory, reconciliation, and guarded repository deletion. The README documents the product flow and three golden paths; source excerpts support the controller’s internal calls. Workflow and Terraform implementation details are not sampled, so those links rely on README statements.

Main entry points: [`controller/src/cli.ts`](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/cli.ts) (Controller CLI), [`controller/src/lifecycle.ts`](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/lifecycle.ts) (Lifecycle service), [`scripts/New-GeneratedRepository.ps1`](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/scripts/New-GeneratedRepository.ps1) (Generated repository), [`controller/src/reconciler.ts`](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/reconciler.ts) (Reconciliation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_request["Self-service requests"]
  node_request_workflow["Request workflow"]
  node_generated_repo["Generated repository"]
end

subgraph group_delivery["Application delivery"]
  node_scaffold["Application scaffold"]
  node_golden_paths["Golden paths"]
  node_delivery_workflow["Deploy workflow<br/>[deploy.yml]"]
  node_runner["Terraform runner"]
  node_endpoint(("Application endpoint"))
end

subgraph group_azure["Azure platform"]
  node_bootstrap["Bootstrap resources<br/>[main.tf]"]
  node_shared_platform["Shared platform<br/>[main.tf]"]
  node_governance["Policy guardrails"]
  node_monitoring["Monitoring"]
end

subgraph group_lifecycle["Lifecycle control"]
  node_inventory[("Environment inventory<br/>[inventory.ts]")]
  node_controller_cli["Controller CLI<br/>[cli.ts]"]
  node_lifecycle_service["Lifecycle service<br/>[lifecycle.ts]"]
  node_reconcile["Reconciliation<br/>[reconciler.ts]"]
  node_repository_delete["Safe repository deletion<br/>[github.ts]"]
end

subgraph group_controller["Controller internals"]
  node_schema["Request and record validation<br/>[schema.ts]"]
  node_state_machine["Lifecycle state machine<br/>[state-machine.ts]"]
  node_azure_token["Azure token provider<br/>[access-token.ts]"]
  node_environment_ids["UUID generation<br/>[uuidv7.ts]"]
end

node_developer(("Developer"))
node_github["GitHub"]
node_azure["Azure subscription"]

node_developer -->|"requests environment"| node_request_workflow
node_request_workflow -->|"creates repository"| node_generated_repo
node_generated_repo -->|"uses scaffold"| node_scaffold
node_generated_repo -->|"selects path"| node_golden_paths
node_generated_repo -->|"deploys through"| node_delivery_workflow
node_delivery_workflow -->|"runs Terraform"| node_runner
node_golden_paths -->|"provisions environment"| node_azure
node_delivery_workflow -->|"deploys application"| node_endpoint
node_bootstrap -->|"bootstraps subscription"| node_azure
node_shared_platform -->|"provides shared resources"| node_azure
node_governance -->|"constrains resources"| node_golden_paths
node_monitoring -->|"observes workloads"| node_azure
node_endpoint -->|"is observed by"| node_monitoring
node_request_workflow -.->|"initializes lifecycle"| node_controller_cli
node_controller_cli -->|"validates inputs"| node_schema
node_controller_cli -->|"invokes lifecycle"| node_lifecycle_service
node_controller_cli -->|"requests deletion"| node_repository_delete
node_lifecycle_service -->|"reads and updates"| node_inventory
node_lifecycle_service -->|"transitions phases"| node_state_machine
node_lifecycle_service -->|"parses extensions"| node_schema
node_lifecycle_service -->|"creates operation IDs"| node_environment_ids
node_repository_delete -->|"verifies absence"| node_state_machine
node_reconcile -->|"selects cleanup actions"| node_controller_cli
node_controller_cli -->|"lists environments"| node_inventory
node_azure_token -.->|"gets storage token"| node_azure
node_reconcile -->|"checks expiry and absence"| node_azure
node_reconcile -->|"guards repository cleanup"| node_repository_delete

click node_request_workflow "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/.github/workflows/request-environment.yml"
click node_generated_repo "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/scripts/New-GeneratedRepository.ps1"
click node_scaffold "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/tree/main/scaffolds/application"
click node_golden_paths "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/tree/main/golden-paths"
click node_delivery_workflow "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/scaffolds/application/base/.github/workflows/deploy.yml"
click node_runner "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/tree/main/runner/ade-terraform"
click node_bootstrap "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/bootstrap/main.tf"
click node_shared_platform "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/platform/main.tf"
click node_governance "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/tree/main/policies"
click node_monitoring "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/platform/lifecycle-monitoring.tf"
click node_inventory "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/inventory.ts"
click node_controller_cli "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/cli.ts"
click node_lifecycle_service "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/lifecycle.ts"
click node_reconcile "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/reconciler.ts"
click node_repository_delete "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/github.ts"
click node_schema "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/schema.ts"
click node_state_machine "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/state-machine.ts"
click node_azure_token "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/access-token.ts"
click node_environment_ids "https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/uuidv7.ts"

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_request_workflow,node_generated_repo toneBlue
class node_scaffold,node_golden_paths,node_delivery_workflow,node_runner,node_endpoint toneAmber
class node_bootstrap,node_shared_platform,node_governance,node_monitoring toneMint
class node_inventory,node_controller_cli,node_lifecycle_service,node_reconcile,node_repository_delete toneRose
class node_schema,node_state_machine,node_azure_token,node_environment_ids,node_developer,node_github,node_azure toneIndigo
```

## Components

### Self-service requests

- [Request workflow](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/.github/workflows/request-environment.yml): `.github/workflows/request-environment.yml`
- [Generated repository](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/scripts/New-GeneratedRepository.ps1): `scripts/New-GeneratedRepository.ps1`

### Application delivery

- [Application scaffold](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/tree/main/scaffolds/application): `scaffolds/application`
- [Golden paths](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/tree/main/golden-paths): `golden-paths`
- [Deploy workflow](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/scaffolds/application/base/.github/workflows/deploy.yml): `scaffolds/application/base/.github/workflows/deploy.yml`
- [Terraform runner](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/tree/main/runner/ade-terraform): `runner/ade-terraform`
- **Application endpoint**

### Azure platform

- [Bootstrap resources](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/bootstrap/main.tf): `bootstrap/main.tf`
- [Shared platform](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/platform/main.tf): `platform/main.tf`
- [Policy guardrails](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/tree/main/policies): `policies`
- [Monitoring](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/platform/lifecycle-monitoring.tf): `platform/lifecycle-monitoring.tf`

### Lifecycle control

- [Environment inventory](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/inventory.ts): `controller/src/inventory.ts`
- [Controller CLI](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/cli.ts): `controller/src/cli.ts`
- [Lifecycle service](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/lifecycle.ts): `controller/src/lifecycle.ts`
- [Reconciliation](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/reconciler.ts): `controller/src/reconciler.ts`
- [Safe repository deletion](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/github.ts): `controller/src/github.ts`

### Controller internals

- [Request and record validation](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/schema.ts): `controller/src/schema.ts`
- [Lifecycle state machine](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/state-machine.ts): `controller/src/state-machine.ts`
- [Azure token provider](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/access-token.ts): `controller/src/access-token.ts`
- [UUID generation](https://github.com/srikanth-kola-personal/azure-platform-engineering-lab/blob/main/controller/src/uuidv7.ts): `controller/src/uuidv7.ts`

### Other components

- **Developer**
- **GitHub**
- **Azure subscription**

## Connections

- Developer → Request workflow: requests environment (evidence: `README.md`)
- Request workflow → Generated repository: creates repository (evidence: `README.md`)
- Generated repository → Application scaffold: uses scaffold (evidence: `README.md`)
- Generated repository → Golden paths: selects path (evidence: `README.md`)
- Generated repository → Deploy workflow: deploys through (evidence: `README.md`)
- Deploy workflow → Terraform runner: runs Terraform (evidence: `README.md`)
- Golden paths → Azure subscription: provisions environment (evidence: `README.md`)
- Deploy workflow → Application endpoint: deploys application (evidence: `README.md`)
- Bootstrap resources → Azure subscription: bootstraps subscription (evidence: `README.md`)
- Shared platform → Azure subscription: provides shared resources (evidence: `README.md`)
- Policy guardrails → Golden paths: constrains resources (evidence: `README.md`)
- Monitoring → Azure subscription: observes workloads (evidence: `README.md`)
- Application endpoint → Monitoring: is observed by (evidence: `README.md`)
- Request workflow → Controller CLI: initializes lifecycle
- Controller CLI → Request and record validation: validates inputs (evidence: `controller/src/cli.ts`)
- Controller CLI → Lifecycle service: invokes lifecycle (evidence: `controller/src/cli.ts`)
- Controller CLI → Safe repository deletion: requests deletion (evidence: `controller/src/cli.ts`)
- Lifecycle service → Environment inventory: reads and updates (evidence: `controller/src/lifecycle.ts`)
- Lifecycle service → Lifecycle state machine: transitions phases (evidence: `controller/src/lifecycle.ts`)
- Lifecycle service → Request and record validation: parses extensions (evidence: `controller/src/lifecycle.ts`)
- Lifecycle service → UUID generation: creates operation IDs (evidence: `controller/src/lifecycle.ts`)
- Safe repository deletion → Lifecycle state machine: verifies absence (evidence: `controller/src/github.ts`)
- Reconciliation → Controller CLI: selects cleanup actions (evidence: `controller/src/cli.ts`)
- Controller CLI → Environment inventory: lists environments (evidence: `controller/src/cli.ts`)
- Azure token provider → Azure subscription: gets storage token
- Reconciliation → Azure subscription: checks expiry and absence (evidence: `README.md`)
- Reconciliation → Safe repository deletion: guards repository cleanup (evidence: `README.md`)
