feat(backend): Rust core for projects, diagrams and Git

- sqlx/SQLite registry of known projects + user settings (db.rs)
- project create/open with mermix.toml config and slugged paths (project.rs)
- diagram CRUD on .mmd files with frontmatter titles and path-traversal
  guards (diagram.rs)
- git2-backed versioning: commit-all, history, branches, checkout,
  working-tree status (git_ops.rs)
- Tauri command surface, shared state and unified error type
- headless tests covering project creation, diagram CRUD and branch
  isolation (tests.rs)
This commit is contained in:
2026-05-22 16:27:20 +03:00
parent dfafea41f4
commit 890390bc65
11 changed files with 6807 additions and 0 deletions

14
src-tauri/src/state.rs Normal file
View File

@@ -0,0 +1,14 @@
use std::path::PathBuf;
use sqlx::SqlitePool;
/// Application-wide state shared across all Tauri command invocations.
pub struct AppState {
/// Connection pool for the app-level metadata database (project registry,
/// user settings). Per-project data lives on disk inside each Git repo.
pub db: SqlitePool,
/// Directory where Mermix stores its own data (the registry database).
/// Retained on the state for diagnostics and future use.
#[allow(dead_code)]
pub data_dir: PathBuf,
}