Overview of Crux Architecture
masterCrux is a framework for cross-platform app development using Rust. It follows an architecture similar to Elm, strictly separating pure computational logic from side effects.
Core Components
- Side-effect-free Core: A Rust-based shared logic layer that manages internal state and performs pure calculations. It is compiled as a static library for iOS/macOS, a dynamic library for Android, or a WebAssembly module for the web.
- Application Shell: A platform-native layer (SwiftUI, Jetpack Compose, React, etc.) that acts as the runtime environment. It handles all non-pure tasks (side effects) and provides the UI.
- Managed Effects: Side effects (like API calls) are captured as values by the Core and executed by the Shell. This makes the Core portable and allows for high-speed testing without mocks or stubs.