-
Notifications
You must be signed in to change notification settings - Fork 0
Infrastructure & Tooling
Relevant source files
- src-tauri/.gitignore
- src-tauri/build.rs
- src-tauri/capabilities/default.json
- src-tauri/icons/128x128.png
- src-tauri/icons/128x128@2x.png
- src-tauri/tauri.conf.json
- svelte.config.js
- vite.config.js
Lodestar is built on a modern desktop stack that combines the performance and safety of Rust with the rapid UI iteration of Svelte 5. The infrastructure is designed to handle a local-first workflow where the filesystem is the primary database, necessitating robust file watching, secret management, and a comprehensive testing suite.
Lodestar utilizes Tauri v2 as its core framework src-tauri/tauri.conf.json#1-5 The build system is split between a Rust backend managed by Cargo and a SvelteKit frontend managed by Vite.
- Frontend Integration: The frontend is built as a Single Page Application (SPA) using
@sveltejs/adapter-staticsvelte.config.js#5-14 During development, Tauri connects to a Vite dev server athttp://localhost:1420src-tauri/tauri.conf.json#8 - Permissions: System capabilities like file dialogs and external openers are explicitly defined in the capabilities configuration src-tauri/capabilities/default.json#8-12
- Build Pipeline: The
beforeDevCommandtriggersnpm run devto start the Vite server, whilebeforeBuildCommandensures a production frontend build is placed in../buildbefore the Rust binary is compiled src-tauri/tauri.conf.json#6-11
flowchart TD
subgraph Production
E["tauri build"]
F["npm run build"]
G["Static Assets (../build)"]
H["cargo build --release"]
I["App Bundle (.app/.exe)"]
A["tauri dev"]
B["npm run dev (Vite)"]
D["WebView"]
end
subgraph Development
C["cargo build (Rust)"]
end
E --> F
F --> G
G --> H
H --> I
A --> B
A --> C
B --> D
C --> D
Sources: src-tauri/tauri.conf.json#1-37svelte.config.js#1-18vite.config.js#1-31
The codebase maintains high reliability through a dual-layered testing approach. Rust unit tests handle the logic of the pipeline, fit scoring, and note parsing, while Vitest handles frontend state and UI component logic.
- Rust Testing: Uses inline
#[cfg(test)]modules. To test the job-fetch pipeline without external side effects, the system utilizesFakeScraperandFakeLlmimplementations. - TypeScript Testing: Vitest is used to verify Svelte 5 runes, job status transitions, and complex UI components like the fit breakdown and pipeline progress indicators.
For details, see Testing Strategy.
Because Lodestar operates directly on a Markdown vault, the UI must stay in sync with external edits (e.g., a user modifying a file in Obsidian). The watcher.rs module implements this using the notify crate.
- Change Classification: The system maps filesystem events to internal entity updates (e.g., a change in
companies/triggers arecord:changedevent for that specific slug). - Self-Write Suppression: To prevent infinite loops when the app itself writes to the vault, the
note::was_self_writelogic tracks internal operations and ignores the resulting filesystem events. - Frontend Bridge: The
startVaultSyncfunction in TypeScript listens for these events and updates the corresponding Svelte global stores (e.g.,companiesStore).
For details, see Vault File Watcher & Live Reload.
Lodestar requires sensitive API keys for ScrapingBee and OpenRouter. These are never stored in the vault or the application configuration files.
- OS Keychain: The
secrets.rsmodule uses thekeyringcrate to interface with the native OS credential store (e.g., Apple Keychain on macOS). - In-Memory Caching: To avoid repeated decryption prompts and improve performance, keys are cached in an in-memory
OnceLock. - Whitelisting: Only specific keys defined in
SECRET_KEYSare managed by this system to prevent arbitrary keychain access.
For details, see Secret Management.
Sources: src-tauri/src/main.rs#1-20src-tauri/tauri.conf.json#1-37