src-tauri/: Rust backend with Tauri integration. Core detection logic lives insrc/services/detection/(split into segment_builder, aggregation, comparison, dual_mode, llm_analyzer). AI providers insrc/services/providers.rs, text processing insrc/services/text_processor.rs.src/: Vue 3 + TypeScript frontend. Components insrc/components/(TitleBar, ControlPanel, TextInput, ResultsPanel, SettingsModal, LoadingMask). Composables insrc/composables/(useDetection, useProviders, useFileHandler, useWindow). Types insrc/types/.legacy-python-electron/: Archived Python/FastAPI + Electron code for reference.
npm run tauri dev: Development mode with hot reload for both frontend and backend.npm run tauri build: Build production installer.cd src-tauri && cargo check: Check Rust code for errors.cd src-tauri && cargo test: Run Rust unit tests.npm run build: Build frontend only.
- Rust follows 4-space indentation, snake_case for functions/variables, CamelCase for structs, module names matching functionality (e.g.,
segment_builder.rs,dual_mode.rs). - TypeScript/Vue follows camelCase for functions/variables, PascalCase for components and types. Composables use
use*prefix. - UI strings are in Chinese - preserve when editing.
- Each file should have a single responsibility. Split large files into focused modules.
- Rust tests live alongside code using
#[cfg(test)]modules. - Run
cargo testinsrc-tauri/after changes to detection or service logic. - Keep tests concise and deterministic.
- Commit messages should describe the change succinctly (e.g., "Split detection.rs into modular files" or "Add useProviders composable"). Use present-tense verbs.
- PRs should include: purpose overview, impacted areas (backend/frontend), and any breaking changes.
- For Tauri command changes, update both Rust handlers and TypeScript invoke calls.