diff --git a/.gitignore b/.gitignore index 963a460..c55b385 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ package-lock.json # Web frontend build outputs dist/ -.trunk/ # ML model and embedding caches .fastembed_cache/ diff --git a/README.md b/README.md index 72053ee..a305413 100644 --- a/README.md +++ b/README.md @@ -85,11 +85,6 @@ The architecture supports multiple deployment patterns: - **Bun**: Required for TypeScript CLI client: `curl -fsSL https://bun.sh/install | bash` - **Node.js**: Alternative to Bun, supports OpenAI SDK v5.16.0+ -#### WASM Frontend Toolchain -- **Trunk**: Required for Leptos frontend builds: `cargo install trunk` -- **wasm-pack**: `cargo install wasm-pack` -- **WASM target**: `rustup target add wasm32-unknown-unknown` - #### ML Framework Dependencies - **Candle**: Version 0.9.1 with conditional compilation: - macOS: Metal support with CPU fallback for stability @@ -134,11 +129,6 @@ cargo build --bin cli --package inference-engine --release cargo build --bin embeddings-engine --release ``` -**Web Frontend:** -```bash -cd crates/leptos-app -trunk build --release -``` ### Running Services @@ -435,8 +425,7 @@ For Kubernetes deployment details, see the [ARCHITECTURE.md](docs/ARCHITECTURE.m **Symptom:** WASM compilation failures **Solution:** 1. Install required targets: `rustup target add wasm32-unknown-unknown` -2. Install trunk: `cargo install trunk` -3. Check RUSTFLAGS in leptos-app/run.sh +2. Check RUSTFLAGS in leptos-app/run.sh ### Network/Timeout Issues **Symptom:** First-time model downloads timing out @@ -484,7 +473,6 @@ cd crates/leptos-app && ./run.sh & **Cleanup:** ```bash pkill -f "predict-otron-9000" -pkill -f "trunk" ``` For networked tests and full functionality, ensure Hugging Face authentication is configured as described above. diff --git a/crates/leptos-app/src/lib.rs b/crates/leptos-app/src/lib.rs index bb682a7..c743a9b 100644 --- a/crates/leptos-app/src/lib.rs +++ b/crates/leptos-app/src/lib.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + pub mod app; #[cfg(feature = "hydrate")] @@ -15,7 +17,17 @@ pub fn create_leptos_router() -> axum::Router { use leptos::prelude::*; use leptos_axum::{generate_route_list, LeptosRoutes}; - let conf = get_configuration(None).unwrap(); + + // Build an absolute path to THIS crate's Cargo.toml + let mut cargo_toml = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + cargo_toml.push("Cargo.toml"); + + let conf = get_configuration(Some( + cargo_toml.to_str().expect("valid utf-8 path to Cargo.toml"), + )) + .expect("load leptos config"); + + let conf = get_configuration(Some(cargo_toml.to_str().unwrap())).unwrap(); let leptos_options = conf.leptos_options; // Generate the list of routes in your Leptos App let routes = generate_route_list(App);