# gustavfredrikson/cka-dojo architecture

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

- Interactive diagram: https://gitdiagram.com/gustavfredrikson/cka-dojo
- Repository: https://github.com/gustavfredrikson/cka-dojo

## Overview

cka-dojo is a CLI for CKA practice on disposable, local Kubernetes clusters. A learner selects an exercise, the lab engine prepares its scenario, and the learner works in the cluster before grading checks the resulting state. The product also provides ordered lessons and prerequisites, hints and solutions, environment lifecycle commands, progress tracking, recommendations, and readiness assessment. The graph follows documented workflows and sampled wiring; some subsystem links are omitted where the excerpts do not establish the caller.

Main entry points: [`internal/cli/lab.go`](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/lab.go) (Lab Commands), [`internal/environment/manager.go`](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/environment/manager.go) (Environment Manager), [`internal/cli/app.go`](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/app.go) (Command Wiring), [`internal/progress/progress.go`](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/progress/progress.go) (Study History)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning Content"]
  node_curriculum["Curriculum<br/>[curriculum.go]"]
  node_learning_path["Learning Path<br/>[path.go]"]
end

subgraph group_practice["Lab Practice"]
  node_lab_definition["Lab Definitions<br/>[lab.go]"]
  node_scenario_runner["Scenario Runner<br/>[runner.go]"]
  node_fault_injection["Fault Injection<br/>[fault.go]"]
  node_grading["State Grading<br/>[grader.go]"]
end

subgraph group_environment["Cluster Environment"]
  node_environment_manager["Environment Manager<br/>[manager.go]"]
  node_provisioning["Provisioning<br/>[provision.go]"]
  node_profiles["Environment Profiles<br/>[profile.go]"]
  node_lima_provider["Lima Provider<br/>[lima.go]"]
  node_scrubbing["Exam Scrub<br/>[scrub.go]"]
end

subgraph group_study["Study Tracking"]
  node_progress[("Study History<br/>[progress.go]")]
  node_recommendations["Recommendations<br/>[recommend.go]"]
  node_readiness["Readiness Assessment<br/>[readiness.go]"]
end

subgraph group_runtime["CLI Runtime"]
  node_entry["CLI Entry<br/>[main.go]"]
  node_commands["Command Wiring<br/>[app.go]"]
  node_lab_commands["Lab Commands<br/>[lab.go]"]
  node_environment_commands["Environment Commands<br/>[env.go]"]
  node_learning_commands["Learning Commands<br/>[learn.go]"]
end

node_learner(("Learner"))

node_learner -->|"runs commands"| node_entry
node_entry -->|"dispatches to"| node_commands
node_commands -->|"wires commands"| node_lab_commands
node_commands -->|"wires commands"| node_environment_commands
node_commands -->|"wires commands"| node_learning_commands
node_lab_commands -->|"selects lab"| node_lab_definition
node_lab_commands -->|"sets up scenario"| node_scenario_runner
node_scenario_runner -.->|"applies faults"| node_fault_injection
node_lab_commands -->|"checks cluster"| node_grading
node_grading -->|"checks state through"| node_environment_manager
node_lab_commands -->|"uses environment"| node_environment_manager
node_environment_commands -->|"manages machines"| node_environment_manager
node_environment_manager -.->|"provisions nodes"| node_provisioning
node_environment_manager -.->|"runs provider operations"| node_lima_provider
node_provisioning -.->|"uses profile"| node_profiles
node_lima_provider -->|"provides VM shell"| node_learner
node_learning_commands -->|"loads lessons"| node_curriculum
node_curriculum -->|"loads labs"| node_lab_definition
node_learning_commands -->|"shows exercise path"| node_learning_path
node_lab_commands -->|"records attempts"| node_progress
node_lab_commands -->|"ranks practice"| node_recommendations
node_lab_commands -->|"assesses readiness"| node_readiness
node_lab_commands -->|"scrubs workspace"| node_scrubbing
node_progress -->|"supplies history"| node_readiness
node_progress -->|"supplies history"| node_recommendations
node_lab_commands -->|"shows task and hints"| node_learner

