# qorgh529/eks-petclinic-3tier architecture

> Architecture diagram of the GitHub repository qorgh529/eks-petclinic-3tier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/qorgh529/eks-petclinic-3tier
- Repository: https://github.com/qorgh529/eks-petclinic-3tier

## Overview

This repository packages the Spring PetClinic staff application as a three-tier service and provides its AWS EKS operating environment. The user path runs from public DNS through the protected gateway and web tier to the PetClinic application and MySQL; the public landing page is served separately by Nginx. The repository also describes canary routing, autoscaling, monitoring/tracing, secrets, and database backup. Source excerpts were unavailable, so relationships below rely on explicit README descriptions; unsampled implementation details are represented only by supported directory paths.

Main entry points: [`k8s/was`](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/was) (EKS workloads), [`k8s/gateway`](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/gateway) (NGINX Gateway), [`app/src/main/java/org/springframework/samples/petclinic/web`](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/app/src/main/java/org/springframework/samples/petclinic/web) (Staff PetClinic), [`k8s/jobs`](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/jobs) (Database backup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_traffic["Traffic and web"]
  node_dns["Route 53"]
  node_alb["ALB and WAF"]
  node_gateway["NGINX Gateway"]
  node_web["Nginx web"]
end

subgraph group_clinic["PetClinic application"]
  node_staff["Staff PetClinic"]
  node_clinicservice["Clinic service"]
  node_clinicdata["Clinic repositories"]
end

subgraph group_platform["EKS platform"]
  node_eks["EKS workloads"]
  node_canary["Canary routing"]
  node_autoscale["Autoscaling"]
end

subgraph group_observability["Observability"]
  node_prometheus["Prometheus"]
  node_grafana["Grafana"]
  node_otel["OpenTelemetry"]
  node_tempo["Tempo traces"]
  node_logging["Log shipping"]
end

subgraph group_operations["Operations and data"]
  node_rds[("RDS MySQL")]
  node_secrets["Secret delivery"]
  node_backup["Database backup"]
  node_s3[("S3 backups")]
end

node_user(("User"))

node_user -->|"resolves"| node_dns
node_dns -->|"routes to"| node_alb
node_alb -->|"forwards traffic"| node_gateway
node_alb -->|"blocks with 403"| node_user
node_gateway -->|"routes by weight"| node_web
node_web -->|"proxies /was"| node_staff
node_staff -.->|"uses"| node_clinicservice
node_clinicservice -.->|"accesses data"| node_clinicdata
node_staff -->|"connects over TLS"| node_rds
node_gateway -->|"routes canary"| node_canary
node_autoscale -->|"scales workloads"| node_eks
node_prometheus -->|"feeds dashboards"| node_grafana
node_otel -->|"exports traces"| node_tempo
node_eks -->|"sends telemetry"| node_otel
node_eks -->|"ships logs"| node_logging
node_secrets -->|"supplies secrets"| node_eks
node_backup -->|"dumps database"| node_rds
node_backup -->|"writes backups"| node_s3

click node_gateway "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/gateway"
click node_web "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/docker/web"
click node_staff "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/app/src/main/java/org/springframework/samples/petclinic/web"
click node_clinicservice "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/app/src/main/java/org/springframework/samples/petclinic/service"
click node_clinicdata "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/app/src/main/java/org/springframework/samples/petclinic/repository"
click node_eks "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/was"
click node_canary "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/gateway"
click node_autoscale "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/was"
click node_prometheus "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/monitoring"
click node_grafana "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/monitoring"
click node_otel "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/tracing"
click node_tempo "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/tracing"
click node_logging "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/logging"
click node_secrets "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/secrets"
click node_backup "https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/jobs"

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_dns,node_alb,node_gateway,node_web,node_user toneBlue
class node_staff,node_clinicservice,node_clinicdata toneAmber
class node_eks,node_canary,node_autoscale toneMint
class node_prometheus,node_grafana,node_otel,node_tempo,node_logging toneRose
class node_rds,node_secrets,node_backup,node_s3 toneIndigo
```

## Components

### Traffic and web

- **Route 53**
- **ALB and WAF**
- [NGINX Gateway](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/gateway): `k8s/gateway`
- [Nginx web](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/docker/web): `docker/web`

### PetClinic application

- [Staff PetClinic](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/app/src/main/java/org/springframework/samples/petclinic/web): `app/src/main/java/org/springframework/samples/petclinic/web`
- [Clinic service](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/app/src/main/java/org/springframework/samples/petclinic/service): `app/src/main/java/org/springframework/samples/petclinic/service`
- [Clinic repositories](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/app/src/main/java/org/springframework/samples/petclinic/repository): `app/src/main/java/org/springframework/samples/petclinic/repository`

### EKS platform

- [EKS workloads](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/was): `k8s/was`
- [Canary routing](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/gateway): `k8s/gateway`
- [Autoscaling](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/was): `k8s/was`

### Observability

- [Prometheus](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/monitoring): `k8s/monitoring`
- [Grafana](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/monitoring): `k8s/monitoring`
- [OpenTelemetry](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/tracing): `k8s/tracing`
- [Tempo traces](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/tracing): `k8s/tracing`
- [Log shipping](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/logging): `k8s/logging`

### Operations and data

- **RDS MySQL**
- [Secret delivery](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/secrets): `k8s/secrets`
- [Database backup](https://github.com/qorgh529/eks-petclinic-3tier/tree/master/k8s/jobs): `k8s/jobs`
- **S3 backups**

### Other components

- **User**

## Connections

- User → Route 53: resolves (evidence: `README.md`)
- Route 53 → ALB and WAF: routes to (evidence: `README.md`)
- ALB and WAF → NGINX Gateway: forwards traffic (evidence: `README.md`)
- ALB and WAF → User: blocks with 403 (evidence: `README.md`)
- NGINX Gateway → Nginx web: routes by weight (evidence: `README.md`)
- Nginx web → Staff PetClinic: proxies /was (evidence: `README.md`)
- Staff PetClinic → Clinic service: uses
- Clinic service → Clinic repositories: accesses data
- Staff PetClinic → RDS MySQL: connects over TLS (evidence: `README.md`)
- NGINX Gateway → Canary routing: routes canary (evidence: `README.md`)
- Autoscaling → EKS workloads: scales workloads (evidence: `README.md`)
- Prometheus → Grafana: feeds dashboards (evidence: `README.md`)
- OpenTelemetry → Tempo traces: exports traces (evidence: `README.md`)
- EKS workloads → OpenTelemetry: sends telemetry (evidence: `README.md`)
- EKS workloads → Log shipping: ships logs (evidence: `README.md`)
- Secret delivery → EKS workloads: supplies secrets (evidence: `README.md`)
- Database backup → RDS MySQL: dumps database (evidence: `README.md`)
- Database backup → S3 backups: writes backups (evidence: `README.md`)
