Skip to content

Architecture

Leonard Ramminger edited this page Aug 22, 2026 · 1 revision

Architecture

High-level overview of the Tempify codebase.

Layers

flowchart TB
    CLI[CLI / CliParser] --> App[TempifyApp]
    App --> Loader[TemplateLoader]
    App --> Planner[BuildPlanner]
    App --> Executor[BuildExecutor]
    Loader --> Lua[LuaEngine]
    Planner --> Prebyte[PrebyteRenderer]
    Executor --> Hooks[LuaHookRuntime]
    App --> Store[LocalTemplateStore / SharedStore]
    App --> Lock[GenerationLock / Reapply]
Loading

Main modules

Module Path (approx.) Responsibility
CLI src/main/cpp/cli/ Arguments, help, subcommands
App src/main/cpp/app/ Orchestrate render/validate/test
Template src/main/cpp/template/ Load, merge, layout, tests
Lua src/main/cpp/lua/ Manifest, questions, hooks
Prebyte src/main/cpp/prebyte/ .pbt rendering (embedded engine)
Config src/main/cpp/config/ Global/workspace config
Store src/main/cpp/store/ Template paths, shared store

Render pipeline

  1. Load template(s) and merge includes (TemplateLoader + TemplateMerge)
  2. Answer questions (TUI, --set, --answers-file)
  3. Build BuildPlan from files + layout.lua
  4. Hooks pre → directories → before_render → Prebyte → after_render → post
  5. Write lockfile

External dependencies

  • Prebyte - pinned separately, fetched on first CMake configure
  • CLI11 - CLI parsing
  • Lua - manifests, questions, hooks
  • nlohmann/json - lock, answers, config

ReqPack integration

Plugin bundle in repo (reqpack-plugin/), not embedded in CLI core.

See also

Development & Build · Tests & Quality

Clone this wiki locally