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:
5371
src-tauri/Cargo.lock
generated
Normal file
5371
src-tauri/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
41
src-tauri/Cargo.toml
Normal file
41
src-tauri/Cargo.toml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
[package]
|
||||||
|
name = "mission-control"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "ADHD-centric personal productivity hub"
|
||||||
|
authors = ["Taylor Eernisse"]
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "mission_control_lib"
|
||||||
|
crate-type = ["lib", "cdylib", "staticlib"]
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "mission-control"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
tauri-build = { version = "2", features = [] }
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tauri = { version = "2", features = ["tray-icon"] }
|
||||||
|
tauri-plugin-shell = "2"
|
||||||
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
serde_json = "1"
|
||||||
|
tokio = { version = "1", features = ["full"] }
|
||||||
|
thiserror = "2"
|
||||||
|
tracing = "0.1"
|
||||||
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
|
dirs = "5"
|
||||||
|
notify = "7"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
tempfile = "3"
|
||||||
|
mockall = "0.13"
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
panic = "abort"
|
||||||
|
codegen-units = 1
|
||||||
|
lto = true
|
||||||
|
opt-level = "z"
|
||||||
|
strip = true
|
||||||
3
src-tauri/build.rs
Normal file
3
src-tauri/build.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
tauri_build::build()
|
||||||
|
}
|
||||||
47
src-tauri/src/lib.rs
Normal file
47
src-tauri/src/lib.rs
Normal 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");
|
||||||
|
}
|
||||||
6
src-tauri/src/main.rs
Normal file
6
src-tauri/src/main.rs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||||
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
mission_control_lib::run()
|
||||||
|
}
|
||||||
72
src-tauri/tauri.conf.json
Normal file
72
src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
|
"productName": "Mission Control",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"identifier": "com.mission-control.app",
|
||||||
|
"build": {
|
||||||
|
"beforeDevCommand": "npm run dev",
|
||||||
|
"devUrl": "http://localhost:1420",
|
||||||
|
"beforeBuildCommand": "npm run build",
|
||||||
|
"frontendDist": "../dist"
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"withGlobalTauri": false,
|
||||||
|
"windows": [
|
||||||
|
{
|
||||||
|
"title": "Mission Control",
|
||||||
|
"width": 800,
|
||||||
|
"height": 600,
|
||||||
|
"resizable": true,
|
||||||
|
"fullscreen": false,
|
||||||
|
"center": true,
|
||||||
|
"hiddenTitle": true,
|
||||||
|
"decorations": true,
|
||||||
|
"transparent": false,
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"trayIcon": {
|
||||||
|
"iconPath": "icons/icon.png",
|
||||||
|
"iconAsTemplate": true
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"csp": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bundle": {
|
||||||
|
"active": true,
|
||||||
|
"icon": [
|
||||||
|
"icons/32x32.png",
|
||||||
|
"icons/128x128.png",
|
||||||
|
"icons/128x128@2x.png",
|
||||||
|
"icons/icon.icns",
|
||||||
|
"icons/icon.ico"
|
||||||
|
],
|
||||||
|
"targets": "all",
|
||||||
|
"macOS": {
|
||||||
|
"minimumSystemVersion": "10.15"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins": {
|
||||||
|
"shell": {
|
||||||
|
"open": true,
|
||||||
|
"scope": [
|
||||||
|
{
|
||||||
|
"name": "lore",
|
||||||
|
"cmd": "lore",
|
||||||
|
"args": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "br",
|
||||||
|
"cmd": "br",
|
||||||
|
"args": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bv",
|
||||||
|
"cmd": "bv",
|
||||||
|
"args": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user