# rahulan-mahendra/cicd-nodejs-k8s-demo architecture

> Architecture diagram of the GitHub repository rahulan-mahendra/cicd-nodejs-k8s-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rahulan-mahendra/cicd-nodejs-k8s-demo
- Repository: https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo

## Overview

This repository is a local-first DevOps demo whose user-facing runtime is a small Express service, while its broader product workflow demonstrates packaging, image publishing, and Kubernetes deployment. Requests enter through the server and app router, then reach health, metadata, or intentional-crash endpoints. Separately, the documented CI/CD path builds and publishes an image, then uses a self-hosted runner to prepare Kind and apply Kubernetes resources. Workflow and manifest relationships below rely on README descriptions; sampled source confirms only application routing and startup.

Main entry points: [`.github/workflows/cd.yml`](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/.github/workflows/cd.yml) (CD workflow), [`src/app.js`](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/app.js) (Express router), [`.github/workflows/ci.yml`](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/.github/workflows/ci.yml) (CI workflow), [`src/server.js`](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/server.js) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_server["HTTP server<br/>[server.js]"]
  node_router["Express router<br/>[app.js]"]
  node_health["Health endpoint<br/>[health.js]"]
  node_info["Info endpoint<br/>[info.js]"]
  node_crash["Crash endpoint<br/>[crash.js]"]
end

subgraph group_delivery["Image delivery"]
  node_ci["CI workflow<br/>[ci.yml]"]
  node_docker["Container image build"]
  node_registry[("GitHub Container Registry")]
end

subgraph group_orchestration["Kubernetes deployment"]
  node_cd["CD workflow<br/>[cd.yml]"]
  node_configmap["App configuration<br/>[configmap.yaml]"]
  node_deployment["Pod deployment<br/>[deployment.yaml]"]
  node_service["Kubernetes service<br/>[service.yaml]"]
  node_cluster["Kind cluster"]
end

subgraph group_runner["Runner setup"]
  node_bootstrap["Runner bootstrap"]
  node_runneractor(("Self-hosted runner"))
end

node_user(("HTTP client"))

node_user -.->|"sends requests"| node_server
node_server -->|"starts"| node_router
node_router -->|"mounts route"| node_health
node_router -->|"mounts route"| node_info
node_router -->|"mounts route"| node_crash
node_ci -.->|"builds image"| node_docker
node_docker -.->|"publishes image"| node_registry
node_ci -.->|"pushes image"| node_registry
node_runneractor -.->|"runs deployment"| node_cd
node_cd -.->|"prepares cluster"| node_bootstrap
node_bootstrap -.->|"ensures cluster"| node_cluster
node_cd -.->|"applies manifests"| node_configmap
node_cd -.->|"applies manifests"| node_deployment
node_cd -.->|"applies manifests"| node_service
node_deployment -.->|"deploys pods"| node_cluster
node_service -.->|"exposes app"| node_cluster

click node_server "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/server.js"
click node_router "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/app.js"
click node_health "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/routes/health.js"
click node_info "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/routes/info.js"
click node_crash "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/routes/crash.js"
click node_ci "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/.github/workflows/ci.yml"
click node_docker "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/Dockerfile"
click node_cd "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/.github/workflows/cd.yml"
click node_configmap "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/kubernetes/configmap.yaml"
click node_deployment "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/kubernetes/deployment.yaml"
click node_service "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/kubernetes/service.yaml"
click node_bootstrap "https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/scripts/bootstrap-runner.sh"

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_server,node_router,node_health,node_info,node_crash,node_user toneBlue
class node_ci,node_docker,node_registry toneAmber
class node_cd,node_configmap,node_deployment,node_service,node_cluster toneMint
class node_bootstrap,node_runneractor toneRose
```

## Components

### Application runtime

- [HTTP server](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/server.js): `src/server.js`
- [Express router](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/app.js): `src/app.js`
- [Health endpoint](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/routes/health.js): `src/routes/health.js`
- [Info endpoint](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/routes/info.js): `src/routes/info.js`
- [Crash endpoint](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/src/routes/crash.js): `src/routes/crash.js`

### Image delivery

- [CI workflow](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`
- [Container image build](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/Dockerfile): `Dockerfile`
- **GitHub Container Registry**

### Kubernetes deployment

- [CD workflow](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/.github/workflows/cd.yml): `.github/workflows/cd.yml`
- [App configuration](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/kubernetes/configmap.yaml): `kubernetes/configmap.yaml`
- [Pod deployment](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/kubernetes/deployment.yaml): `kubernetes/deployment.yaml`
- [Kubernetes service](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/kubernetes/service.yaml): `kubernetes/service.yaml`
- **Kind cluster**

### Runner setup

- [Runner bootstrap](https://github.com/rahulan-mahendra/cicd-nodejs-k8s-demo/blob/main/scripts/bootstrap-runner.sh): `scripts/bootstrap-runner.sh`
- **Self-hosted runner**

### Other components

- **HTTP client**

## Connections

- HTTP client → HTTP server: sends requests (evidence: `README.md`)
- HTTP server → Express router: starts (evidence: `src/server.js`)
- Express router → Health endpoint: mounts route (evidence: `src/app.js`)
- Express router → Info endpoint: mounts route (evidence: `src/app.js`)
- Express router → Crash endpoint: mounts route (evidence: `src/app.js`)
- CI workflow → Container image build: builds image (evidence: `README.md`)
- Container image build → GitHub Container Registry: publishes image (evidence: `README.md`)
- CI workflow → GitHub Container Registry: pushes image (evidence: `README.md`)
- Self-hosted runner → CD workflow: runs deployment (evidence: `README.md`)
- CD workflow → Runner bootstrap: prepares cluster (evidence: `README.md`)
- Runner bootstrap → Kind cluster: ensures cluster (evidence: `README.md`)
- CD workflow → App configuration: applies manifests (evidence: `README.md`)
- CD workflow → Pod deployment: applies manifests (evidence: `README.md`)
- CD workflow → Kubernetes service: applies manifests (evidence: `README.md`)
- Pod deployment → Kind cluster: deploys pods (evidence: `README.md`)
- Kubernetes service → Kind cluster: exposes app (evidence: `README.md`)
