# myspotontheweb/argocd-springboot-demo2 architecture

> Architecture diagram of the GitHub repository myspotontheweb/argocd-springboot-demo2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/myspotontheweb/argocd-springboot-demo2
- Repository: https://github.com/myspotontheweb/argocd-springboot-demo2

## Overview

##### Project type and purpose
- This is a cloud-native Java microservice demo project built with Spring Boot. Its primary purpose is to demonstrate a complete GitOps-style CI/CD pipeline using Jenkins, Helm, and Kubernetes (k3d), including automated builds, container image management, and declarative deployments.

##### File structure
- Top-level artifacts
- pom.xml, mvnw/mvnw.cmd, .mvn/… → standard Maven project for compiling and packaging the Spring Boot app
- Dockerfile → builds the application container
- Jenkinsfile → defines the Jenkins pipeline for building, testing, and pushing the container
- chart/ → Helm chart for deploying the application to Kubernetes
- devspace.yaml, devspace_start.sh → configuration for DevSpace CLI for local or remote development
- Source code
- src/main/java/com/myspotontheweb/springboot/demo2 → Demo2Application.java (entry point) and HelloController.java (REST endpoint)
- src/main/resources/application.properties → Spring Boot configuration
- src/test/java/… → unit tests
- CI/CD & deployment configs
- Jenkinsfile in root
- chart/templates/*.yaml → Kubernetes Deployment, Service, HPA, Ingress, ServiceAccount, test-connection
- devspace.yaml / devspace_start.sh → developer workspace orchestration

##### README for additional insights
- Describes starting a local k3d Kubernetes cluster, installing Jenkins via its Helm chart, configuring service accounts and secrets for Docker registry and GitOps triggers.
- Shows how Jenkins is configured (via JCasC) to run a multibranchPipelineJob against this Git repo.

## Diagram (Mermaid)

```mermaid
flowchart TB
  subgraph "Developer Workstation"
    Dev["Developer"]:::external
    DevSpace["DevSpace CLI"]:::runtime
  end

  Dev -->|push code & config| GitRepo["Git Repository"]:::external
  Dev -->|live dev| DevSpace

  subgraph "Repository Contents"
    pom["pom.xml"]:::config
    mvnw["mvnw"]:::config
    mvnwcmd["mvnw.cmd"]:::config
    wrapperJar[".mvn/wrapper/maven-wrapper.jar"]:::config
    wrapperProps[".mvn/wrapper/maven-wrapper.properties"]:::config
    DemoApp["Demo2Application.java"]:::config
    HelloCtrl["HelloController.java"]:::config
    appProps["application.properties"]:::config
    tests["Demo2ApplicationTests.java"]:::config
    dockerfile["Dockerfile"]:::config
    jf["Jenkinsfile"]:::config
    subgraph "chart/"
      ChartYaml["Chart.yaml"]:::config
      valuesYaml["values.yaml"]:::config
      subgraph "templates/"
        depYaml["deployment.yaml"]:::config
        svcYaml["service.yaml"]:::config
        ingressYaml["ingress.yaml"]:::config
        hpaYaml["hpa.yaml"]:::config
        saYaml["serviceaccount.yaml"]:::config
        helpers["_helpers.tpl"]:::config
        notes["NOTES.txt"]:::config
        testConn["test-connection.yaml"]:::config
      end
    end
    devspaceYaml["devspace.yaml"]:::config
    devspaceSh["devspace_start.sh"]:::config
  end

  GitRepo -->|webhook| JenkinsMaster["Jenkins Master"]:::ci
  GitRepo -->|monitored by| ArgoCD["ArgoCD Controller"]:::runtime

  subgraph "CI Layer"
    JenkinsMaster
    AgentPod["Jenkins Agent Pod"]:::ci
  end

  JenkinsMaster -->|schedule pipeline| AgentPod
  AgentPod -->|run Maven & tests| pom
  AgentPod -->|build image| dockerfile
  AgentPod -->|push image| DockerRegistry["Docker Registry"]:::external

  DockerRegistry -->|store image| DockerRegistry

  JenkinsMaster -->|helm upgrade| K8sAPI["Kubernetes API"]:::runtime

  subgraph "Kubernetes Cluster"
    Traefik["Traefik Ingress"]:::runtime
    SpringPod["Spring Boot Service"]:::runtime
    JenkinsAgents["Agent Pods"]:::ci
    ArgoCD
  end

  K8sAPI -->|deploy| SpringPod
  K8sAPI -->|deploy| Traefik
  K8sAPI -->|deploy| JenkinsAgents
  GitRepo -->|GitOps Sync| ArgoCD
  ArgoCD -->|sync| K8sAPI

  ExternalUser["External User"]:::external
  ExternalUser -->|HTTP| Traefik
  DevSpace -->|connects to| SpringPod

  classDef external fill:#FFA500,stroke:#333,stroke-width:1px
  classDef ci fill:#87CEEB,stroke:#333,stroke-width:1px
  classDef runtime fill:#90EE90,stroke:#333,stroke-width:1px
  classDef config fill:#D3D3D3,stroke:#333,stroke-width:1px

  click DemoApp "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/src/main/java/com/myspotontheweb/springboot/demo2/Demo2Application.java"
  click HelloCtrl "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/src/main/java/com/myspotontheweb/springboot/demo2/HelloController.java"
  click pom "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/pom.xml"
  click mvnw "https://github.com/myspotontheweb/argocd-springboot-demo2/tree/main/mvnw"
  click mvnwcmd "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/mvnw.cmd"
  click wrapperJar "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/.mvn/wrapper/maven-wrapper.jar"
  click wrapperProps "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/.mvn/wrapper/maven-wrapper.properties"
  click appProps "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/src/main/resources/application.properties"
  click tests "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/src/test/java/com/myspotontheweb/springboot/demo2/Demo2ApplicationTests.java"
  click dockerfile "https://github.com/myspotontheweb/argocd-springboot-demo2/tree/main/Dockerfile"
  click jf "https://github.com/myspotontheweb/argocd-springboot-demo2/tree/main/Jenkinsfile"
  click ChartYaml "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/Chart.yaml"
  click valuesYaml "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/values.yaml"
  click depYaml "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/templates/deployment.yaml"
  click svcYaml "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/templates/service.yaml"
  click ingressYaml "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/templates/ingress.yaml"
  click hpaYaml "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/templates/hpa.yaml"
  click saYaml "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/templates/serviceaccount.yaml"
  click helpers "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/templates/_helpers.tpl"
  click notes "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/templates/NOTES.txt"
  click testConn "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/chart/templates/tests/test-connection.yaml"
  click devspaceYaml "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/devspace.yaml"
  click devspaceSh "https://github.com/myspotontheweb/argocd-springboot-demo2/blob/main/devspace_start.sh"
```
