# bhangun/iket architecture

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

- Interactive diagram: https://gitdiagram.com/bhangun/iket
- Repository: https://github.com/bhangun/iket

## Overview

Iket is a Go API gateway with a CLI for setup and operation, remote management, configurable routing, authentication plugins, and rollout controls. The main runtime path starts with server configuration and gateway initialization; configured requests enter route middleware, then proxy to an upstream service. Management APIs support client and service administration, including proposals and canary rollouts. The graph preserves documented extension, storage, and observability capabilities. Some subsystems are represented at directory level because their implementation files were not sampled; those links are omitted where evidence does not establish ownership.

Main entry points: [`cmd/iket/main.go`](https://github.com/bhangun/iket/blob/main/cmd/iket/main.go) (Server startup), [`pkg/api/management.go`](https://github.com/bhangun/iket/blob/main/pkg/api/management.go) (Management API), [`pkg/core/gateway/gateway_routes.go`](https://github.com/bhangun/iket/blob/main/pkg/core/gateway/gateway_routes.go) (Route registration), [`pkg/core/gateway/gateway.go`](https://github.com/bhangun/iket/blob/main/pkg/core/gateway/gateway.go) (Gateway runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Operations"]
  node_cli["Iket CLI<br/>[main.go]"]
  node_server["Server startup<br/>[main.go]"]
end

subgraph group_management["Management"]
  node_management["Management API<br/>[management.go]"]
  node_service_admin["Service administration"]
  node_client_admin["Client administration"]
  node_proposals["Change proposals"]
  node_canary["Canary rollouts"]
end

subgraph group_routing["Gateway routing"]
  node_gateway["Gateway runtime<br/>[gateway.go]"]
  node_routes["Route registration<br/>[gateway_routes.go]"]
  node_proxy["Request proxy<br/>[proxy_handler.go]"]
  node_bff["BFF orchestration<br/>[bff_handler.go]"]
end

subgraph group_security["Identity plugins"]
  node_auth{{"Authentication plugins<br/>[oauth2.go]"}}
  node_apikey{{"API key plugin<br/>[apikey.go]"}}
end

subgraph group_platform["Configuration and extensions"]
  node_config["Configuration<br/>[config.go]"]
  node_storage[("Config storage<br/>[storage_config.go]")]
  node_plugin_registry["Plugin registry<br/>[registry.go]"]
  node_extensions{{"Gateway extensions"}}
  node_metrics["Metrics<br/>[prometheus.go]"]
end

node_operator(("Operator"))
node_upstream["Upstream services"]

node_operator -->|"runs"| node_cli
node_operator -->|"starts"| node_server
node_server -->|"loads"| node_config
node_server -->|"configures"| node_storage
node_server -->|"registers"| node_management
node_server -->|"initializes"| node_gateway
node_gateway -->|"registers"| node_routes
node_routes -->|"dispatches"| node_proxy
node_proxy -->|"proxies requests"| node_upstream
node_routes -->|"wraps with middleware"| node_auth
node_management -.->|"routes service changes"| node_service_admin
node_management -.->|"routes client operations"| node_client_admin
node_service_admin -->|"can propose changes"| node_proposals
node_proposals -.->|"supports rollout"| node_canary
node_client_admin -->|"manages clients through"| node_apikey
node_plugin_registry -.->|"registers extensions"| node_extensions
node_server -->|"registers plugins"| node_plugin_registry
node_server -.->|"enables observability"| node_metrics
node_config -.->|"configures"| node_gateway
node_bff -.->|"composes requests"| node_upstream

click node_cli "https://github.com/bhangun/iket/blob/main/cmd/iket-cli/main.go"
click node_server "https://github.com/bhangun/iket/blob/main/cmd/iket/main.go"
click node_config "https://github.com/bhangun/iket/blob/main/pkg/config/config.go"
click node_storage "https://github.com/bhangun/iket/blob/main/pkg/config/storage_config.go"
click node_gateway "https://github.com/bhangun/iket/blob/main/pkg/core/gateway/gateway.go"
click node_routes "https://github.com/bhangun/iket/blob/main/pkg/core/gateway/gateway_routes.go"
click node_proxy "https://github.com/bhangun/iket/blob/main/pkg/core/gateway/proxy_handler.go"
click node_bff "https://github.com/bhangun/iket/blob/main/pkg/core/gateway/bff_handler.go"
click node_management "https://github.com/bhangun/iket/blob/main/pkg/api/management.go"
click node_service_admin "https://github.com/bhangun/iket/blob/main/pkg/api/management_services.go"
click node_client_admin "https://github.com/bhangun/iket/blob/main/pkg/api/management_clients.go"
click node_proposals "https://github.com/bhangun/iket/blob/main/pkg/api/management_proposals.go"
click node_canary "https://github.com/bhangun/iket/blob/main/pkg/api/management_proposal_canary_handlers.go"
click node_auth "https://github.com/bhangun/iket/blob/main/pkg/plugin/oauth2/oauth2.go"
click node_apikey "https://github.com/bhangun/iket/blob/main/pkg/plugin/apikey/apikey.go"
click node_plugin_registry "https://github.com/bhangun/iket/blob/main/pkg/plugin/registry.go"
click node_extensions "https://github.com/bhangun/iket/tree/main/plugins"
click node_metrics "https://github.com/bhangun/iket/blob/main/plugins/metrics/prometheus.go"

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_cli,node_server toneBlue
class node_management,node_service_admin,node_client_admin,node_proposals,node_canary toneAmber
class node_gateway,node_routes,node_proxy,node_bff toneMint
class node_auth,node_apikey toneRose
class node_config,node_storage,node_plugin_registry,node_extensions,node_metrics,node_operator,node_upstream toneIndigo
```

## Components

### Operations

- [Iket CLI](https://github.com/bhangun/iket/blob/main/cmd/iket-cli/main.go): `cmd/iket-cli/main.go`
- [Server startup](https://github.com/bhangun/iket/blob/main/cmd/iket/main.go): `cmd/iket/main.go`

### Management

- [Management API](https://github.com/bhangun/iket/blob/main/pkg/api/management.go): `pkg/api/management.go`
- [Service administration](https://github.com/bhangun/iket/blob/main/pkg/api/management_services.go): `pkg/api/management_services.go`
- [Client administration](https://github.com/bhangun/iket/blob/main/pkg/api/management_clients.go): `pkg/api/management_clients.go`
- [Change proposals](https://github.com/bhangun/iket/blob/main/pkg/api/management_proposals.go): `pkg/api/management_proposals.go`
- [Canary rollouts](https://github.com/bhangun/iket/blob/main/pkg/api/management_proposal_canary_handlers.go): `pkg/api/management_proposal_canary_handlers.go`

### Gateway routing

- [Gateway runtime](https://github.com/bhangun/iket/blob/main/pkg/core/gateway/gateway.go): `pkg/core/gateway/gateway.go`
- [Route registration](https://github.com/bhangun/iket/blob/main/pkg/core/gateway/gateway_routes.go): `pkg/core/gateway/gateway_routes.go`
- [Request proxy](https://github.com/bhangun/iket/blob/main/pkg/core/gateway/proxy_handler.go): `pkg/core/gateway/proxy_handler.go`
- [BFF orchestration](https://github.com/bhangun/iket/blob/main/pkg/core/gateway/bff_handler.go): `pkg/core/gateway/bff_handler.go`

### Identity plugins

- [Authentication plugins](https://github.com/bhangun/iket/blob/main/pkg/plugin/oauth2/oauth2.go): `pkg/plugin/oauth2/oauth2.go`
- [API key plugin](https://github.com/bhangun/iket/blob/main/pkg/plugin/apikey/apikey.go): `pkg/plugin/apikey/apikey.go`

### Configuration and extensions

- [Configuration](https://github.com/bhangun/iket/blob/main/pkg/config/config.go): `pkg/config/config.go`
- [Config storage](https://github.com/bhangun/iket/blob/main/pkg/config/storage_config.go): `pkg/config/storage_config.go`
- [Plugin registry](https://github.com/bhangun/iket/blob/main/pkg/plugin/registry.go): `pkg/plugin/registry.go`
- [Gateway extensions](https://github.com/bhangun/iket/tree/main/plugins): `plugins`
- [Metrics](https://github.com/bhangun/iket/blob/main/plugins/metrics/prometheus.go): `plugins/metrics/prometheus.go`

### Other components

- **Operator**
- **Upstream services**

## Connections

- Operator → Iket CLI: runs (evidence: `README.md`)
- Operator → Server startup: starts (evidence: `README.md`)
- Server startup → Configuration: loads (evidence: `cmd/iket/main.go`)
- Server startup → Config storage: configures (evidence: `cmd/iket/main.go`)
- Server startup → Management API: registers (evidence: `cmd/iket/main.go`)
- Server startup → Gateway runtime: initializes (evidence: `cmd/iket/main.go`)
- Gateway runtime → Route registration: registers (evidence: `pkg/core/gateway/gateway_routes.go`)
- Route registration → Request proxy: dispatches (evidence: `pkg/core/gateway/gateway_routes.go`)
- Request proxy → Upstream services: proxies requests (evidence: `pkg/core/gateway/proxy_handler.go`)
- Route registration → Authentication plugins: wraps with middleware (evidence: `pkg/core/gateway/gateway_routes.go`)
- Management API → Service administration: routes service changes
- Management API → Client administration: routes client operations
- Service administration → Change proposals: can propose changes (evidence: `pkg/api/management_services.go`)
- Change proposals → Canary rollouts: supports rollout
- Client administration → API key plugin: manages clients through (evidence: `pkg/api/management_clients.go`)
- Plugin registry → Gateway extensions: registers extensions
- Server startup → Plugin registry: registers plugins (evidence: `cmd/iket/main.go`)
- Server startup → Metrics: enables observability
- Configuration → Gateway runtime: configures
- BFF orchestration → Upstream services: composes requests
