A modular, containerized development environment for building cross-platform desktop applications using Tauri, Rust, and WebAssembly.
- Modular Architecture: All code files kept under 800 lines for maintainability
- Reproducible Environments: Docker-based development ensuring consistency
- Clear Separation: Distinct boundaries between core logic, UI, and platform-specific code
- Type Safety: Leveraging Rust's type system throughout the stack
testing_grounds/
├── src/ # Source code root
│ ├── core/ # Core business logic (platform-agnostic)
│ │ ├── models/ # Data structures and domain models
│ │ ├── services/ # Business logic services
│ │ └── utils/ # Shared utilities
│ ├── modules/ # Feature modules (self-contained functionality)
│ │ ├── auth/ # Authentication module
│ │ ├── data/ # Data management module
│ │ └── ui/ # UI component modules
│ ├── wasm/ # WebAssembly modules
│ │ ├── bindings/ # JS/WASM bindings
│ │ ├── core/ # WASM core logic
│ │ └── pkg/ # Built WASM packages
│ └── tauri/ # Tauri-specific code
│ ├── commands/ # Tauri command handlers
│ ├── menu/ # Application menu setup
│ └── window/ # Window management
├── docker/ # Docker configurations
│ └── Dockerfile # Multi-stage build configuration
├── scripts/ # Development and build scripts
│ ├── dev.sh # Development helper script
│ ├── build.sh # Production build script
│ └── test.sh # Test runner script
├── tests/ # Test suites
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── e2e/ # End-to-end tests
├── docs/ # Documentation
│ ├── architecture/ # Architecture decisions
│ └── api/ # API documentation
├── config/ # Configuration files
│ ├── tauri.conf.json # Tauri configuration
│ └── cargo.toml # Workspace configuration
└── docker-compose.yml # Container orchestration
- rust: 1.75+ (via Docker or system)
- tauri: 1.5+ - Desktop application framework
- wasm-bindgen: 0.2+ - WASM/JS interop
- wasm-pack: 0.12+ - WASM build tool
- serde: 1.0+ - Serialization framework
- tokio: 1.0+ - Async runtime
- vite: 5.0+ - Build tool and dev server
- typescript: 5.0+ - Type-safe JavaScript
- @tauri-apps/api: 1.5+ - Tauri frontend API
- GTK3 and WebKit2GTK (Linux)
- Build essentials (gcc, pkg-config)
- Node.js 18+ and npm
# Clone the repository
git clone <repository-url>
cd testing_grounds
# Start the Docker environment
./scripts/dev.sh start
# Enter the development container
./scripts/dev.sh shell# Inside the container:
cargo build # Build Rust code
cargo test # Run tests
cargo tauri dev # Start Tauri in development mode
wasm-pack build # Build WASM modules
# From host:
./scripts/dev.sh build # Build entire project
./scripts/dev.sh test # Run all tests
./scripts/dev.sh wasm # Build WASM modulesEach module should:
- Be self-contained with clear interfaces
- Have its own tests in the module directory
- Export a public API through
mod.rs - Keep individual files under 800 lines
- Document public interfaces
# Build for current platform
cargo tauri build
# Cross-compile for other platforms (requires additional setup)
cargo tauri build --target x86_64-pc-windows-msvc
cargo tauri build --target x86_64-apple-darwin- Keep modules focused and single-purpose
- Write tests for new functionality
- Update documentation as needed
- Follow Rust naming conventions
- Use
cargo fmtandcargo clippybefore commits