How matthias-stemmler/annimate works
Project type and purpose
• Annimate is a cross-platform desktop application (Windows, macOS, Linux) built with Tauri.
• It provides a friendly GUI to export query results (matches) from an external ANNIS corpus-query system into CSV or Excel formats.
• The core functionality (corpus import, query execution, result formatting) lives in a Rust library crate (annimate_core), while the desktop UI and native integrations live in the annimate_desktop Tauri app (Rust + React/TypeScript).
High-level file-structure analysis
• Top-level crates/configs:
• annimate_core/ (Rust library, Cargo.toml, src/ modules: import, query, cache, format, export)
• annimate_desktop/ (Tauri app)
– src-tauri/ (Rust Tauri backend: api.rs, state.rs, main.rs, build.rs)
– src/ (React app in TypeScript: UI components, store, API wrappers)
• CI/workflows (.github/workflows/ for cargo + pnpm lint/build/test/release)
• Docs (docs/, pages/) and user-guide
Key insights from the README
• Annimate sits alongside the ANNIS web interface, focusing solely on exporting results.
• Relies on the graphANNIS library under the hood (Rust dependency) to query ANNIS.
• Exports one row per match, with KWIC context and metadata.
• Packaged via Tauri for native installers and auto-updates.
Main components and their interactions
a. Presentation layer (React UI)
• Components under annimate_desktop/src/components
• Dispatches user actions (select corpora, run query, export)
• Uses src/lib/api.ts for invoking backend commands via Tauri’s JavaScript‐to-Rust bridge
b. Application layer (Tauri backend)
• src-tauri/src/main.rs registers commands
• api.rs defines functions exposed to JS (e.g., run_query, export_matches)
• delayed_queue.rs manages long-running tasks without blocking UI
• Maintains in-memory state.rs for current project config
c. Domain/core layer (annimate_core crate)
• Modules: import (reads GraphML/RELANNIS archives), query (builds/executes AQL queries via graphANNIS), cache (caches query results), format (CSV/XLSX writers), metadata, project (project config & serialization)
• Exposes a Rust API consumed by Tauri backend
d. Infrastructure/external services
• External ANNIS server (over HTTP via graphANNIS client)
• Local filesystem (read project archives, write CSV/XLSX exports)
• Auto-update service (Tauri updater)
• CI/CD pipeline (GitHub Actions invoking Cargo and pnpm)
Architectural patterns & design principles
• Layered architecture: Presentation (React) → Application (Tauri commands) → Domain (Rust core library) → Infrastructure (external ANNIS, filesystem).
• Separation of concerns: UI purely handles state/UX; core library is UI-agnostic.
• Asynchronous command queue to keep UI responsive.
• Use of Rust’s module system and strong typing for reliability.
• Tauri’s invoke pattern for secure, sandboxed JS↔Rust communication.