Skip to content

Architecture ​

Overview ​

┌─────────────────────────────────────────────┐
│                  Mark App                    │
│                                             │
│  ┌──────────────┐    ┌───────────────────┐  │
│  │  Rust Backend │    │  Vue 3 Frontend   │  │
│  │  (src-tauri/) │◄──►│  (src/renderer/)  │  │
│  │               │    │                   │  │
│  │  • File I/O   │    │  • Muya editor    │  │
│  │  • CLI parser │    │  • Pinia stores   │  │
│  │  • Git ops    │    │  • Components     │  │
│  │  • Ripgrep    │    │  • Command palette│  │
│  │  • Native menu│    │  • Theme engine   │  │
│  │  • Window mgmt│    │                   │  │
│  └──────────────┘    └───────────────────┘  │
│         ▲                    ▲               │
│         └────── Tauri IPC ───┘               │
└─────────────────────────────────────────────┘

Rust modules (src-tauri/src/) ​

ModulePurpose
main.rsApp entry point, Tauri builder, setup hook
m001_panic.rsPanic hook — crash log + native dialog
m002_fs.rsFile system commands (read, write, stat)
m009_menu.rsNative menu construction + accelerators
m013b/search.rsRipgrep-powered project search
m020_cli.rsCLI argument parsing
m031_diff.rsDiff baseline resolution (git + .before)
dialog.rsNative OS dialogs (migration, error, info)
mt_paths.rsApp data / cache / config path resolution
safe_log.rsPanic-safe stderr logging macro

Renderer stores (src/renderer/src/store/) ​

StorePurpose
editor.jsTab state, current file, save/load lifecycle
preferences.jsUser preferences (theme, font, encoding)
layout.jsSidebar visibility, width, tab bar
search.jsProject search state (ripgrep integration)
project.jsProject tree state (folder roots)
commandCenter.jsCommand palette state

IPC patterns ​

  • Commands — #[tauri::command] functions called from the renderer via invoke(). Request-response pattern.
  • Events — Tauri emit() for backend-to-frontend broadcasts (menu events, file watcher notifications).
  • Bus — Internal renderer event bus (src/renderer/src/bus.js) for component-to-component communication within the frontend.
  • Menu bridge — menu-bridge.js translates native menu events into command executions.

Build pipeline ​

sh
npm run build        # Vite builds the renderer → src-tauri/target/
cargo tauri build    # Packages the Tauri app bundle

The renderer build output is embedded into the Tauri binary. No separate web server needed at runtime.

Released under the MIT License.