Tauri

This guide will walk you through the basics of creating a new desktop (and maybe mobile?) Tauri app using SvelteKit and Skeleton as your frontend.


What is Tauri?

Tauri is a framework that lets you build

smaller, faster, and more secure desktop applications with a web frontend

To achieve that, it uses Rust as the backend of your application. But don't worry, you don't necessarily need to know Rust to use it! Tauri exposes many useful APIs and many plugins let you handle backend related stuff without leaving your JavaScript/TypeScript. For example, the tauri-plugin-sql lets you support sqlite, mysql and postgres without even touching Rust!

Prerequisites

To begin with, you need to install some prerequisites, like Rust and system dependencies. The installation process depends on your OS, so we recommend following the official Tauri guide: https://tauri.app/v1/guides/getting-started/prerequisites

Create your Skeleton project

The first step is to create your SvelteKit project with Skeleton. There are two ways to do it. The easiest one is to use the Skeleton CLI that will automatically scaffold a new SvelteKit application, install Tailwind, configure Skeleton, and more.

terminal
npm create skeleton-app@latest my-skeleton-app
	- Enable Typescript when prompted (recommended)
cd my-skeleton-app
npm install

If you already have a SvelteKit project then you will need to install and configure Skeleton manually following our step by step guide in the Get Started section: https://www.skeleton.dev/docs/get-started#install-skeleton

Create your Tauri app

Now you have your frontend, but a Tauri app needs a blazingly fast Rust backend. Luckily Tauri also has a CLI that makes the hard work for us. Follow this Tauri guide to setup SSG and the backend: https://tauri.app/v1/guides/getting-started/setup/sveltekit#sveltekit-in-ssg-mode

If you followed every step, you should be ready to run your app with:

terminal
npm run tauri dev

Further Reading

Congrats! You have now created a simple desktop app using Tauri, SvelteKit and Skeleton. To start working on it we highly recommend these resources:

  1. Tauri Guides and Documentation: https://tauri.app/v1/guides/development/development-cycle
  2. The Rust Book: https://doc.rust-lang.org/book/
  3. Check out our various web-related recommendations in the introduction