click node_entry "https://github.com/gustavfredrikson/cka-dojo/blob/main/cmd/dojo/main.go"
click node_commands "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/app.go"
click node_lab_commands "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/lab.go"
click node_environment_commands "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/env.go"
click node_learning_commands "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/learn.go"
click node_curriculum "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/curriculum/curriculum.go"
click node_learning_path "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/learning/path.go"
click node_lab_definition "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/lab/lab.go"
click node_scenario_runner "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/lab/runner.go"
click node_fault_injection "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/fault/fault.go"
click node_grading "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/grader/grader.go"
click node_environment_manager "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/environment/manager.go"
click node_provisioning "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/environment/provision.go"
click node_profiles "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/environment/profile.go"
click node_lima_provider "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/provider/lima/lima.go"
click node_progress "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/progress/progress.go"
click node_recommendations "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/recommend/recommend.go"
click node_readiness "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/readiness/readiness.go"
click node_scrubbing "https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/environment/scrub.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_curriculum,node_learning_path toneBlue
class node_lab_definition,node_scenario_runner,node_fault_injection,node_grading toneAmber
class node_environment_manager,node_provisioning,node_profiles,node_lima_provider,node_scrubbing toneMint
class node_progress,node_recommendations,node_readiness toneRose
class node_entry,node_commands,node_lab_commands,node_environment_commands,node_learning_commands,node_learner toneIndigo
```

## Components

### Learning Content

- [Curriculum](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/curriculum/curriculum.go): `internal/curriculum/curriculum.go`
- [Learning Path](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/learning/path.go): `internal/learning/path.go`

### Lab Practice

- [Lab Definitions](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/lab/lab.go): `internal/lab/lab.go`
- [Scenario Runner](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/lab/runner.go): `internal/lab/runner.go`
- [Fault Injection](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/fault/fault.go): `internal/fault/fault.go`
- [State Grading](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/grader/grader.go): `internal/grader/grader.go`

### Cluster Environment

- [Environment Manager](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/environment/manager.go): `internal/environment/manager.go`
- [Provisioning](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/environment/provision.go): `internal/environment/provision.go`
- [Environment Profiles](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/environment/profile.go): `internal/environment/profile.go`
- [Lima Provider](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/provider/lima/lima.go): `internal/provider/lima/lima.go`
- [Exam Scrub](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/environment/scrub.go): `internal/environment/scrub.go`

### Study Tracking

- [Study History](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/progress/progress.go): `internal/progress/progress.go`
- [Recommendations](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/recommend/recommend.go): `internal/recommend/recommend.go`
- [Readiness Assessment](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/readiness/readiness.go): `internal/readiness/readiness.go`

### CLI Runtime

- [CLI Entry](https://github.com/gustavfredrikson/cka-dojo/blob/main/cmd/dojo/main.go): `cmd/dojo/main.go`
- [Command Wiring](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/app.go): `internal/cli/app.go`
- [Lab Commands](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/lab.go): `internal/cli/lab.go`
- [Environment Commands](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/env.go): `internal/cli/env.go`
- [Learning Commands](https://github.com/gustavfredrikson/cka-dojo/blob/main/internal/cli/learn.go): `internal/cli/learn.go`

### Other components

- **Learner**

## Connections

- Learner → CLI Entry: runs commands
- CLI Entry → Command Wiring: dispatches to (evidence: `cmd/dojo/main.go`)
- Command Wiring → Lab Commands: wires commands (evidence: `internal/cli/app.go`)
- Command Wiring → Environment Commands: wires commands (evidence: `internal/cli/app.go`)
- Command Wiring → Learning Commands: wires commands (evidence: `internal/cli/app.go`)
- Lab Commands → Lab Definitions: selects lab (evidence: `internal/cli/lab.go`)
- Lab Commands → Scenario Runner: sets up scenario
- Scenario Runner → Fault Injection: applies faults
- Lab Commands → State Grading: checks cluster
- State Grading → Environment Manager: checks state through (evidence: `internal/grader/grader.go`)
- Lab Commands → Environment Manager: uses environment (evidence: `internal/cli/lab.go`)
- Environment Commands → Environment Manager: manages machines (evidence: `internal/cli/env.go`)
- Environment Manager → Provisioning: provisions nodes
- Environment Manager → Lima Provider: runs provider operations
- Provisioning → Environment Profiles: uses profile
- Lima Provider → Learner: provides VM shell
- Learning Commands → Curriculum: loads lessons (evidence: `internal/cli/learn.go`)
- Curriculum → Lab Definitions: loads labs (evidence: `internal/curriculum/curriculum.go`)
- Learning Commands → Learning Path: shows exercise path (evidence: `internal/cli/learn.go`)
- Lab Commands → Study History: records attempts (evidence: `internal/cli/lab.go`)
- Lab Commands → Recommendations: ranks practice
- Lab Commands → Readiness Assessment: assesses readiness
- Lab Commands → Exam Scrub: scrubs workspace
- Study History → Readiness Assessment: supplies history (evidence: `internal/readiness/readiness.go`)
- Study History → Recommendations: supplies history (evidence: `internal/recommend/recommend.go`)
- Lab Commands → Learner: shows task and hints
