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:
14
src-tauri/src/state.rs
Normal file
14
src-tauri/src/state.rs
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user