# kaijuengine/kaiju architecture

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

- Interactive diagram: https://gitdiagram.com/kaijuengine/kaiju
- Repository: https://github.com/kaijuengine/kaiju

## Overview

Kaiju is a Go game engine with an in-engine editor. The main user workflow is to create or open a project, edit its content and scene, configure rendering, then run the game through the engine. The README documents the engine’s 2D/3D rendering, physics, audio, animation, UI, and platform support, as well as editor plugins and optional HTML/CSS UI markup. The tree and excerpts identify the major implementation areas; several connections between those areas are shown dashed because their runtime call sites were not sampled.

Main entry points: [`src/engine/host.go`](https://github.com/kaijuengine/kaiju/blob/master/src/engine/host.go) (Engine host), [`src/editor/editor.go`](https://github.com/kaijuengine/kaiju/blob/master/src/editor/editor.go) (Editor core), [`src/editor/editor_workspace`](https://github.com/kaijuengine/kaiju/tree/master/src/editor/editor_workspace) (Editor workspaces), [`src/rendering/shader_pipeline_vulkan.go`](https://github.com/kaijuengine/kaiju/blob/master/src/rendering/shader_pipeline_vulkan.go) (Vulkan rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor["Editor"]
  node_editor_app["Editor app<br/>[main.ed.go]"]
  node_editor_core["Editor core<br/>[editor.go]"]
  node_stage_tools["Stage editing"]
  node_workspaces["Editor workspaces"]
  node_plugin_manager["Plugin manager"]
end

subgraph group_project["Project authoring"]
  node_project_model["Project management<br/>[project.go]"]
  node_content_database[("Content database")]
  node_project_files["Project filesystem"]
  node_shader_pipeline_data["Shader pipeline data<br/>[shader_pipeline.go]"]
end

subgraph group_runtime["Engine runtime"]
  node_engine_host["Engine host<br/>[host.go]"]
  node_rendering["Vulkan rendering"]
  node_physics["Physics<br/>[physics_system.go]"]
  node_ui["UI system<br/>[ui_manager.go]"]
  node_terrain["Terrain<br/>[terrain.go]"]
  node_audio["Audio"]
  node_animation["Animation"]
end

subgraph group_extensions["Scripting and platform"]
  node_lua_runtime["Lua integration"]
  node_platform_input["Platform input<br/>[controller.go]"]
end

node_developer(("Game developer"))

node_developer -.->|"opens editor"| node_editor_app
node_editor_app -.->|"launches"| node_editor_core
node_editor_core -.->|"edits project"| node_project_model
node_editor_core -.->|"provides editing"| node_stage_tools
node_editor_core -.->|"hosts workspaces"| node_workspaces
node_editor_core -.->|"supports plugins"| node_plugin_manager
node_workspaces -.->|"browses content"| node_content_database
node_project_model -.->|"uses filesystem"| node_project_files
node_content_database -->|"imports content"| node_project_files
node_workspaces -.->|"edits pipeline"| node_shader_pipeline_data
node_developer -.->|"runs game"| node_engine_host
node_engine_host -.->|"renders with Vulkan"| node_rendering
node_engine_host -.->|"simulates physics"| node_physics
node_engine_host -.->|"updates UI"| node_ui
node_engine_host -.->|"supports terrain"| node_terrain
node_engine_host -.->|"plays audio"| node_audio
node_engine_host -.->|"supports animation"| node_animation
node_engine_host -.->|"supports modding"| node_lua_runtime
node_engine_host -.->|"reads input"| node_platform_input
node_shader_pipeline_data -.->|"configures pipeline"| node_rendering
node_ui -.->|"optional HTML/CSS"| node_rendering

click node_editor_app "https://github.com/kaijuengine/kaiju/blob/master/src/main.ed.go"
click node_editor_core "https://github.com/kaijuengine/kaiju/blob/master/src/editor/editor.go"
click node_stage_tools "https://github.com/kaijuengine/kaiju/blob/master/src/editor/editor_stage_manager/editor_stage_manager.go"
click node_workspaces "https://github.com/kaijuengine/kaiju/tree/master/src/editor/editor_workspace"
click node_plugin_manager "https://github.com/kaijuengine/kaiju/blob/master/src/editor/editor_plugin/editor_plugin_manager.go"
click node_project_model "https://github.com/kaijuengine/kaiju/blob/master/src/editor/project/project.go"
click node_content_database "https://github.com/kaijuengine/kaiju/blob/master/src/editor/project/project_database/content_database/content_database.go"
click node_project_files "https://github.com/kaijuengine/kaiju/blob/master/src/editor/project/project_file_system/project_file_system.go"
click node_shader_pipeline_data "https://github.com/kaijuengine/kaiju/blob/master/src/rendering/shader_pipeline.go"
click node_engine_host "https://github.com/kaijuengine/kaiju/blob/master/src/engine/host.go"
click node_rendering "https://github.com/kaijuengine/kaiju/blob/master/src/rendering/shader_pipeline_vulkan.go"
click node_physics "https://github.com/kaijuengine/kaiju/blob/master/src/engine/physics_system.go"
click node_ui "https://github.com/kaijuengine/kaiju/blob/master/src/engine/ui/ui_manager.go"
click node_terrain "https://github.com/kaijuengine/kaiju/blob/master/src/engine/terrain/terrain.go"
click node_audio "https://github.com/kaijuengine/kaiju/tree/master/src/engine"
click node_animation "https://github.com/kaijuengine/kaiju/blob/master/src/engine_entity_data/engine_entity_data_skin_animation/skin_animation_entity_data.go"
click node_lua_runtime "https://github.com/kaijuengine/kaiju/tree/master/src/plugins/lua"
click node_platform_input "https://github.com/kaijuengine/kaiju/blob/master/src/platform/hid/controller.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_editor_app,node_editor_core,node_stage_tools,node_workspaces,node_plugin_manager toneBlue
class node_project_model,node_content_database,node_project_files,node_shader_pipeline_data toneAmber
class node_engine_host,node_rendering,node_physics,node_ui,node_terrain,node_audio,node_animation toneMint
class node_lua_runtime,node_platform_input toneRose
class node_developer toneIndigo
```

## Components

### Editor

- [Editor app](https://github.com/kaijuengine/kaiju/blob/master/src/main.ed.go): `src/main.ed.go`
- [Editor core](https://github.com/kaijuengine/kaiju/blob/master/src/editor/editor.go): `src/editor/editor.go`
- [Stage editing](https://github.com/kaijuengine/kaiju/blob/master/src/editor/editor_stage_manager/editor_stage_manager.go): `src/editor/editor_stage_manager/editor_stage_manager.go`
- [Editor workspaces](https://github.com/kaijuengine/kaiju/tree/master/src/editor/editor_workspace): `src/editor/editor_workspace`
- [Plugin manager](https://github.com/kaijuengine/kaiju/blob/master/src/editor/editor_plugin/editor_plugin_manager.go): `src/editor/editor_plugin/editor_plugin_manager.go`

### Project authoring

- [Project management](https://github.com/kaijuengine/kaiju/blob/master/src/editor/project/project.go): `src/editor/project/project.go`
- [Content database](https://github.com/kaijuengine/kaiju/blob/master/src/editor/project/project_database/content_database/content_database.go): `src/editor/project/project_database/content_database/content_database.go`
- [Project filesystem](https://github.com/kaijuengine/kaiju/blob/master/src/editor/project/project_file_system/project_file_system.go): `src/editor/project/project_file_system/project_file_system.go`
- [Shader pipeline data](https://github.com/kaijuengine/kaiju/blob/master/src/rendering/shader_pipeline.go): `src/rendering/shader_pipeline.go`

### Engine runtime

- [Engine host](https://github.com/kaijuengine/kaiju/blob/master/src/engine/host.go): `src/engine/host.go`
- [Vulkan rendering](https://github.com/kaijuengine/kaiju/blob/master/src/rendering/shader_pipeline_vulkan.go): `src/rendering/shader_pipeline_vulkan.go`
- [Physics](https://github.com/kaijuengine/kaiju/blob/master/src/engine/physics_system.go): `src/engine/physics_system.go`
- [UI system](https://github.com/kaijuengine/kaiju/blob/master/src/engine/ui/ui_manager.go): `src/engine/ui/ui_manager.go`
- [Terrain](https://github.com/kaijuengine/kaiju/blob/master/src/engine/terrain/terrain.go): `src/engine/terrain/terrain.go`
- [Audio](https://github.com/kaijuengine/kaiju/tree/master/src/engine): `src/engine`
- [Animation](https://github.com/kaijuengine/kaiju/blob/master/src/engine_entity_data/engine_entity_data_skin_animation/skin_animation_entity_data.go): `src/engine_entity_data/engine_entity_data_skin_animation/skin_animation_entity_data.go`

### Scripting and platform

- [Lua integration](https://github.com/kaijuengine/kaiju/tree/master/src/plugins/lua): `src/plugins/lua`
- [Platform input](https://github.com/kaijuengine/kaiju/blob/master/src/platform/hid/controller.go): `src/platform/hid/controller.go`

### Other components

- **Game developer**

## Connections

- Game developer → Editor app: opens editor
- Editor app → Editor core: launches
- Editor core → Project management: edits project
- Editor core → Stage editing: provides editing
- Editor core → Editor workspaces: hosts workspaces
- Editor core → Plugin manager: supports plugins
- Editor workspaces → Content database: browses content
- Project management → Project filesystem: uses filesystem
- Content database → Project filesystem: imports content
- Editor workspaces → Shader pipeline data: edits pipeline
- Game developer → Engine host: runs game
- Engine host → Vulkan rendering: renders with Vulkan
- Engine host → Physics: simulates physics
- Engine host → UI system: updates UI
- Engine host → Terrain: supports terrain
- Engine host → Audio: plays audio
- Engine host → Animation: supports animation
- Engine host → Lua integration: supports modding
- Engine host → Platform input: reads input
- Shader pipeline data → Vulkan rendering: configures pipeline
- UI system → Vulkan rendering: optional HTML/CSS
