feat: scaffold Tauri 2.0 backend foundation

Set up the Rust backend for Mission Control using Tauri 2.0:

Cargo Configuration:
- Cargo.toml: Tauri 2.0, serde, thiserror, tracing, mockall
  - Library crate (mission_control_lib) for testability
  - Binary crate for Tauri entry point
- Cargo.lock: Pinned dependencies for reproducible builds

Tauri Configuration (tauri.conf.json):
- App identifier: com.mission-control.app
- Window: 800x600, centered, hiddenTitle for clean macOS look
- Shell plugin scoped to lore, br, bv commands only
- Tray icon configured for background operation

Application Bootstrap:
- src/main.rs: Minimal entry point, delegates to lib
- src/lib.rs: Tracing setup, plugin registration, command handlers
  - Debug mode: auto-opens devtools
  - Safe window lookup (no unwrap panic)
- build.rs: Tauri build script for codegen

Architecture: The lib/bin split enables unit testing the Tauri
command handlers without launching the full app.
This commit is contained in:
teernisse
2026-02-25 17:01:14 -05:00
parent 7877ff9218
commit 62ee08de29
6 changed files with 5540 additions and 0 deletions

47
src-tauri/src/lib.rs Normal file
View File

@@ -0,0 +1,47 @@
//! Mission Control - ADHD-centric personal productivity hub
//!
//! This crate provides the Rust backend for Mission Control, handling:
//! - CLI integration with lore (GitLab data) and br (beads task management)
//! - GitLab → Beads bridge (creating beads from GitLab events)
//! - Decision logging and state persistence
//! - File watching for automatic sync
pub mod commands;
pub mod data;
use tauri::Manager;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
/// Initialize the Tauri application with all plugins and commands.
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
// Initialize tracing
tracing_subscriber::registry()
.with(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| "mission_control=debug".into()),
)
.with(tracing_subscriber::fmt::layer())
.init();
tracing::info!("Starting Mission Control");
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.setup(|app| {
#[cfg(debug_assertions)]
{
// Open devtools in debug mode
if let Some(window) = app.get_webview_window("main") {
window.open_devtools();
}
}
Ok(())
})
.invoke_handler(tauri::generate_handler![
commands::greet,
commands::get_lore_status,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}