I've made this repository to demonstrate the cross-platform capabilities of Tauri 2.0. This application targets Desktop and Android platforms.
Follow the steps on the Tauri prerequisites page: https://tauri.app/start/prerequisites
I've used pnpm to build the Tauri application. You can install pnpm using (the last npm command you need...):
npm install -g pnpm@latest-10This module contains a Rust server. This server is added to demonstrate external communication from the Tauri application.
cd lab_tasks_srv
cargo run
# or if you want to watch for changes
cargo watch -x runThis module contains the React front end and the corresponding crates.
The application uses an .env file to point to the target server for external requests. Make sure to place the .env file in the lab_tasks_tauri folder. An example .env file contains:
VITE_BASE_URL = http://localhost:8080
cd lab_tasks_tauri
pnpm I
pnpm tauri init android
# For desktop application
pnpm run tauri dev
# For Android applciation
pnpm run tauri android devThis module contains the crate of types shared by the front and back.
The Tauri plugin focussed on demonstrating the communication from the front end to the Tauri core.
Tauri plugin focussed on demonstrating the communication between the backend and front end.
# Initialize core plugin
npx @tauri-apps/cli plugin new [name]
# Add android plugin
pnpm run tauri plugin android init
# Add Swift :( plugin if you really want to...
pnpm run tauri plugin ios init