# marouanemarhrani/secureflow architecture

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

- Interactive diagram: https://gitdiagram.com/marouanemarhrani/secureflow
- Repository: https://github.com/marouanemarhrani/secureflow

## Overview

SecureFlow is a DevSecOps platform whose main path runs pull-request changes through nine required security gates, then uses Argo CD to synchronize approved state into a zero-trust Kubernetes cluster. The cluster hosts a Spring Boot notes API backed by persistent PostgreSQL, with admission policies and Prometheus/Grafana observability. The API path is supported by source excerpts; platform relationships and capabilities are documented in the README, while unsampled configuration details are represented at their existing directory or manifest paths.

Main entry points: [`k8s/kind-cluster.yaml`](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/kind-cluster.yaml) (Kubernetes cluster), [`k8s/manifests/10-deployment.yaml`](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/manifests/10-deployment.yaml) (API deployment), [`k8s/monitoring/servicemonitor-notes-api.yaml`](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/monitoring/servicemonitor-notes-api.yaml) (Prometheus monitoring), [`.github/workflows/security-pipeline.yml`](https://github.com/marouanemarhrani/secureflow/blob/dev/.github/workflows/security-pipeline.yml) (Nine security gates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_delivery["Secure Delivery"]
  node_pipeline["Nine security gates"]
  node_argocd["Argo CD sync"]
end

subgraph group_workloads["Cluster Workloads"]
  node_cluster["Kubernetes cluster<br/>[kind-cluster.yaml]"]
  node_ingress["Ingress routing<br/>[30-ingress.yaml]"]
  node_api_deploy["API deployment<br/>[10-deployment.yaml]"]
  node_postgres[("PostgreSQL store")]
end

subgraph group_security["Cluster Security"]
  node_network["Network policies"]
  node_admission["Admission policies"]
  node_calico["Calico networking"]
end

subgraph group_observability["Observability"]
  node_prometheus["Prometheus monitoring"]
  node_dashboard["Grafana dashboard"]
  node_monitoring_config["Monitoring setup<br/>[values.yaml]"]
end

subgraph group_api["Notes API"]
  node_app["Spring Boot entry"]
  node_controller["Notes controller"]
  node_repository["Note repository"]
  node_note["Note entity<br/>[Note.java]"]
end

node_contributor(("Pull request"))
node_api_client(("API clients"))

node_contributor -->|"opens PR"| node_pipeline
node_pipeline -->|"gates approval"| node_argocd
node_argocd -->|"syncs state"| node_cluster
node_cluster -->|"runs workload"| node_api_deploy
node_ingress -->|"routes traffic"| node_api_deploy
node_api_client -->|"sends requests"| node_ingress
node_api_deploy -->|"runs application"| node_app
node_app -.->|"serves API"| node_controller
node_controller -->|"calls"| node_repository
node_repository -->|"persists entity"| node_note
node_api_deploy -->|"connects to"| node_postgres
node_cluster -->|"enforces rules"| node_network
node_cluster -->|"enforces policies"| node_admission
node_cluster -->|"uses networking"| node_calico
node_prometheus -->|"scrapes metrics"| node_api_deploy
node_monitoring_config -->|"configures stack"| node_prometheus
node_prometheus -->|"provides metrics"| node_dashboard

click node_pipeline "https://github.com/marouanemarhrani/secureflow/blob/dev/.github/workflows/security-pipeline.yml"
click node_argocd "https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/gitops/notes-api-application.yaml"
click node_cluster "https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/kind-cluster.yaml"
click node_ingress "https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/manifests/30-ingress.yaml"
click node_api_deploy "https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/manifests/10-deployment.yaml"
click node_postgres "https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/manifests/51-postgres-statefulset.yaml"
click node_app "https://github.com/marouanemarhrani/secureflow/blob/dev/notes-api/src/main/java/com/secureflow/notesapi/NotesApiApplication.java"
click node_controller "https://github.com/marouanemarhrani/secureflow/blob/dev/notes-api/src/main/java/com/secureflow/notesapi/NoteController.java"
click node_repository "https://github.com/marouanemarhrani/secureflow/blob/dev/notes-api/src/main/java/com/secureflow/notesapi/NoteRepository.java"
click node_note "https://github.com/marouanemarhrani/secureflow/blob/dev/notes-api/src/main/java/com/secureflow/notesapi/Note.java"
click node_network "https://github.com/marouanemarhrani/secureflow/tree/dev/k8s/manifests"
click node_admission "https://github.com/marouanemarhrani/secureflow/tree/dev/k8s/policies"
click node_calico "https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/calico-installation.yaml"
click node_prometheus "https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/monitoring/servicemonitor-notes-api.yaml"
click node_dashboard "https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/monitoring/dashboards/notes-api-observability.json"
click node_monitoring_config "https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/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_pipeline,node_argocd,node_api_client toneBlue
class node_cluster,node_ingress,node_api_deploy,node_postgres toneAmber
class node_network,node_admission,node_calico,node_contributor toneMint
class node_prometheus,node_dashboard,node_monitoring_config toneRose
class node_app,node_controller,node_repository,node_note toneIndigo
```

## Components

### Secure Delivery

- [Nine security gates](https://github.com/marouanemarhrani/secureflow/blob/dev/.github/workflows/security-pipeline.yml): `.github/workflows/security-pipeline.yml`
- [Argo CD sync](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/gitops/notes-api-application.yaml): `k8s/gitops/notes-api-application.yaml`

### Cluster Workloads

- [Kubernetes cluster](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/kind-cluster.yaml): `k8s/kind-cluster.yaml`
- [Ingress routing](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/manifests/30-ingress.yaml): `k8s/manifests/30-ingress.yaml`
- [API deployment](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/manifests/10-deployment.yaml): `k8s/manifests/10-deployment.yaml`
- [PostgreSQL store](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/manifests/51-postgres-statefulset.yaml): `k8s/manifests/51-postgres-statefulset.yaml`

### Cluster Security

- [Network policies](https://github.com/marouanemarhrani/secureflow/tree/dev/k8s/manifests): `k8s/manifests`
- [Admission policies](https://github.com/marouanemarhrani/secureflow/tree/dev/k8s/policies): `k8s/policies`
- [Calico networking](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/calico-installation.yaml): `k8s/calico-installation.yaml`

### Observability

- [Prometheus monitoring](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/monitoring/servicemonitor-notes-api.yaml): `k8s/monitoring/servicemonitor-notes-api.yaml`
- [Grafana dashboard](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/monitoring/dashboards/notes-api-observability.json): `k8s/monitoring/dashboards/notes-api-observability.json`
- [Monitoring setup](https://github.com/marouanemarhrani/secureflow/blob/dev/k8s/monitoring/values.yaml): `k8s/monitoring/values.yaml`

### Notes API

- [Spring Boot entry](https://github.com/marouanemarhrani/secureflow/blob/dev/notes-api/src/main/java/com/secureflow/notesapi/NotesApiApplication.java): `notes-api/src/main/java/com/secureflow/notesapi/NotesApiApplication.java`
- [Notes controller](https://github.com/marouanemarhrani/secureflow/blob/dev/notes-api/src/main/java/com/secureflow/notesapi/NoteController.java): `notes-api/src/main/java/com/secureflow/notesapi/NoteController.java`
- [Note repository](https://github.com/marouanemarhrani/secureflow/blob/dev/notes-api/src/main/java/com/secureflow/notesapi/NoteRepository.java): `notes-api/src/main/java/com/secureflow/notesapi/NoteRepository.java`
- [Note entity](https://github.com/marouanemarhrani/secureflow/blob/dev/notes-api/src/main/java/com/secureflow/notesapi/Note.java): `notes-api/src/main/java/com/secureflow/notesapi/Note.java`

### Other components

- **Pull request**
- **API clients**

## Connections

- Pull request → Nine security gates: opens PR (evidence: `README.md`)
- Nine security gates → Argo CD sync: gates approval (evidence: `README.md`)
- Argo CD sync → Kubernetes cluster: syncs state (evidence: `README.md`)
- Kubernetes cluster → API deployment: runs workload (evidence: `README.md`)
- Ingress routing → API deployment: routes traffic (evidence: `README.md`)
- API clients → Ingress routing: sends requests (evidence: `README.md`)
- API deployment → Spring Boot entry: runs application (evidence: `README.md`)
- Spring Boot entry → Notes controller: serves API
- Notes controller → Note repository: calls (evidence: `notes-api/src/main/java/com/secureflow/notesapi/NoteController.java`)
- Note repository → Note entity: persists entity (evidence: `notes-api/src/main/java/com/secureflow/notesapi/NoteRepository.java`)
- API deployment → PostgreSQL store: connects to (evidence: `README.md`)
- Kubernetes cluster → Network policies: enforces rules (evidence: `README.md`)
- Kubernetes cluster → Admission policies: enforces policies (evidence: `README.md`)
- Kubernetes cluster → Calico networking: uses networking (evidence: `README.md`)
- Prometheus monitoring → API deployment: scrapes metrics (evidence: `README.md`)
- Monitoring setup → Prometheus monitoring: configures stack (evidence: `README.md`)
- Prometheus monitoring → Grafana dashboard: provides metrics (evidence: `README.md`)
