Tauri Hello World - Cross-Platform Reference
A demonstration of a cross-platform application built with Tauri v2, targeting multiple platforms from a single codebase.
๐ฏ Supported Platforms
- โ macOS M3 (ARM64) - Native Apple Silicon support
- โ Android Mobile - ARM64 and ARMv7 devices
- โ Linux (NVIDIA DGX-Spark) - High-performance computing environment
๐ Features
- Single Codebase: Write once, run on desktop and mobile
- Native Performance: Rust backend with platform-native UI
- Small Binary Size: ~2-12MB depending on platform
- Modern Web Frontend: HTML5, CSS3, and JavaScript (ES Modules)
- IPC Communication: Type-safe Rust โ JavaScript bridge
- Platform Detection: Automatic OS and architecture detection
๐ฆ Quick Start
Prerequisites
- Rust (latest stable): Install Rust
- Node.js (v18+): Install Node.js
- Platform-specific tools: See SETUP.md
Installation
# Clone the repository
git clone <repository-url>
cd tauri-ref
# Install dependencies
npm install
# Run in development mode
npm run tauri:devDevelopment
# Desktop development (macOS/Linux)
npm run tauri:dev
# Android development
npm run tauri:android
# Build for production
npm run tauri:build
# Build Android APK
npm run tauri:android:build๐ Documentation
- Setup Guide - Platform-specific installation and configuration
- Architecture - Technical architecture and project structure
- Platform Details - Platform-specific build and deployment information
๐๏ธ Project Structure
tauri-ref/
โโโ src/ # Frontend (HTML/CSS/JS)
โ โโโ index.html
โ โโโ style.css
โ โโโ main.js
โโโ src-tauri/ # Rust backend
โ โโโ src/
โ โ โโโ main.rs # Desktop entry
โ โ โโโ lib.rs # Mobile library
โ โโโ Cargo.toml # Rust dependencies
โ โโโ tauri.conf.json # Tauri config
โโโ docs/ # Documentation
โโโ package.json # Node dependencies
๐ ๏ธ Technology Stack
Frontend:
- HTML5/CSS3
- Vanilla JavaScript (ES Modules)
- Vite (build tool)
Backend:
- Rust (systems programming)
- Tauri v2 (app framework)
- Platform-native WebView
๐จ UI Demo
The app includes:
- Platform detection and display
- Interactive greeting form
- Responsive design
- Modern gradient UI
๐ฑ Platform Specifics
macOS M3 (ARM64)
- Native Apple Silicon binary
- Uses WKWebView
- ~2-3MB binary size
- Code signing supported
Android
- API 24+ (Android 7.0+)
- ARM64-v8a primary target
- APK/AAB packaging
- ~8-12MB app size
Linux (DGX-Spark)
- x86_64 architecture
- WebKit2GTK renderer
- DEB/AppImage packaging
- GPU acceleration support
๐ง Build Commands
# Development
npm run dev # Frontend dev server
npm run tauri:dev # Tauri dev (desktop)
npm run tauri:android # Android dev
# Production
npm run build # Build frontend
npm run tauri:build # Build desktop app
npm run tauri:android:build # Build Android APK๐งช Testing
# Run on Android emulator
adb devices
npm run tauri:android
# Check Android logs
adb logcat | grep Tauri
# Desktop testing
npm run tauri:dev๐ Performance
| Platform | Binary Size | Startup Time | Memory Usage |
|---|---|---|---|
| macOS M3 | ~2-3MB | ~150ms | ~40MB |
| Android | ~8-12MB | ~650ms | ~50MB |
| Linux | ~3-4MB | ~200ms | ~45MB |
๐ Security
- Minimal permissions by default
- Type-safe IPC communication
- OS-level sandboxing
- Content Security Policy configured
๐ค Contributing
This is a reference implementation. Feel free to:
- Fork and experiment
- Report issues
- Suggest improvements
- Use as a starting point for your projects
๐ License
This project is provided as a demonstration/reference implementation.
๐ Resources
๐ Acknowledgments
Built with Tauri - a framework for building tiny, blazingly fast binaries for all major platforms.
Happy Building! ๐
For detailed setup instructions, see SETUP.md