# snkshukla/masterclass-sample architecture

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

- Interactive diagram: https://gitdiagram.com/snkshukla/masterclass-sample
- Repository: https://github.com/snkshukla/masterclass-sample

## Overview

This sample demonstrates a small item-list web application and ways to run it. A browser reaches the Express app, which reads items from PostgreSQL and renders the results; form submissions insert an item and redirect to the list. Docker Compose and Kubernetes manifests represent separate deployment approaches. The application flow is visible in app.js; deployment links are limited to relationships described by the README because those configuration files were not sampled. The README mentions Helm, but no Helm files are present in the tree.

Main entry points: [`app.js`](https://github.com/snkshukla/masterclass-sample/blob/main/app.js) (Express app), [`compose.yaml`](https://github.com/snkshukla/masterclass-sample/blob/main/compose.yaml) (Compose environment), [`k8s/basic`](https://github.com/snkshukla/masterclass-sample/tree/main/k8s/basic) (Basic manifests), [`Dockerfile`](https://github.com/snkshukla/masterclass-sample/blob/main/Dockerfile) (Image definition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web application"]
  node_app["Express app<br/>[app.js]"]
  node_view["Items view<br/>[index.ejs]"]
end

subgraph group_storage["Persistence"]
  node_postgres[("PostgreSQL")]
end

subgraph group_containers["Container setup"]
  node_dockerfile["Image definition"]
  node_compose["Compose environment<br/>[compose.yaml]"]
end

subgraph group_kubernetes["Kubernetes setup"]
  node_k8s_basic["Basic manifests"]
  node_k8s_deployments["Deployment manifests"]
end

node_browser(("Browser"))

node_browser -->|"requests pages"| node_app
node_app -->|"queries items"| node_postgres
node_app -->|"creates table"| node_postgres
node_app -->|"inserts items"| node_postgres
node_app -->|"renders"| node_view
node_dockerfile -.->|"packages"| node_app
node_compose -.->|"runs with database"| node_app
node_compose -.->|"configures database"| node_postgres
node_k8s_basic -.->|"deploys application"| node_app
node_k8s_basic -.->|"includes database resources"| node_postgres
node_k8s_deployments -.->|"offers advanced deployment"| node_app

click node_app "https://github.com/snkshukla/masterclass-sample/blob/main/app.js"
click node_view "https://github.com/snkshukla/masterclass-sample/blob/main/views/index.ejs"
click node_dockerfile "https://github.com/snkshukla/masterclass-sample/blob/main/Dockerfile"
click node_compose "https://github.com/snkshukla/masterclass-sample/blob/main/compose.yaml"
click node_k8s_basic "https://github.com/snkshukla/masterclass-sample/tree/main/k8s/basic"
click node_k8s_deployments "https://github.com/snkshukla/masterclass-sample/tree/main/k8s/deployments"

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_app,node_view,node_browser toneBlue
class node_postgres toneAmber
class node_dockerfile,node_compose toneMint
class node_k8s_basic,node_k8s_deployments toneRose
```

## Components

### Web application

- [Express app](https://github.com/snkshukla/masterclass-sample/blob/main/app.js): `app.js`
- [Items view](https://github.com/snkshukla/masterclass-sample/blob/main/views/index.ejs): `views/index.ejs`

### Persistence

- **PostgreSQL**

### Container setup

- [Image definition](https://github.com/snkshukla/masterclass-sample/blob/main/Dockerfile): `Dockerfile`
- [Compose environment](https://github.com/snkshukla/masterclass-sample/blob/main/compose.yaml): `compose.yaml`

### Kubernetes setup

- [Basic manifests](https://github.com/snkshukla/masterclass-sample/tree/main/k8s/basic): `k8s/basic`
- [Deployment manifests](https://github.com/snkshukla/masterclass-sample/tree/main/k8s/deployments): `k8s/deployments`

### Other components

- **Browser**

## Connections

- Browser → Express app: requests pages (evidence: `README.md`)
- Express app → PostgreSQL: queries items (evidence: `app.js`)
- Express app → PostgreSQL: creates table (evidence: `app.js`)
- Express app → PostgreSQL: inserts items (evidence: `app.js`)
- Express app → Items view: renders (evidence: `app.js`)
- Image definition → Express app: packages (evidence: `README.md`)
- Compose environment → Express app: runs with database (evidence: `README.md`)
- Compose environment → PostgreSQL: configures database (evidence: `README.md`)
- Basic manifests → Express app: deploys application (evidence: `README.md`)
- Basic manifests → PostgreSQL: includes database resources (evidence: `README.md`)
- Deployment manifests → Express app: offers advanced deployment (evidence: `README.md`)
