Skip to content

Architecture Overview

The application is built on a dual-process architecture designed for zero-latency typing and robust file management. It strictly separates the "glass" renderer from the headless mastermind.

  • The Frontend (C# Avalonia NativeAOT): Acts purely as a "glass" renderer. It has zero disk access. It renders text using custom Skia/HarfBuzz layout and communicates with Nim via strictly typed NDJSON over stdin/stdout.
  • The Backend (Nim): A headless executable that acts as the absolute gatekeeper of the hard drive (libgit2 bindings) and the application state. It manages memory, handles all Disk I/O, orchestrates background saves, and tracks version history.

To understand how these two halves work together without stepping on each other's toes, the architecture is broken down into four core pillars:

  1. State Boundaries: Defines who owns what. Nim manages the canonical truth on disk, while C# manages ephemeral memory for typing.
  2. IPC Sync Triggers: Explains the specific moments data crosses the inter-process boundary and how optimistic UI handles latency.
  3. Complex Logic Flows: Breaks down responsibilities for complex features like Undo/Redo and the application shutdown sequence.
  4. Task Delegation: Maps out how physical (geometry) and logical (structure) boundaries govern which language handles which task.