# londheshubham153/k8s-kind-voting-app architecture

> Architecture diagram of the GitHub repository londheshubham153/k8s-kind-voting-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/londheshubham153/k8s-kind-voting-app
- Repository: https://github.com/londheshubham153/k8s-kind-voting-app

## Overview

This repository combines a two-option voting application with a guide to deploying it on a Kind Kubernetes cluster. The main runtime flow accepts votes, queues them in Redis, persists them through a .NET worker, and broadcasts PostgreSQL aggregates to the live results page. The README also describes AWS EC2, Kind, and Argo CD setup; those deployment capabilities are represented separately from application runtime. Deployment wiring is based on README claims because deployment manifests were not excerpted.

Main entry points: [`result/server.js`](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/result/server.js) (Results Server), [`vote/app.py`](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/vote/app.py) (Voting Web App), [`kind-cluster/commands.md`](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/kind-cluster/commands.md) (Kind Cluster), [`worker/Program.cs`](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/worker/Program.cs) (Vote Worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_voting["Vote Capture"]
  node_vote_app["Voting Web App<br/>[app.py]"]
  node_vote_page["Voting Page<br/>[index.html]"]
end

subgraph group_processing["Vote Processing"]
  node_redis["Redis Queue"]
  node_worker["Vote Worker<br/>[Program.cs]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_results["Live Results"]
  node_result_server["Results Server<br/>[server.js]"]
  node_socket_client["Socket.IO Client<br/>[socket.io.js]"]
  node_results_ui["Results UI<br/>[app.js]"]
end

subgraph group_deployment["Cluster Deployment"]
  node_kind["Kind Cluster<br/>[commands.md]"]
  node_manifests["Kubernetes Specs"]
end

node_voter(("Voter"))
node_aws["AWS EC2"]
node_argocd["Argo CD"]

node_voter -->|"submits vote"| node_vote_app
node_vote_app -->|"renders"| node_vote_page
node_vote_app -->|"queues vote"| node_redis
node_worker -->|"pops votes"| node_redis
node_worker -->|"stores votes"| node_postgres
node_result_server -->|"queries totals"| node_postgres
node_result_server -->|"serves client"| node_socket_client
node_result_server -->|"broadcasts scores"| node_results_ui
node_results_ui -->|"receives events"| node_socket_client
node_aws -->|"hosts cluster"| node_kind
node_kind -.->|"deploys applications"| node_manifests
node_argocd -->|"manages cluster"| node_kind

click node_vote_app "https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/vote/app.py"
click node_vote_page "https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/vote/templates/index.html"
click node_worker "https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/worker/Program.cs"
click node_result_server "https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/result/server.js"
click node_socket_client "https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/result/views/socket.io.js"
click node_results_ui "https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/result/views/app.js"
click node_kind "https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/kind-cluster/commands.md"
click node_manifests "https://github.com/londheshubham153/k8s-kind-voting-app/tree/main/k8s-specifications"

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_vote_app,node_vote_page toneBlue
class node_redis,node_worker,node_postgres toneAmber
class node_result_server,node_socket_client,node_results_ui toneMint
class node_kind,node_manifests toneRose
class node_voter,node_aws,node_argocd toneIndigo
```

## Components

### Vote Capture

- [Voting Web App](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/vote/app.py): `vote/app.py`
- [Voting Page](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/vote/templates/index.html): `vote/templates/index.html`

### Vote Processing

- **Redis Queue**
- [Vote Worker](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/worker/Program.cs): `worker/Program.cs`
- **PostgreSQL**

### Live Results

- [Results Server](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/result/server.js): `result/server.js`
- [Socket.IO Client](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/result/views/socket.io.js): `result/views/socket.io.js`
- [Results UI](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/result/views/app.js): `result/views/app.js`

### Cluster Deployment

- [Kind Cluster](https://github.com/londheshubham153/k8s-kind-voting-app/blob/main/kind-cluster/commands.md): `kind-cluster/commands.md`
- [Kubernetes Specs](https://github.com/londheshubham153/k8s-kind-voting-app/tree/main/k8s-specifications): `k8s-specifications`

### Other components

- **Voter**
- **AWS EC2**
- **Argo CD**

## Connections

- Voter → Voting Web App: submits vote (evidence: `README.md`)
- Voting Web App → Voting Page: renders (evidence: `vote/app.py`)
- Voting Web App → Redis Queue: queues vote (evidence: `vote/app.py`)
- Vote Worker → Redis Queue: pops votes (evidence: `worker/Program.cs`)
- Vote Worker → PostgreSQL: stores votes (evidence: `worker/Program.cs`)
- Results Server → PostgreSQL: queries totals (evidence: `result/server.js`)
- Results Server → Socket.IO Client: serves client (evidence: `result/server.js`)
- Results Server → Results UI: broadcasts scores (evidence: `result/server.js`)
- Results UI → Socket.IO Client: receives events (evidence: `result/views/app.js`)
- AWS EC2 → Kind Cluster: hosts cluster (evidence: `README.md`)
- Kind Cluster → Kubernetes Specs: deploys applications
- Argo CD → Kind Cluster: manages cluster (evidence: `README.md`)
