# vinitpatil519/hyperscale architecture

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

- Interactive diagram: https://gitdiagram.com/vinitpatil519/hyperscale
- Repository: https://github.com/vinitpatil519/hyperscale

## Overview

TitanEdge is a deployable, horizontally scalable API platform paired with a live dashboard and its own load-testing system. The principal workflow is browser or load-generator traffic through the edge to the Go API, which serves item operations and publishes events; a Kafka worker aggregates those events into PostgreSQL and Redis. The graph also preserves the documented frontend, scaling, service-mesh, and observability capabilities. Relationships use README statements or SOURCE INDEX references; unsampled deployment wiring is not inferred.

Main entry points: [`cmd/api/main.go`](https://github.com/vinitpatil519/hyperscale/blob/main/cmd/api/main.go) (API process), [`cmd/titanload/main.go`](https://github.com/vinitpatil519/hyperscale/blob/main/cmd/titanload/main.go) (TitanLoad CLI), [`internal/api/handlers.go`](https://github.com/vinitpatil519/hyperscale/blob/main/internal/api/handlers.go) (Item and event handlers), [`charts/platform/templates/nginx.yaml`](https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/nginx.yaml) (NGINX edge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge_api["Edge and API"]
  node_nginx["NGINX edge<br/>[nginx.yaml]"]
  node_envoy["Envoy edge<br/>[envoy.yaml]"]
  node_api_main["API process<br/>[main.go]"]
  node_api_server["HTTP API routes<br/>[server.go]"]
  node_api_handlers["Item and event handlers<br/>[handlers.go]"]
end

subgraph group_event_data["Events and data"]
  node_cache[("Redis cache<br/>[cache.go]")]
  node_store[("PostgreSQL store<br/>[store.go]")]
  node_kafka["Kafka event bus<br/>[datastores.yaml]"]
  node_worker_main["Worker process<br/>[main.go]"]
  node_worker["Event aggregation<br/>[worker.go]"]
end

subgraph group_web_ui["Dashboard"]
  node_web["Next.js dashboard<br/>[Dashboard.tsx]"]
  node_web_api["Dashboard API client<br/>[api.ts]"]
  node_sparkline["Sparkline view<br/>[Sparkline.tsx]"]
end

subgraph group_loadtest["TitanLoad"]
  node_titanload_cli["TitanLoad CLI<br/>[main.go]"]
  node_engine["Load engine<br/>[engine.go]"]
  node_distributed["Distributed coordinator<br/>[distributed.go]"]
  node_distributed_worker["Remote load worker<br/>[worker.go]"]
  node_load_dashboard["Live load dashboard<br/>[dashboard.go]"]
  node_stats["Load statistics<br/>[histogram.go]"]
  node_report["SLO reports<br/>[report.go]"]
end

subgraph group_platform_ops["Platform operations"]
  node_keda["KEDA autoscaling<br/>[worker.yaml]"]
  node_istio["Istio mesh<br/>[istio.yaml]"]
  node_observability["Metrics and tracing<br/>[observability.go]"]
  node_obs_stack["Monitoring stack"]
  node_logs_traces["Logs and traces"]
end

node_browser(("Browser"))
node_load_client(("Load client"))

node_browser -->|"sends traffic"| node_nginx
node_load_client -->|"sends load"| node_nginx
node_nginx -->|"routes API traffic"| node_envoy
node_nginx -->|"routes dashboard"| node_web
node_envoy -->|"forwards requests"| node_api_main
node_web -->|"requests data"| node_web_api
node_web -->|"renders charts"| node_sparkline
node_web_api -->|"calls API"| node_api_main
node_api_main -->|"wires routes"| node_api_server
node_api_main -->|"creates client"| node_cache
node_api_main -->|"creates client"| node_store
node_api_main -->|"sets up telemetry"| node_observability
node_api_server -->|"registers handlers"| node_api_handlers
node_api_handlers -->|"reads and writes"| node_cache
node_api_handlers -->|"reads and writes"| node_store
node_api_handlers -->|"publishes events"| node_kafka
node_kafka -->|"delivers events"| node_worker_main
node_worker_main -->|"runs consumer"| node_worker
node_worker -->|"persists rollups"| node_store
node_worker -->|"updates counters"| node_cache
node_titanload_cli -->|"runs load"| node_engine
node_titanload_cli -->|"starts coordinator"| node_distributed
node_titanload_cli -->|"starts worker"| node_distributed_worker
node_titanload_cli -->|"shows progress"| node_load_dashboard
node_titanload_cli -->|"builds report"| node_report
node_engine -->|"records results"| node_stats
node_distributed -->|"coordinates runs"| node_engine
node_distributed -->|"merges snapshots"| node_stats
node_distributed_worker -->|"executes job"| node_engine
node_load_dashboard -->|"renders metrics"| node_stats
node_report -->|"summarizes results"| node_stats
node_keda -->|"scales on lag"| node_worker_main
node_keda -->|"scales on RPS"| node_api_main
node_istio -->|"secures traffic"| node_api_main
node_observability -->|"exports traces"| node_logs_traces
node_obs_stack -->|"scrapes metrics"| node_observability

click node_nginx "https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/nginx.yaml"
click node_envoy "https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/envoy.yaml"
click node_web "https://github.com/vinitpatil519/hyperscale/blob/main/web/components/Dashboard.tsx"
click node_web_api "https://github.com/vinitpatil519/hyperscale/blob/main/web/lib/api.ts"
click node_sparkline "https://github.com/vinitpatil519/hyperscale/blob/main/web/components/Sparkline.tsx"
click node_api_main "https://github.com/vinitpatil519/hyperscale/blob/main/cmd/api/main.go"
click node_api_server "https://github.com/vinitpatil519/hyperscale/blob/main/internal/api/server.go"
click node_api_handlers "https://github.com/vinitpatil519/hyperscale/blob/main/internal/api/handlers.go"
click node_cache "https://github.com/vinitpatil519/hyperscale/blob/main/internal/cache/cache.go"
click node_store "https://github.com/vinitpatil519/hyperscale/blob/main/internal/store/store.go"
click node_kafka "https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/datastores.yaml"
click node_worker_main "https://github.com/vinitpatil519/hyperscale/blob/main/cmd/worker/main.go"
click node_worker "https://github.com/vinitpatil519/hyperscale/blob/main/internal/worker/worker.go"
click node_titanload_cli "https://github.com/vinitpatil519/hyperscale/blob/main/cmd/titanload/main.go"
click node_engine "https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/engine/engine.go"
click node_distributed "https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/distributed/distributed.go"
click node_distributed_worker "https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/distributed/worker.go"
click node_load_dashboard "https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/dashboard/dashboard.go"
click node_stats "https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/stats/histogram.go"
click node_report "https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/report/report.go"
click node_keda "https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/worker.yaml"
click node_istio "https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/istio.yaml"
click node_observability "https://github.com/vinitpatil519/hyperscale/blob/main/internal/observability/observability.go"
click node_obs_stack "https://github.com/vinitpatil519/hyperscale/blob/main/addons/values/kube-prometheus-stack.yaml"
click node_logs_traces "https://github.com/vinitpatil519/hyperscale/blob/main/addons/values/otel-collector.yaml"

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_nginx,node_envoy,node_api_main,node_api_server,node_api_handlers,node_browser,node_load_client toneBlue
class node_cache,node_store,node_kafka,node_worker_main,node_worker toneAmber
class node_web,node_web_api,node_sparkline toneMint
class node_titanload_cli,node_engine,node_distributed,node_distributed_worker,node_load_dashboard,node_stats,node_report toneRose
class node_keda,node_istio,node_observability,node_obs_stack,node_logs_traces toneIndigo
```

## Components

### Edge and API

- [NGINX edge](https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/nginx.yaml): `charts/platform/templates/nginx.yaml`
- [Envoy edge](https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/envoy.yaml): `charts/platform/templates/envoy.yaml`
- [API process](https://github.com/vinitpatil519/hyperscale/blob/main/cmd/api/main.go): `cmd/api/main.go`
- [HTTP API routes](https://github.com/vinitpatil519/hyperscale/blob/main/internal/api/server.go): `internal/api/server.go`
- [Item and event handlers](https://github.com/vinitpatil519/hyperscale/blob/main/internal/api/handlers.go): `internal/api/handlers.go`

### Events and data

- [Redis cache](https://github.com/vinitpatil519/hyperscale/blob/main/internal/cache/cache.go): `internal/cache/cache.go`
- [PostgreSQL store](https://github.com/vinitpatil519/hyperscale/blob/main/internal/store/store.go): `internal/store/store.go`
- [Kafka event bus](https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/datastores.yaml): `charts/platform/templates/datastores.yaml`
- [Worker process](https://github.com/vinitpatil519/hyperscale/blob/main/cmd/worker/main.go): `cmd/worker/main.go`
- [Event aggregation](https://github.com/vinitpatil519/hyperscale/blob/main/internal/worker/worker.go): `internal/worker/worker.go`

### Dashboard

- [Next.js dashboard](https://github.com/vinitpatil519/hyperscale/blob/main/web/components/Dashboard.tsx): `web/components/Dashboard.tsx`
- [Dashboard API client](https://github.com/vinitpatil519/hyperscale/blob/main/web/lib/api.ts): `web/lib/api.ts`
- [Sparkline view](https://github.com/vinitpatil519/hyperscale/blob/main/web/components/Sparkline.tsx): `web/components/Sparkline.tsx`

### TitanLoad

- [TitanLoad CLI](https://github.com/vinitpatil519/hyperscale/blob/main/cmd/titanload/main.go): `cmd/titanload/main.go`
- [Load engine](https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/engine/engine.go): `internal/titanload/engine/engine.go`
- [Distributed coordinator](https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/distributed/distributed.go): `internal/titanload/distributed/distributed.go`
- [Remote load worker](https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/distributed/worker.go): `internal/titanload/distributed/worker.go`
- [Live load dashboard](https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/dashboard/dashboard.go): `internal/titanload/dashboard/dashboard.go`
- [Load statistics](https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/stats/histogram.go): `internal/titanload/stats/histogram.go`
- [SLO reports](https://github.com/vinitpatil519/hyperscale/blob/main/internal/titanload/report/report.go): `internal/titanload/report/report.go`

### Platform operations

- [KEDA autoscaling](https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/worker.yaml): `charts/platform/templates/worker.yaml`
- [Istio mesh](https://github.com/vinitpatil519/hyperscale/blob/main/charts/platform/templates/istio.yaml): `charts/platform/templates/istio.yaml`
- [Metrics and tracing](https://github.com/vinitpatil519/hyperscale/blob/main/internal/observability/observability.go): `internal/observability/observability.go`
- [Monitoring stack](https://github.com/vinitpatil519/hyperscale/blob/main/addons/values/kube-prometheus-stack.yaml): `addons/values/kube-prometheus-stack.yaml`
- [Logs and traces](https://github.com/vinitpatil519/hyperscale/blob/main/addons/values/otel-collector.yaml): `addons/values/otel-collector.yaml`

### Other components

- **Browser**
- **Load client**

## Connections

- Browser → NGINX edge: sends traffic (evidence: `README.md`)
- Load client → NGINX edge: sends load (evidence: `README.md`)
- NGINX edge → Envoy edge: routes API traffic (evidence: `README.md`)
- NGINX edge → Next.js dashboard: routes dashboard (evidence: `README.md`)
- Envoy edge → API process: forwards requests (evidence: `README.md`)
- Next.js dashboard → Dashboard API client: requests data (evidence: `web/components/Dashboard.tsx`)
- Next.js dashboard → Sparkline view: renders charts (evidence: `web/components/Dashboard.tsx`)
- Dashboard API client → API process: calls API (evidence: `README.md`)
- API process → HTTP API routes: wires routes (evidence: `cmd/api/main.go`)
- API process → Redis cache: creates client (evidence: `cmd/api/main.go`)
- API process → PostgreSQL store: creates client (evidence: `cmd/api/main.go`)
- API process → Metrics and tracing: sets up telemetry (evidence: `cmd/api/main.go`)
- HTTP API routes → Item and event handlers: registers handlers (evidence: `internal/api/server.go`)
- Item and event handlers → Redis cache: reads and writes (evidence: `internal/api/handlers.go`)
- Item and event handlers → PostgreSQL store: reads and writes (evidence: `internal/api/handlers.go`)
- Item and event handlers → Kafka event bus: publishes events (evidence: `README.md`)
- Kafka event bus → Worker process: delivers events (evidence: `README.md`)
- Worker process → Event aggregation: runs consumer (evidence: `cmd/worker/main.go`)
- Event aggregation → PostgreSQL store: persists rollups (evidence: `internal/worker/worker.go`)
- Event aggregation → Redis cache: updates counters (evidence: `internal/worker/worker.go`)
- TitanLoad CLI → Load engine: runs load (evidence: `cmd/titanload/main.go`)
- TitanLoad CLI → Distributed coordinator: starts coordinator (evidence: `cmd/titanload/main.go`)
- TitanLoad CLI → Remote load worker: starts worker (evidence: `cmd/titanload/main.go`)
- TitanLoad CLI → Live load dashboard: shows progress (evidence: `cmd/titanload/main.go`)
- TitanLoad CLI → SLO reports: builds report (evidence: `cmd/titanload/main.go`)
- Load engine → Load statistics: records results (evidence: `internal/titanload/engine/engine.go`)
- Distributed coordinator → Load engine: coordinates runs (evidence: `internal/titanload/distributed/distributed.go`)
- Distributed coordinator → Load statistics: merges snapshots (evidence: `internal/titanload/distributed/distributed.go`)
- Remote load worker → Load engine: executes job (evidence: `internal/titanload/distributed/worker.go`)
- Live load dashboard → Load statistics: renders metrics (evidence: `internal/titanload/dashboard/dashboard.go`)
- SLO reports → Load statistics: summarizes results (evidence: `internal/titanload/report/report.go`)
- KEDA autoscaling → Worker process: scales on lag (evidence: `README.md`)
- KEDA autoscaling → API process: scales on RPS (evidence: `README.md`)
- Istio mesh → API process: secures traffic (evidence: `README.md`)
- Metrics and tracing → Logs and traces: exports traces (evidence: `internal/observability/observability.go`)
- Monitoring stack → Metrics and tracing: scrapes metrics (evidence: `README.md`)
