# paradyme-management/appetizer-jcasc architecture

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

- Interactive diagram: https://gitdiagram.com/paradyme-management/appetizer-jcasc
- Repository: https://github.com/paradyme-management/appetizer-jcasc

## Overview

##### Project type and purpose
- This is a “code-as-configuration” project (Jenkins Configuration as Code, a.k.a. JCasC) whose sole purpose is to configure and bootstrap a Jenkins installation, define folders and jobs, and then hand off to ArgoCD for deployment.
- The README calls out that you need GitHub and Artifactory credentials, that you run a shell script (appetizer.sh) to apply credentials and this JCasC code, and finally configure ArgoCD to deploy your application.

##### File structure
Top-level files:
- README.md         – project description & usage
- folder.groovy     – Groovy DSL defining Jenkins folder structure
- jobs.groovy       – Groovy DSL defining Jenkins jobs/pipelines
- jenkins.yaml      – the JCasC YAML for global Jenkins configuration
- folder.groovy & jobs.groovy work together under the JCasC plugin
No “src/” or “lib/” directories—this repo is purely configuration, not application code.

##### README for additional insights
- It mentions an external “appetizer-deploy” project that manages credentials.
- The high-level flow is:
1. Apply GitHub/Artifactory creds
2. Apply this JCasC config to Jenkins
3. Once Jenkins builds complete, configure ArgoCD for deployment

a. Main components to include:
- The appetizer-jcasc repo (source code/config)
- Jenkins Controller (master) with JCasC plugin
- Jenkins Folder & Job DSL (folder.groovy, jobs.groovy)
- Shell bootstrap script (appetizer.sh)
- External credential store (GitHub, Artifactory)
- Artifact registry (Artifactory)
- GitOps system (ArgoCD)
- Kubernetes cluster (local cluster)

b. Relationships & interactions:
1. The bootstrap script reads credentials from Github/Artifactory vault, then
└─▶ pushes jenkins.yaml, folder.groovy, jobs.groovy into the JCasC API on the Jenkins Controller
2. Jenkins Controller (via JCasC plugin) applies global config + folder/job definitions
3. Jenkins Controller schedules and runs pipelines defined in jobs.groovy
4. Pipeline steps build artifacts and push to Artifactory (using stored credentials)
5. After successful build, the script or Jenkins job updates an ArgoCD Application manifest
6. ArgoCD reconciles the new manifests against the Kubernetes cluster

c. Architectural patterns & design principles
- Declarative configuration (YAML + Groovy DSL)
- Immutable, code-driven CI configuration (no manual UI clicks)
- GitOps for deployment (ArgoCD watching Git)
- Separation of concerns:
– JCasC sets up Jenkins
– Folder/Job DSL defines pipeline logic
– ArgoCD handles deployment

d. Key technologies/frameworks/libraries
- Jenkins Configuration as Code plugin (jenkins.yaml)
- Jenkins Job DSL (folder.groovy, jobs.groovy)
- Shell scripting (appetizer.sh)
- GitHub or Vault for credentials storage
- Artifactory for artifacts
- ArgoCD for Kubernetes GitOps

##### Diagramming recommendations
- Use clear, consistent labels (e.g., “Jenkins Controller (JCasC)”, “Artifactory”)
- Repo → Jenkins API
- Jenkins → Artifactory
- Repo/Jenkins → ArgoCD → Kubernetes
- Blue for configuration code
- Green for CI components
- Orange for CD components

##### Detail
- Bootstrap script as a distinct component.
- Credentials as a separate service or vault.
- Portray ArgoCD’s reconciliation loop to the Kubernetes cluster.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration Source Layer
    subgraph "Configuration Source"
        direction TB
        Repo["appetizer-jcasc Git Repo"]:::blue
        README["README.md"]:::blue
        Script["appetizer.sh (Bootstrap Script)"]:::blue
        JCasC["jenkins.yaml"]:::blue
        DSL1["folder.groovy"]:::blue
        DSL2["jobs.groovy"]:::blue
    end

    %% CI System Layer
    subgraph "CI System"
        direction TB
        Vault["Credential Store (GitHub/Artifactory Vault)"]:::green
        Jenkins["Jenkins Controller (JCasC Plugin)"]:::green
        Artifactory["Artifactory (Artifact Registry)"]:::green
    end

    %% CD System Layer
    subgraph "CD System"
        direction TB
        ArgoCD["ArgoCD (GitOps System)"]:::orange
        Cluster["Kubernetes Cluster"]:::orange
    end

    %% Connections
    Repo --> README
    Repo --> Script
    Repo --> JCasC
    Repo --> DSL1
    Repo --> DSL2

    Vault --> Script
    Script -->|"POST configs"| Jenkins

    JCasC --> Jenkins
    DSL1 --> Jenkins
    DSL2 --> Jenkins

    Jenkins -->|"build artifacts"| Artifactory
    Jenkins -->|"update manifests"| ArgoCD

    ArgoCD -->|"reconcile"| Cluster

    %% Click Events
    click README "https://github.com/paradyme-management/appetizer-jcasc/blob/main/README.md"
    click JCasC "https://github.com/paradyme-management/appetizer-jcasc/blob/main/jenkins.yaml"
    click DSL1 "https://github.com/paradyme-management/appetizer-jcasc/blob/main/folder.groovy"
    click DSL2 "https://github.com/paradyme-management/appetizer-jcasc/blob/main/jobs.groovy"

    %% Styles
    classDef blue fill:#D6E9F8,stroke:#1E90FF,color:#000
    classDef green fill:#DFF0D8,stroke:#3C763D,color:#000
    classDef orange fill:#FDEBD0,stroke:#D35400,color:#000
```
