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

Installation

# Clone the repository
git clone <repository-url>
cd tauri-ref
 
# Install dependencies
npm install
 
# Run in development mode
npm run tauri:dev

Development

# 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

๐Ÿ—๏ธ 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

PlatformBinary SizeStartup TimeMemory 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