# pahalsrivastava/cicd-pipelining architecture

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

- Interactive diagram: https://gitdiagram.com/pahalsrivastava/cicd-pipelining
- Repository: https://github.com/pahalsrivastava/cicd-pipelining

## Overview

##### Project type and purpose
- This is a DevOps “CI/CD Pipelining Demo” that builds, tests, packages, and deploys a multi-service application (frontend + backend) via Jenkins into a Kubernetes cluster.
- It uses Git for source, Docker for container builds, Jenkins as the orchestrator, a Docker registry for images, and Kubernetes manifests for deployment.

##### File structure
- Top level:
- Jenkinsfile – defines the pipeline stages (checkout, build, test, push, deploy).
- k8s/ – contains Kubernetes manifests for two microservices (backend-deployment.yaml, backend-service.yaml, frontend-deployment.yaml, frontend-service.yaml).
- Missing “app/” (per README) but implied: each service has its own Dockerfile and source under app/frontend and app/backend.
- No database or external stateful service is included – purely stateless microservices.

##### README for additional insights
- Pipeline stages: “Checkout → Build → (Unit) Test → Push → Deploy.”
- Manifests deploy two Deployments (cicd-demo-backend, cicd-demo-frontend) + two Services (ClusterIP or LoadBalancer).
- Assumes a Docker registry and a kubeconfig-configured cluster.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External
    Client["External Client"]:::external

    %% Source Control Layer
    subgraph "Source Control"
        SC[("Git Repository")]:::repo
        README["Project Overview\nand Pipeline Documentation"]:::repo
    end

    %% CI Pipeline Layer
    subgraph "CI Pipeline" 
        style CI fill:#E0F7FA,stroke:#006064
        SC -->|"git clone"| JenkinsMaster["Jenkins Master"]:::ci
        JenkinsMaster -->|"orchestrates"| JenkinsAgent["Jenkins Agent(s)"]:::ci
        JenkinsAgent -->|"docker build & test\n(frontend)"| FrontendBuild["Build & Test Frontend"]:::ci
        JenkinsAgent -->|"docker build & test\n(backend)"| BackendBuild["Build & Test Backend"]:::ci
        FrontendBuild -->|"docker push"| DockerRegistry["Docker Registry"]:::registry
        BackendBuild -->|"docker push"| DockerRegistry
        DockerRegistry -->|"kubectl apply\n(manifests)"| K8sAPIServer["Kubernetes API Server"]:::cluster
    end

    %% Kubernetes Cluster Layer
    subgraph "Kubernetes Cluster"
        style clusterLayer fill:#E8F5E9,stroke:#2E7D32
        K8sAPIServer
        subgraph "Frontend Service"
            FrontendDeployment["cicd-demo-frontend Deployment"]:::kube
            FrontendService["cicd-demo-frontend Service"]:::kube
        end
        subgraph "Backend Service"
            BackendDeployment["cicd-demo-backend Deployment"]:::kube
            BackendService["cicd-demo-backend Service"]:::kube
        end
        K8sAPIServer --> FrontendDeployment
        FrontendDeployment --> FrontendService
        K8sAPIServer --> BackendDeployment
        BackendDeployment --> BackendService
    end

    %% Runtime Flow
    Client -->|"HTTP request"| FrontendService
    FrontendService -->|"internal HTTP"| BackendService

    %% Click Events
    click JenkinsMaster "https://github.com/pahalsrivastava/cicd-pipelining/tree/main/Jenkinsfile"
    click BackendDeployment "https://github.com/pahalsrivastava/cicd-pipelining/blob/main/k8s/backend-deployment.yaml"
    click BackendService "https://github.com/pahalsrivastava/cicd-pipelining/blob/main/k8s/backend-service.yaml"
    click FrontendDeployment "https://github.com/pahalsrivastava/cicd-pipelining/blob/main/k8s/frontend-deployment.yaml"
    click FrontendService "https://github.com/pahalsrivastava/cicd-pipelining/blob/main/k8s/frontend-service.yaml"
    click README "https://github.com/pahalsrivastava/cicd-pipelining/blob/main/README.md"

    %% Styles
    classDef ci fill:#BBDEFB,stroke:#0D47A1
    classDef registry fill:#CFD8DC,stroke:#455A64
    classDef cluster fill:#C8E6C9,stroke:#1B5E20
    classDef kube fill:#A5D6A7,stroke:#2E7D32
    classDef external fill:#FFE0B2,stroke:#E65100
    classDef repo fill:#E1F5FE,stroke:#0277BD
```
