Taurify
The taurify
command converts your Next.js app into a Tauri desktop application, allowing you to build cross-platform desktop apps with web technologies.
Usage
npx create-jaseci-app taurify
Prerequisites
Before running the command, ensure you have all the required dependencies installed. The command will check for these automatically, but you can verify them manually by visiting: https://v2.tauri.app/start/prerequisites/
-
Rust and Cargo
- Install Rust from rustup.rs
- Verify installation:
rustc --version
-
System Dependencies
For Linux:
# Ubuntu/Debian
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-devFor macOS:
# Install Xcode Command Line Tools
xcode-select --installFor Windows:
- Install Microsoft Visual Studio C++ Build Tools
- Install WebView2
What it Does
The command performs the following actions:
-
Checks Prerequisites
- Verifies Rust and Cargo installation
- Checks system dependencies
- Validates Next.js project structure
-
Installs Dependencies
- Installs Tauri CLI
- Adds necessary dependencies
- Updates package.json
-
Configures Next.js
- Updates next.config.mjs for static export
- Configures asset prefixes
- Sets up build output
-
Initializes Tauri
- Creates src-tauri directory
- Sets up Rust project
- Configures Tauri settings
-
Updates Configuration
- Configures build commands
- Sets up frontend paths
- Adds development scripts
Example
# Convert to Tauri app
npx create-jaseci-app taurify
# Using yarn
npx create-jaseci-app taurify --package-manager yarn
After Taurification
After running the command:
-
Development
# Start development
npm run tauri dev -
Building
# Build for production
npm run tauri build
Project Structure
my-app/
├── src/ # Next.js source
├── src-tauri/ # Tauri source
│ ├── src/ # Rust source
│ ├── Cargo.toml # Rust dependencies
│ └── tauri.conf.json # Tauri configuration
├── next.config.mjs # Updated Next.js config
└── package.json # Updated scripts
Best Practices
-
Development
- Use
npm run tauri dev
for development - Test on all target platforms
- Follow Tauri security guidelines
- Use
-
Building
- Test production builds
- Sign your applications
- Follow platform guidelines
-
Performance
- Optimize bundle size
- Use proper asset loading
- Follow Tauri best practices
Troubleshooting
Common Issues
-
Prerequisites Missing
- Check Rust installation
- Verify system dependencies
- Check platform requirements
-
Build Failures
- Check error messages
- Verify dependencies
- Check platform compatibility
-
Runtime Issues
- Check console output
- Verify permissions
- Check platform support
Getting Help
If you encounter any issues:
- Check the Tauri documentation
- Search existing issues
- Create a new issue if needed