Skip to content

Repository files navigation

Tauri Rust WASM Project

A modular, containerized development environment for building cross-platform desktop applications using Tauri, Rust, and WebAssembly.

Project Philosophy

  • 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

Project Structure

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

Core Dependencies

Rust Dependencies

  • 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

Frontend Dependencies

  • vite: 5.0+ - Build tool and dev server
  • typescript: 5.0+ - Type-safe JavaScript
  • @tauri-apps/api: 1.5+ - Tauri frontend API

System Dependencies (handled by Docker)

  • GTK3 and WebKit2GTK (Linux)
  • Build essentials (gcc, pkg-config)
  • Node.js 18+ and npm

Development Workflow

Initial Setup

# 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

Common Commands

# 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 modules

Module Guidelines

Each module should:

  1. Be self-contained with clear interfaces
  2. Have its own tests in the module directory
  3. Export a public API through mod.rs
  4. Keep individual files under 800 lines
  5. Document public interfaces

Building for Production

# 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

Contributing

  1. Keep modules focused and single-purpose
  2. Write tests for new functionality
  3. Update documentation as needed
  4. Follow Rust naming conventions
  5. Use cargo fmt and cargo clippy before commits

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages