How fkunn1326/azookey-windows works
Main Components
• Client Component (Rust):
• Located under the “crates/client” directory.
• Contains the TSF (Text Service Framework) integration modules (e.g., tsf folder) and engine code responsible for input handling, text conversion, and IPC with other parts.
• Server Component (Rust):
• Found in “crates/server” which holds code for potentially managing background services or conversion logic.
• Launcher:
• Present in “crates/launcher”; this component is used to initiate and manage the lifecycle of the conversion engine.
• Shared Library:
• Under “crates/shared”, providing common types and Protocol Buffers definitions (service.proto and window.proto) for inter-module messaging and integration.
• UI Component:
• Within “crates/ui”, which likely handles UI elements such as candidate lists or indicators used during conversion.
• Frontend:
• The “frontend” directory shows that a Tauri-based frontend is used. This part involves a web-based UI (with TypeScript/React TSX components) and native Rust bindings (via the “src-tauri” module) for integration.
• Additional Components:
• “crates/macros” for common macros shared across the Rust crates.
• “server-swift” directory indicates that a Swift-based server (or bridging code) exists, probably to support some native Windows functionality or as an additional backend path via FFI.
Interactions & Relationships
• The Client communicates with the Windows TSF subsystem, receiving key events and sending converted text.
• The Client also talks to the Launcher to start and manage the conversion engine.
• Shared libraries provide common protocols and helper logic ensuring consistency across the client, server, and UI components.
• The Server (in Rust) may host backend services such as conversion processing or state management, interacting with the Client via IPC.
• The UI component handles user interactions (e.g., candidate selection) and indicates the conversion status, receiving inputs from the Client/Server.
• The Frontend (Tauri) bridges the web-based UI with native functionality; it interacts with the underlying Rust backend and possibly exposes configuration or debugging tools.
• Finally, the Swift-based server side (“server-swift”) likely interfaces with the conversion engine or other system-level services through a C/FFI layer.
Architectural Patterns & Technologies
• Multi-language / Multi-process Architecture: Multiple crates and languages (Rust, Swift, TypeScript) are integrated, typically via clearly defined interfaces (e.g., Protocol Buffers and IPC).
• Modular Design: The project uses a monorepo layout where each subcomponent (client, server, UI, launcher) is encapsulated as its own crate/module.
• Windows TSF Integration: Emphasize the TSF (Text Service Framework) integration in the client engine for handling IME functionalities.
• Tauri for Desktop UI: The frontend uses Tauri to bridge web technologies with native code.
• Build & Deployment: The existence of build scripts, cargo-make files, and installer scripts (Inno Setup) informs how components are packaged or deployed.