# wnqueiroz/platform-engineering-backstack architecture

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

- Interactive diagram: https://gitdiagram.com/wnqueiroz/platform-engineering-backstack
- Repository: https://github.com/wnqueiroz/platform-engineering-backstack

## Overview

1. **Overall shape**
   This repo is a multi-component platform engineering lab centered on a single local Kubernetes cluster named `platform` (created with `kind`). The cluster hosts the platform services, while the repo provides GitOps manifests, Crossplane definitions, Backstage configuration, and bootstrap scripts to bring everything up.

2. **Primary control-plane flow**
   The operational entrypoint is the root `Makefile` plus the `.bootstrap/**/up.sh` scripts. Those scripts install or apply the initial platform components into the cluster. After that, **Argo CD** becomes the main reconciler: it watches the `argocd/` tree and syncs the platform apps from Git into Kubernetes.

3. **Argo CD as application orchestrator**
   The `argocd/` directory is organized as an app-of-apps style setup. It defines Argo CD applications for:
   - `backstage`
   - `crossplane`
   - `crossview`
   - `kyverno`
   - `localstack`
   
   This makes Argo CD the boundary between Git-defined desired state and the live cluster.

4. **Crossplane as infrastructure control plane**
   The `crossplane/` folder contains the declarative infrastructure model:
   - `xrds/xqueue.yaml` defines the platform abstraction.
   - `compositions/aws/xqueue.yaml` binds that abstraction to concrete resources.
   - `providers/` and `providers-config/` define the resource providers and their credentials/config.
   - `claims/` contains example user-facing requests for infrastructure.
   
   In practice, developers create a claim, Crossplane turns it into composed resources, and those resources are reconciled against either AWS or the local emulator.

5. **LocalStack as the external cloud boundary**
   LocalStack is deployed inside the cluster to emulate AWS services locally. The Crossplane AWS provider is wired to LocalStack through provider config, letting the platform simulate cloud provisioning without a real AWS account. This is a key architectural substitute for external cloud infrastructure.

6. **Backstage as the developer portal**
   The `backstage/` tree is a full Backstage app split into frontend and backend packages. It provides the developer-facing entrypoint for the platform:
   - catalog definitions live under `backstage/catalog/`
   - template scaffolding lives under `backstage/catalog/templates/`
   - the backend includes a custom `crossplane-entity-provider.ts`
   
   This means Backstage is not just documentation/search; it also acts as a discovery surface for Crossplane-managed platform entities.

7. **Backstage-to-Crossplane integration**
   The Backstage catalog includes an `xqueue-claim` template that generates claim YAML, which is the user-facing abstraction for requesting infrastructure. That creates a workflow where a developer uses Backstage to instantiate a Crossplane claim, and Crossplane handles the provisioning lifecycle in the cluster.

8. **Crossview as observability for the control plane**
   `crossview/` deploys a separate UI for inspecting Crossplane resources. Its manifests include a namespace, Postgres, RBAC, config, secrets, service, and deployment, indicating it has its own application state and permissions. Architecturally, Crossview is the diagnostic/visualization layer for understanding XRDs, compositions, claims, and their relationships.

9. **Kyverno as policy enforcement**
   `kyverno/validate-xqueue-fields.yaml` contains cluster policy for validating platform resource fields. This is the admission/policy boundary: it constrains what claims or resources are considered valid before they are accepted by the cluster. The GitHub workflow `validate-claims.yaml` suggests these rules are also checked in CI.

10. **Bootstrap layer vs steady-state GitOps**
   The `.bootstrap/` manifests represent the initial installation path for each subsystem, including Argo CD, Backstage, Crossplane, Crossview, Kyverno, and LocalStack. The repository’s roadmap explicitly aims to shift more of this setup into Argo CD, so the long-term model is for GitOps to manage not only apps and claims, but also more of the cluster bootstrap itself.

