# abdalrhman-mostafa/payops-gitops architecture

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

- Interactive diagram: https://gitdiagram.com/abdalrhman-mostafa/payops-gitops
- Repository: https://github.com/abdalrhman-mostafa/payops-gitops

## Overview

This repository is the GitOps desired-state source for PayOps, Ecommerce, and cluster add-ons; it does not build application images. The main workflow is a reviewed change on `main`, detected and reconciled by Argo CD from a cluster-specific root Application through child Applications to Kubernetes workloads. Kustomize bases and environment overlays define the application deployments; Argo CD also installs documented platform charts. The webhook bootstrap scripts are operational integrations, not part of the regular reconciliation path. Relationships below follow the README or shown script behavior; unsampled manifest wiring is represented only where documented.

Main entry points: [`apps/clusters/eks-prod`](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/clusters/eks-prod) (EKS child Applications), [`apps/ecommerce/base`](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/ecommerce/base) (Ecommerce workloads), [`apps/ecommerce/scripts/bootstrap-payops-webhook.mjs`](https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/ecommerce/scripts/bootstrap-payops-webhook.mjs) (Webhook bootstrap), [`ops/ansible/scripts/register-kind-payops-webhook.mjs`](https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/ops/ansible/scripts/register-kind-payops-webhook.mjs) (Kind webhook registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reconcile["GitOps Reconciliation"]
  node_argocd["Argo CD"]
  node_eksroot["EKS root Application<br/>[root-app.yaml]"]
  node_kindroot["Kind root Application<br/>[root-app-kind.yaml]"]
  node_ekschildren["EKS child Applications"]
  node_kindchildren["Kind child Applications"]
end

subgraph group_commerce["Ecommerce Workloads"]
  node_ecommerce["Ecommerce workloads"]
  node_ecommerceenv["Ecommerce overlays"]
  node_ecomdata[("Commerce and identity databases")]
  node_ecomwebhook["Webhook bootstrap"]
  node_localenv["Local secret import"]
end

subgraph group_payments["PayOps Workloads"]
  node_payops["PayOps backend and worker"]
  node_payopsenv["PayOps overlays"]
  node_payopsdata[("PayOps PostgreSQL and Redis")]
  node_payopsjobs["PayOps migration and seed"]
  node_kindwebhook["Kind webhook registration"]
end

subgraph group_platform["Cluster Platform"]
  node_ingress["Ingress NGINX<br/>[ingress-nginx.yaml]"]
  node_monitoring["Monitoring chart<br/>[values.yaml]"]
end

node_git(("Reviewed Git change"))
node_cluster["Kubernetes cluster"]
node_awssecrets[("AWS Secrets Manager")]
node_payopsapi["PayOps API"]

node_git -->|"detects changes"| node_argocd
node_argocd -->|"reconciles root"| node_eksroot
node_argocd -->|"reconciles root"| node_kindroot
node_eksroot -->|"creates children"| node_ekschildren
node_kindroot -->|"creates children"| node_kindchildren
node_ekschildren -->|"syncs workloads"| node_ecommerce
node_ekschildren -->|"syncs workloads"| node_payops
node_kindchildren -->|"syncs workloads"| node_ecommerce
node_kindchildren -->|"syncs workloads"| node_payops
node_ekschildren -->|"installs chart"| node_ingress
node_ekschildren -->|"installs chart"| node_monitoring
node_ecommerceenv -->|"configures deployment"| node_ecommerce
node_payopsenv -->|"configures deployment"| node_payops
node_ecomwebhook -->|"registers endpoint"| node_payopsapi
node_ecomwebhook -->|"updates secret"| node_awssecrets
node_ecomwebhook -->|"restarts deployment"| node_ecommerce
node_ecomwebhook -->|"uses port-forward"| node_cluster
node_kindwebhook -->|"registers endpoint"| node_payopsapi
node_kindwebhook -->|"writes secret and restarts"| node_ecommerce
node_kindwebhook -->|"uses port-forward"| node_cluster

click node_eksroot "https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/bootstrap/root-app.yaml"
click node_kindroot "https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/bootstrap/root-app-kind.yaml"
click node_ekschildren "https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/clusters/eks-prod"
click node_kindchildren "https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/clusters/kind-dev"
click node_ecommerce "https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/ecommerce/base"
click node_ecommerceenv "https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/ecommerce/overlays"
click node_ecomdata "https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/ecommerce/base/commerce-db"
click node_ecomwebhook "https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/ecommerce/scripts/bootstrap-payops-webhook.mjs"
click node_payops "https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/payops/base/backend-and-worker"
click node_payopsenv "https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/payops/overlays"
click node_payopsdata "https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/payops/base/postgres"
click node_payopsjobs "https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/payops/base/mock-psp-and-migrate"
click node_kindwebhook "https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/ops/ansible/scripts/register-kind-payops-webhook.mjs"
click node_localenv "https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/ops/ansible/import-local-env.mjs"
click node_ingress "https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/clusters/eks-prod/applications/ingress-nginx.yaml"
click node_monitoring "https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/platform/monitoring/values.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_argocd,node_eksroot,node_kindroot,node_ekschildren,node_kindchildren,node_git toneBlue
class node_ecommerce,node_ecommerceenv,node_ecomdata,node_ecomwebhook,node_localenv,node_awssecrets toneAmber
class node_payops,node_payopsenv,node_payopsdata,node_payopsjobs,node_kindwebhook,node_payopsapi toneMint
class node_ingress,node_monitoring toneRose
class node_cluster toneIndigo
```

## Components

### GitOps Reconciliation

- **Argo CD**
- [EKS root Application](https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/bootstrap/root-app.yaml): `apps/bootstrap/root-app.yaml`
- [Kind root Application](https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/bootstrap/root-app-kind.yaml): `apps/bootstrap/root-app-kind.yaml`
- [EKS child Applications](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/clusters/eks-prod): `apps/clusters/eks-prod`
- [Kind child Applications](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/clusters/kind-dev): `apps/clusters/kind-dev`

### Ecommerce Workloads

- [Ecommerce workloads](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/ecommerce/base): `apps/ecommerce/base`
- [Ecommerce overlays](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/ecommerce/overlays): `apps/ecommerce/overlays`
- [Commerce and identity databases](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/ecommerce/base/commerce-db): `apps/ecommerce/base/commerce-db`
- [Webhook bootstrap](https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/ecommerce/scripts/bootstrap-payops-webhook.mjs): `apps/ecommerce/scripts/bootstrap-payops-webhook.mjs`
- [Local secret import](https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/ops/ansible/import-local-env.mjs): `ops/ansible/import-local-env.mjs`

### PayOps Workloads

- [PayOps backend and worker](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/payops/base/backend-and-worker): `apps/payops/base/backend-and-worker`
- [PayOps overlays](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/payops/overlays): `apps/payops/overlays`
- [PayOps PostgreSQL and Redis](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/payops/base/postgres): `apps/payops/base/postgres`
- [PayOps migration and seed](https://github.com/abdalrhman-mostafa/payops-gitops/tree/main/apps/payops/base/mock-psp-and-migrate): `apps/payops/base/mock-psp-and-migrate`
- [Kind webhook registration](https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/ops/ansible/scripts/register-kind-payops-webhook.mjs): `ops/ansible/scripts/register-kind-payops-webhook.mjs`

### Cluster Platform

- [Ingress NGINX](https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/clusters/eks-prod/applications/ingress-nginx.yaml): `apps/clusters/eks-prod/applications/ingress-nginx.yaml`
- [Monitoring chart](https://github.com/abdalrhman-mostafa/payops-gitops/blob/main/apps/platform/monitoring/values.yaml): `apps/platform/monitoring/values.yaml`

### Other components

- **Reviewed Git change**
- **Kubernetes cluster**
- **AWS Secrets Manager**
- **PayOps API**

## Connections

- Reviewed Git change → Argo CD: detects changes (evidence: `README.md`)
- Argo CD → EKS root Application: reconciles root (evidence: `README.md`)
- Argo CD → Kind root Application: reconciles root (evidence: `README.md`)
- EKS root Application → EKS child Applications: creates children (evidence: `README.md`)
- Kind root Application → Kind child Applications: creates children (evidence: `README.md`)
- EKS child Applications → Ecommerce workloads: syncs workloads (evidence: `README.md`)
- EKS child Applications → PayOps backend and worker: syncs workloads (evidence: `README.md`)
- Kind child Applications → Ecommerce workloads: syncs workloads (evidence: `README.md`)
- Kind child Applications → PayOps backend and worker: syncs workloads (evidence: `README.md`)
- EKS child Applications → Ingress NGINX: installs chart (evidence: `README.md`)
- EKS child Applications → Monitoring chart: installs chart (evidence: `README.md`)
- Ecommerce overlays → Ecommerce workloads: configures deployment (evidence: `README.md`)
- PayOps overlays → PayOps backend and worker: configures deployment (evidence: `README.md`)
- Webhook bootstrap → PayOps API: registers endpoint (evidence: `apps/ecommerce/scripts/bootstrap-payops-webhook.mjs`)
- Webhook bootstrap → AWS Secrets Manager: updates secret (evidence: `apps/ecommerce/scripts/bootstrap-payops-webhook.mjs`)
- Webhook bootstrap → Ecommerce workloads: restarts deployment (evidence: `apps/ecommerce/scripts/bootstrap-payops-webhook.mjs`)
- Webhook bootstrap → Kubernetes cluster: uses port-forward (evidence: `apps/ecommerce/scripts/bootstrap-payops-webhook.mjs`)
- Kind webhook registration → PayOps API: registers endpoint (evidence: `ops/ansible/scripts/register-kind-payops-webhook.mjs`)
- Kind webhook registration → Ecommerce workloads: writes secret and restarts (evidence: `ops/ansible/scripts/register-kind-payops-webhook.mjs`)
- Kind webhook registration → Kubernetes cluster: uses port-forward (evidence: `ops/ansible/scripts/register-kind-payops-webhook.mjs`)
