# ahonn/grkit architecture

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

- Interactive diagram: https://gitdiagram.com/ahonn/grkit
- Repository: https://github.com/ahonn/grkit

## Overview

GRKit is an SD-card camera add-on plus a browser-based installer and package builder. The user configures a camera, modules, and effects on the web page, then writes the package to an SD card or downloads a ZIP; the camera loads the runtime and exposes its features through the GRK menu. The repository also contains firmware-targeted build tooling, effect/LUT fitting and import, module implementations, and optional fast-boot firmware support. Runtime source was not sampled, so camera-side relationships are limited to documented capabilities rather than inferred call chains.

Main entry points: [`runtime/menu.c`](https://github.com/ahonn/grkit/blob/main/runtime/menu.c) (GRK menu), [`web/src/App.tsx`](https://github.com/ahonn/grkit/blob/main/web/src/App.tsx) (Installer UI), [`crates/grkit-cli/src/main.rs`](https://github.com/ahonn/grkit/blob/main/crates/grkit-cli/src/main.rs) (Build CLI), [`web/src/main.tsx`](https://github.com/ahonn/grkit/blob/main/web/src/main.tsx) (Page entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web installer"]
  node_web_entry["Page entry<br/>[main.tsx]"]
  node_installer_ui["Installer UI<br/>[App.tsx]"]
  node_catalog["Effect catalog<br/>[catalog.ts]"]
  node_imports["Look imports<br/>[store.ts]"]
  node_preview["Look preview<br/>[render.ts]"]
  node_local_card["SD card access<br/>[card.ts]"]
  node_package_builder["Package builder<br/>[package.ts]"]
end

subgraph group_build["Build and effect tooling"]
  node_cli["Build CLI<br/>[main.rs]"]
  node_target_build["Firmware target build<br/>[target.rs]"]
  node_firmware_components["Runtime components<br/>[components.rs]"]
  node_module_builder["Module builder<br/>[module.rs]"]
  node_port_relocation["Ports and relocation<br/>[port.rs]"]
  node_fit["LUT fitting<br/>[mod.rs]"]
  node_fit_sectors["Fit sectors<br/>[sectors.rs]"]
  node_core_package["Package core<br/>[packaging.rs]"]
end

subgraph group_camera["Camera runtime"]
  node_camera_runtime["Camera runtime"]
  node_camera_menu["GRK menu<br/>[menu.c]"]
  node_film_looks["Film looks<br/>[tone.h]"]
  node_framing["Framing and crops<br/>[framing.c]"]
  node_date_stamp["Date imprint<br/>[stamp.c]"]
  node_glow["Glow effect<br/>[glow.c]"]
  node_guides["Composition guides<br/>[guides.c]"]
end

subgraph group_fastboot["Fast boot"]
  node_fastboot_page["Fast-start page<br/>[FastbootPage.tsx]"]
  node_firmware_tool["Firmware updater<br/>[update.rs]"]
  node_fastboot_runtime["Fastboot backend<br/>[backend.c]"]
end

node_visitor(("Camera owner"))
node_card[("SD card")]
node_zip["GRKit ZIP"]

node_visitor -->|"opens site"| node_web_entry
node_web_entry -->|"renders installer"| node_installer_ui
node_installer_ui -->|"loads catalog"| node_catalog
node_installer_ui -->|"accesses card"| node_local_card
node_installer_ui -->|"builds package"| node_package_builder
node_installer_ui -->|"uses imported looks"| node_imports
node_imports -->|"stores previews"| node_preview
node_local_card -->|"writes package"| node_card
node_package_builder -->|"creates download"| node_zip
node_visitor -->|"builds packages"| node_cli
node_cli -->|"builds runtime"| node_target_build
node_target_build -->|"assembles components"| node_firmware_components
node_cli -->|"builds modules"| node_module_builder
node_firmware_components -->|"uses relocation data"| node_port_relocation
node_fit -->|"uses fit sectors"| node_fit_sectors
node_cli -->|"packages artifacts"| node_core_package
node_card -->|"loads from SD"| node_camera_runtime
node_camera_runtime -->|"provides GRK menu"| node_camera_menu
node_camera_menu -->|"offers film looks"| node_film_looks
node_camera_menu -->|"offers framing and crops"| node_framing
node_camera_menu -->|"offers date imprint"| node_date_stamp
node_camera_menu -->|"offers glow"| node_glow
node_camera_menu -->|"offers guides"| node_guides
node_visitor -->|"creates fast-start firmware"| node_fastboot_page
node_fastboot_page -->|"prepares firmware update"| node_firmware_tool
node_firmware_tool -->|"enables fast boot"| node_fastboot_runtime

click node_web_entry "https://github.com/ahonn/grkit/blob/main/web/src/main.tsx"
click node_installer_ui "https://github.com/ahonn/grkit/blob/main/web/src/App.tsx"
click node_catalog "https://github.com/ahonn/grkit/blob/main/web/src/catalog.ts"
click node_imports "https://github.com/ahonn/grkit/blob/main/web/src/import/store.ts"
click node_preview "https://github.com/ahonn/grkit/blob/main/web/src/preview/render.ts"
click node_local_card "https://github.com/ahonn/grkit/blob/main/web/src/card.ts"
click node_package_builder "https://github.com/ahonn/grkit/blob/main/web/src/package.ts"
click node_cli "https://github.com/ahonn/grkit/blob/main/crates/grkit-cli/src/main.rs"
click node_target_build "https://github.com/ahonn/grkit/blob/main/crates/grkit-build/src/target.rs"
click node_firmware_components "https://github.com/ahonn/grkit/blob/main/crates/grkit-build/src/components.rs"
click node_module_builder "https://github.com/ahonn/grkit/blob/main/crates/grkit-build/src/module.rs"
click node_port_relocation "https://github.com/ahonn/grkit/blob/main/crates/grkit-build/src/port.rs"
click node_fit "https://github.com/ahonn/grkit/blob/main/crates/grkit-core/src/fit/mod.rs"
click node_fit_sectors "https://github.com/ahonn/grkit/blob/main/crates/grkit-core/src/fit/sectors.rs"
click node_core_package "https://github.com/ahonn/grkit/blob/main/crates/grkit-core/src/packaging.rs"
click node_camera_runtime "https://github.com/ahonn/grkit/tree/main/runtime"
click node_camera_menu "https://github.com/ahonn/grkit/blob/main/runtime/menu.c"
click node_film_looks "https://github.com/ahonn/grkit/blob/main/runtime/tone.h"
click node_framing "https://github.com/ahonn/grkit/blob/main/modules/framing/framing.c"
click node_date_stamp "https://github.com/ahonn/grkit/blob/main/modules/date/stamp.c"
click node_glow "https://github.com/ahonn/grkit/blob/main/modules/glow/glow.c"
click node_guides "https://github.com/ahonn/grkit/blob/main/modules/guides/guides.c"
click node_fastboot_page "https://github.com/ahonn/grkit/blob/main/web/src/components/FastbootPage.tsx"
click node_firmware_tool "https://github.com/ahonn/grkit/blob/main/crates/grkit-firmware/src/update.rs"
click node_fastboot_runtime "https://github.com/ahonn/grkit/blob/main/runtime/fastboot/backend.c"

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_web_entry,node_installer_ui,node_catalog,node_imports,node_preview,node_local_card,node_package_builder toneBlue
class node_cli,node_target_build,node_firmware_components,node_module_builder,node_port_relocation,node_fit,node_fit_sectors,node_core_package,node_card toneAmber
class node_camera_runtime,node_camera_menu,node_film_looks,node_framing,node_date_stamp,node_glow,node_guides toneMint
class node_fastboot_page,node_firmware_tool,node_fastboot_runtime toneRose
class node_visitor,node_zip toneIndigo
```

## Components

### Web installer

- [Page entry](https://github.com/ahonn/grkit/blob/main/web/src/main.tsx): `web/src/main.tsx`
- [Installer UI](https://github.com/ahonn/grkit/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Effect catalog](https://github.com/ahonn/grkit/blob/main/web/src/catalog.ts): `web/src/catalog.ts`
- [Look imports](https://github.com/ahonn/grkit/blob/main/web/src/import/store.ts): `web/src/import/store.ts`
- [Look preview](https://github.com/ahonn/grkit/blob/main/web/src/preview/render.ts): `web/src/preview/render.ts`
- [SD card access](https://github.com/ahonn/grkit/blob/main/web/src/card.ts): `web/src/card.ts`
- [Package builder](https://github.com/ahonn/grkit/blob/main/web/src/package.ts): `web/src/package.ts`

### Build and effect tooling

- [Build CLI](https://github.com/ahonn/grkit/blob/main/crates/grkit-cli/src/main.rs): `crates/grkit-cli/src/main.rs`
- [Firmware target build](https://github.com/ahonn/grkit/blob/main/crates/grkit-build/src/target.rs): `crates/grkit-build/src/target.rs`
- [Runtime components](https://github.com/ahonn/grkit/blob/main/crates/grkit-build/src/components.rs): `crates/grkit-build/src/components.rs`
- [Module builder](https://github.com/ahonn/grkit/blob/main/crates/grkit-build/src/module.rs): `crates/grkit-build/src/module.rs`
- [Ports and relocation](https://github.com/ahonn/grkit/blob/main/crates/grkit-build/src/port.rs): `crates/grkit-build/src/port.rs`
- [LUT fitting](https://github.com/ahonn/grkit/blob/main/crates/grkit-core/src/fit/mod.rs): `crates/grkit-core/src/fit/mod.rs`
- [Fit sectors](https://github.com/ahonn/grkit/blob/main/crates/grkit-core/src/fit/sectors.rs): `crates/grkit-core/src/fit/sectors.rs`
- [Package core](https://github.com/ahonn/grkit/blob/main/crates/grkit-core/src/packaging.rs): `crates/grkit-core/src/packaging.rs`

### Camera runtime

- [Camera runtime](https://github.com/ahonn/grkit/tree/main/runtime): `runtime`
- [GRK menu](https://github.com/ahonn/grkit/blob/main/runtime/menu.c): `runtime/menu.c`
- [Film looks](https://github.com/ahonn/grkit/blob/main/runtime/tone.h): `runtime/tone.h`
- [Framing and crops](https://github.com/ahonn/grkit/blob/main/modules/framing/framing.c): `modules/framing/framing.c`
- [Date imprint](https://github.com/ahonn/grkit/blob/main/modules/date/stamp.c): `modules/date/stamp.c`
- [Glow effect](https://github.com/ahonn/grkit/blob/main/modules/glow/glow.c): `modules/glow/glow.c`
- [Composition guides](https://github.com/ahonn/grkit/blob/main/modules/guides/guides.c): `modules/guides/guides.c`

### Fast boot

- [Fast-start page](https://github.com/ahonn/grkit/blob/main/web/src/components/FastbootPage.tsx): `web/src/components/FastbootPage.tsx`
- [Firmware updater](https://github.com/ahonn/grkit/blob/main/crates/grkit-firmware/src/update.rs): `crates/grkit-firmware/src/update.rs`
- [Fastboot backend](https://github.com/ahonn/grkit/blob/main/runtime/fastboot/backend.c): `runtime/fastboot/backend.c`

### Other components

- **Camera owner**
- **SD card**
- **GRKit ZIP**

## Connections

- Camera owner → Page entry: opens site (evidence: `web/src/main.tsx`)
- Page entry → Installer UI: renders installer (evidence: `web/src/main.tsx`)
- Installer UI → Effect catalog: loads catalog (evidence: `web/src/App.tsx`)
- Installer UI → SD card access: accesses card (evidence: `web/src/App.tsx`)
- Installer UI → Package builder: builds package (evidence: `web/src/App.tsx`)
- Installer UI → Look imports: uses imported looks (evidence: `web/src/App.tsx`)
- Look imports → Look preview: stores previews (evidence: `web/src/import/store.ts`)
- SD card access → SD card: writes package (evidence: `README.md`)
- Package builder → GRKit ZIP: creates download (evidence: `README.md`)
- Camera owner → Build CLI: builds packages (evidence: `README.md`)
- Build CLI → Firmware target build: builds runtime
- Firmware target build → Runtime components: assembles components (evidence: `crates/grkit-build/src/components.rs`)
- Build CLI → Module builder: builds modules
- Runtime components → Ports and relocation: uses relocation data (evidence: `crates/grkit-build/src/components.rs`)
- LUT fitting → Fit sectors: uses fit sectors (evidence: `crates/grkit-core/src/fit/mod.rs`)
- Build CLI → Package core: packages artifacts (evidence: `crates/grkit-cli/src/main.rs`)
- SD card → Camera runtime: loads from SD (evidence: `README.md`)
- Camera runtime → GRK menu: provides GRK menu (evidence: `README.md`)
- GRK menu → Film looks: offers film looks (evidence: `README.md`)
- GRK menu → Framing and crops: offers framing and crops (evidence: `README.md`)
- GRK menu → Date imprint: offers date imprint (evidence: `README.md`)
- GRK menu → Glow effect: offers glow (evidence: `README.md`)
- GRK menu → Composition guides: offers guides (evidence: `README.md`)
- Camera owner → Fast-start page: creates fast-start firmware (evidence: `README.md`)
- Fast-start page → Firmware updater: prepares firmware update (evidence: `README.md`)
- Firmware updater → Fastboot backend: enables fast boot (evidence: `README.md`)
