Initial commit

This commit is contained in:
Aodhan Collins
2025-10-06 00:33:04 +01:00
commit 66749a5ce7
71 changed files with 22041 additions and 0 deletions

48
src-tauri/src/main.rs Normal file
View File

@@ -0,0 +1,48 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use serde::Serialize;
#[derive(Serialize, Clone)]
struct Keys {
openrouter_api_key: Option<String>,
elevenlabs_api_key: Option<String>,
}
#[tauri::command]
fn get_env_keys() -> Keys {
// In development, the CWD is `src-tauri/target/debug`, so we go up two levels
// to find the project root.
if let Ok(path) = std::env::current_dir() {
if let Some(p) = path.ancestors().nth(2) {
let env_path = p.join(".env");
dotenvy::from_path(env_path).ok();
}
} else {
dotenvy::dotenv().ok();
}
let openrouter_api_key = std::env::var("OPENROUTER_API_KEY").ok();
let elevenlabs_api_key = std::env::var("ELEVENLABS_API_KEY").ok();
Keys { openrouter_api_key, elevenlabs_api_key }
}
// Commands that can be called from the frontend
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! Welcome to EVE.", name)
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet, get_env_keys])
.setup(|_app| {
#[cfg(debug_assertions)]
{
// DevTools are available via F12 or the context menu
}
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}