11. **Runtime and infrastructure assumptions**
   The stack relies on Kubernetes tooling (`kind`, `kubectl`, `helm`) and a local Docker-based environment. The repo also requires a GitHub personal access token for Backstage-related repo access and PR workflows. These are not product features, but they materially shape how the platform is bootstrapped and operated.

12. **Main data/control flows to diagram**
   The most important flows to capture are:
   - Git repo → Argo CD → Kubernetes apps
   - Backstage user action → generated claim YAML → Crossplane reconciliation
   - Crossplane claim → composed resources → LocalStack/AWS provider
   - Kyverno policy → admission control for platform resources
   - Crossview → reads cluster/Crossplane state for visualization

13. **Notable boundary between concerns**
   The repository cleanly separates:
   - **developer experience**: Backstage
   - **delivery/sync**: Argo CD
   - **infrastructure provisioning**: Crossplane
   - **policy**: Kyverno
   - **cloud emulation**: LocalStack
   - **operational visibility**: Crossview
   
   That separation is the core architecture of the repo and is the key to drawing an accurate system diagram.

Main entry points: [`Makefile`](https://github.com/wnqueiroz/platform-engineering-backstack/tree/main/Makefile) (Makefile), [`argocd/apps.yaml`](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps.yaml) (App of apps), [`argocd/apps/crossplane/app.yaml`](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/crossplane/app.yaml) (Crossplane app), [`crossplane/claims/cncf-campinas-talk.yaml`](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/claims/cncf-campinas-talk.yaml) (Claims)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bootstrap["Bootstrap"]
  node_makefile["Makefile<br/>entrypoint"]
  node_bootstrap_argocd["Argo CD up<br/>bootstrap script<br/>[up.sh]"]
  node_bootstrap_backstage["Backstage up<br/>bootstrap script<br/>[up.sh]"]
  node_bootstrap_crossplane["Crossplane up<br/>bootstrap script<br/>[up.sh]"]
  node_bootstrap_crossview["Crossview up<br/>bootstrap script<br/>[up.sh]"]
  node_bootstrap_kyverno["Kyverno up<br/>bootstrap script<br/>[up.sh]"]
  node_bootstrap_localstack["LocalStack up<br/>bootstrap script<br/>[up.sh]"]
end

subgraph group_gitops["GitOps"]
  node_argocd_apps["App of apps<br/>gitops root<br/>[apps.yaml]"]
  node_argocd_backstage["Backstage app<br/>argo app<br/>[app.yaml]"]
  node_argocd_crossplane["Crossplane app<br/>argo app<br/>[app.yaml]"]
  node_argocd_crossview["Crossview app<br/>argo app<br/>[app.yaml]"]
  node_argocd_kyverno["Kyverno app<br/>argo app<br/>[app.yaml]"]
  node_argocd_localstack["LocalStack app<br/>argo app<br/>[app.yaml]"]
end

subgraph group_portal["Developer portal"]
  node_backstage_app["Backstage<br/>developer portal<br/>[App.tsx]"]
  node_backstage_catalog["Catalog<br/>[all.yaml]"]
  node_backstage_template["Xqueue template<br/>scaffolder template<br/>[template.yaml]"]
  node_backstage_provider["Entity provider<br/>backend integration"]
end

subgraph group_infra["Infrastructure control"]
  node_crossplane_xrd["XQueue XRD<br/>crossplane schema<br/>[xqueue.yaml]"]
  node_crossplane_comp["AWS composition<br/>crossplane composition<br/>[xqueue.yaml]"]
  node_crossplane_claims["Claims<br/>crossplane request"]
  node_crossplane_providers["Providers<br/>[sqs.yaml]"]
  node_crossplane_configs["Provider config<br/>crossplane config"]
end

subgraph group_policy["Policy"]
  node_kyverno_policy["Xqueue policy<br/>admission policy"]
end

subgraph group_observability["Visibility"]
  node_crossview_ui["Crossview<br/>inspection ui<br/>[deployment.yaml]"]
end

subgraph group_runtime["Runtime boundary"]
  node_localstack[("LocalStack<br/>aws emulator<br/>[deployment.yaml]")]
end

node_makefile -->|"boots"| node_bootstrap_argocd
node_makefile -->|"boots"| node_bootstrap_backstage
node_makefile -->|"boots"| node_bootstrap_crossplane
node_makefile -->|"boots"| node_bootstrap_crossview
node_makefile -->|"boots"| node_bootstrap_kyverno
node_makefile -->|"boots"| node_bootstrap_localstack
node_bootstrap_argocd -->|"installs"| node_argocd_apps
node_argocd_apps -->|"syncs"| node_argocd_backstage
node_argocd_apps -->|"syncs"| node_argocd_crossplane
node_argocd_apps -->|"syncs"| node_argocd_crossview
node_argocd_apps -->|"syncs"| node_argocd_kyverno
node_argocd_apps -->|"syncs"| node_argocd_localstack
node_argocd_backstage -->|"deploys"| node_backstage_app
node_argocd_crossplane -->|"applies"| node_crossplane_xrd
node_argocd_crossplane -->|"applies"| node_crossplane_comp
node_argocd_crossplane -->|"applies"| node_crossplane_providers
node_argocd_crossplane -->|"applies"| node_crossplane_configs
node_argocd_crossplane -->|"applies"| node_crossplane_claims
node_argocd_crossview -->|"deploys"| node_crossview_ui
node_argocd_kyverno -->|"applies"| node_kyverno_policy
node_argocd_localstack -->|"deploys"| node_localstack
node_backstage_app -->|"loads"| node_backstage_catalog
node_backstage_app -->|"scaffolds"| node_backstage_template
node_backstage_app -->|"extends"| node_backstage_provider
node_backstage_template -.->|"generates"| node_crossplane_claims
node_crossplane_claims -->|"matches"| node_crossplane_xrd
node_crossplane_xrd -->|"binds"| node_crossplane_comp
node_crossplane_comp -->|"uses"| node_crossplane_providers
node_crossplane_configs -->|"targets"| node_localstack
node_crossplane_providers -->|"provisions"| node_localstack
node_kyverno_policy -->|"validates"| node_crossplane_claims
node_crossview_ui -->|"inspects"| node_crossplane_xrd
node_crossview_ui -->|"inspects"| node_crossplane_claims

click node_makefile "https://github.com/wnqueiroz/platform-engineering-backstack/tree/main/Makefile"
click node_bootstrap_argocd "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/argocd/up.sh"
click node_bootstrap_backstage "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/backstage/up.sh"
click node_bootstrap_crossplane "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/crossplane/up.sh"
click node_bootstrap_crossview "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/crossview/up.sh"
click node_bootstrap_kyverno "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/kyverno/up.sh"
click node_bootstrap_localstack "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/localstack/up.sh"
click node_argocd_apps "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps.yaml"
click node_argocd_backstage "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/backstage/app.yaml"
click node_argocd_crossplane "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/crossplane/app.yaml"
click node_argocd_crossview "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/crossview/app.yaml"
click node_argocd_kyverno "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/kyverno/app.yaml"
click node_argocd_localstack "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/localstack/app.yaml"
click node_backstage_app "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/packages/app/src/App.tsx"
click node_backstage_catalog "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/catalog/all.yaml"
click node_backstage_template "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/catalog/templates/xqueue-claim/template.yaml"
click node_backstage_provider "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/packages/backend/src/crossplane-entity-provider.ts"
click node_crossplane_xrd "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/xrds/xqueue.yaml"
click node_crossplane_comp "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/compositions/aws/xqueue.yaml"
click node_crossplane_claims "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/claims/cncf-campinas-talk.yaml"
click node_crossplane_providers "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/providers/aws/sqs.yaml"
click node_crossplane_configs "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/providers-config/localstack-provider-config.yaml"
click node_crossview_ui "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/crossview/manifests/deployment.yaml"
click node_kyverno_policy "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/kyverno/validate-xqueue-fields.yaml"
click node_localstack "https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/localstack/manifests/deployment.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_makefile,node_bootstrap_argocd,node_bootstrap_backstage,node_bootstrap_crossplane,node_bootstrap_crossview,node_bootstrap_kyverno,node_bootstrap_localstack,node_localstack toneBlue
class node_argocd_apps,node_argocd_backstage,node_argocd_crossplane,node_argocd_crossview,node_argocd_kyverno,node_argocd_localstack toneAmber
class node_backstage_app,node_backstage_catalog,node_backstage_template,node_backstage_provider toneMint
class node_crossplane_xrd,node_crossplane_comp,node_crossplane_claims,node_crossplane_providers,node_crossplane_configs toneRose
class node_kyverno_policy toneIndigo
class node_crossview_ui toneTeal
```

## Components

### Bootstrap

One-time cluster bring-up scripts and manifests.

- [Makefile](https://github.com/wnqueiroz/platform-engineering-backstack/tree/main/Makefile): entrypoint · Top-level operational entrypoint for the repo. · `Makefile`
- [Argo CD up](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/argocd/up.sh): bootstrap script · Initial installs for Argo CD into the local cluster. · `.bootstrap/argocd/up.sh`
- [Backstage up](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/backstage/up.sh): bootstrap script · Bootstraps the Backstage deployment and config. · `.bootstrap/backstage/up.sh`
- [Crossplane up](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/crossplane/up.sh): bootstrap script · Bootstraps Crossplane credentials and install state. · `.bootstrap/crossplane/up.sh`
- [Crossview up](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/crossview/up.sh): bootstrap script · Bootstraps Crossview namespace, database, and app. · `.bootstrap/crossview/up.sh`
- [Kyverno up](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/kyverno/up.sh): bootstrap script · Bootstraps Kyverno policy enforcement. · `.bootstrap/kyverno/up.sh`
- [LocalStack up](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/localstack/up.sh): bootstrap script · Bootstraps the AWS emulator into the cluster. · `.bootstrap/localstack/up.sh`

### GitOps

Argo CD root and application definitions.

- [App of apps](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps.yaml): gitops root · Argo CD root application that fans out platform apps. · `argocd/apps.yaml`
- [Backstage app](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/backstage/app.yaml): argo app · Argo CD application for Backstage. · `argocd/apps/backstage/app.yaml`
- [Crossplane app](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/crossplane/app.yaml): argo app · Argo CD application for Crossplane. · `argocd/apps/crossplane/app.yaml`
- [Crossview app](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/crossview/app.yaml): argo app · Argo CD application for Crossview. · `argocd/apps/crossview/app.yaml`
- [Kyverno app](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/kyverno/app.yaml): argo app · Argo CD application for Kyverno. · `argocd/apps/kyverno/app.yaml`
- [LocalStack app](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/argocd/apps/localstack/app.yaml): argo app · Argo CD application for LocalStack. · `argocd/apps/localstack/app.yaml`

### Developer portal

Backstage app, catalog, and scaffolding flow.

- [Backstage](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/packages/app/src/App.tsx): developer portal · Developer portal UI and backend for catalog and templates. · `backstage/packages/app/src/App.tsx`
- [Catalog](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/catalog/all.yaml): catalog config · Catalog entities and aggregated sources. · `backstage/catalog/all.yaml`
- [Xqueue template](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/catalog/templates/xqueue-claim/template.yaml): scaffolder template · Template that generates Crossplane claim YAML. · `backstage/catalog/templates/xqueue-claim/template.yaml`
- [Entity provider](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/packages/backend/src/crossplane-entity-provider.ts): backend integration · Custom provider that surfaces Crossplane entities to Backstage. · `backstage/packages/backend/src/crossplane-entity-provider.ts`

### Infrastructure control

Crossplane abstractions, compositions, providers, and claims.

- [XQueue XRD](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/xrds/xqueue.yaml): crossplane schema · Platform abstraction for queue-like infrastructure. · `crossplane/xrds/xqueue.yaml`
- [AWS composition](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/compositions/aws/xqueue.yaml): crossplane composition · Maps the XQueue abstraction to concrete resources. · `crossplane/compositions/aws/xqueue.yaml`
- [Claims](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/claims/cncf-campinas-talk.yaml): crossplane request · Example user-facing infrastructure requests. · `crossplane/claims/cncf-campinas-talk.yaml`
- [Providers](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/providers/aws/sqs.yaml): crossplane providers · AWS and Kubernetes providers used by Crossplane. · `crossplane/providers/aws/sqs.yaml`
- [Provider config](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/crossplane/providers-config/localstack-provider-config.yaml): crossplane config · Provider configuration for local and cluster-backed endpoints. · `crossplane/providers-config/localstack-provider-config.yaml`

### Policy

Admission and validation for platform resources.

- [Xqueue policy](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/kyverno/validate-xqueue-fields.yaml): admission policy · Validation policy for xqueue fields. · `kyverno/validate-xqueue-fields.yaml`

### Visibility

Crossplane inspection and diagnostic UI.

- [Crossview](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/crossview/manifests/deployment.yaml): inspection ui · Separate UI for viewing Crossplane resources and relationships. · `.bootstrap/crossview/manifests/deployment.yaml`

### Runtime boundary

Local cloud emulation and target services.

- [LocalStack](https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/.bootstrap/localstack/manifests/deployment.yaml): aws emulator · Local cloud boundary that emulates AWS services. · `.bootstrap/localstack/manifests/deployment.yaml`

## Connections

- Makefile → Argo CD up: boots · Runs cluster bootstrap for Argo CD.
- Makefile → Backstage up: boots · Runs cluster bootstrap for Backstage.
- Makefile → Crossplane up: boots · Runs cluster bootstrap for Crossplane.
- Makefile → Crossview up: boots · Runs cluster bootstrap for Crossview.
- Makefile → Kyverno up: boots · Runs cluster bootstrap for Kyverno.
- Makefile → LocalStack up: boots · Runs cluster bootstrap for LocalStack.
- Argo CD up → App of apps: installs · Seeds the GitOps root application.
- App of apps → Backstage app: syncs · Argo CD fans out the Backstage app.
- App of apps → Crossplane app: syncs · Argo CD fans out the Crossplane app.
- App of apps → Crossview app: syncs · Argo CD fans out the Crossview app.
- App of apps → Kyverno app: syncs · Argo CD fans out the Kyverno app.
- App of apps → LocalStack app: syncs · Argo CD fans out the LocalStack app.
- Backstage app → Backstage: deploys · Deploys the developer portal.
- Crossplane app → XQueue XRD: applies · Delivers Crossplane platform definitions.
- Crossplane app → AWS composition: applies · Delivers compositions.
- Crossplane app → Providers: applies · Delivers provider packages.
- Crossplane app → Provider config: applies · Delivers provider configuration.
- Crossplane app → Claims: applies · Delivers sample claims.
- Crossview app → Crossview: deploys · Deploys the inspection UI.
- Kyverno app → Xqueue policy: applies · Installs admission policy.
- LocalStack app → LocalStack: deploys · Deploys the AWS emulator.
- Backstage → Catalog: loads · Backstage reads catalog sources.
- Backstage → Xqueue template: scaffolds · Users generate claims from the template.
- Backstage → Entity provider: extends · Backend surfaces Crossplane entities.
- Xqueue template → Claims: generates · Template outputs claim manifests.
- Claims → XQueue XRD: matches · Claims target the XQueue abstraction.
- XQueue XRD → AWS composition: binds · XRD is implemented by the composition.
- AWS composition → Providers: uses · Composition drives provider resources.
- Provider config → LocalStack: targets · Provider config points AWS provider at LocalStack.
- Providers → LocalStack: provisions · Provider manages emulated AWS services.
- Xqueue policy → Claims: validates · Policy constrains accepted queue claims.
- Crossview → XQueue XRD: inspects · Crossview visualizes the Crossplane model.
- Crossview → Claims: inspects · Crossview visualizes claims and status.
