DEV Community

Cover image for How to build desktop apps with Tauri and Mint
Szikszai Gusztáv
Szikszai Gusztáv

Posted on

How to build desktop apps with Tauri and Mint

I've recently launched DevBox (Launch Post), a desktop application full of developer utilities. I am building it with Tauri and Mint 🚀 and in this post, I'll show you how!

Installing Prerequisites

You will need to install both Tauri and Mint.

For Mint, I use asdf:

asdf plugin add mint
asdf install mint latest
Enter fullscreen mode Exit fullscreen mode

For Tauri, it's a little more complicated, but their Getting Started Guide contains the installation instructions.

Scaffolding the project

First, you need to create a directory and install the @tauri-apps/cli and @tauri-apps/api packages of Tauri:

mkdir mint-tauri && cd mint-tauri
yarn add -D @tauri-apps/cli @tauri-apps/api
Enter fullscreen mode Exit fullscreen mode
  • @tauri-apps/cli is the command line interface
  • @tauri-apps/api is the bridge between Rust process and the webview (we will use this later).

Next, we initialize the Tauri side of the project:

yarn tauri init
Enter fullscreen mode Exit fullscreen mode

This will ask some questions about your setup and scaffold the application into src-tauri. The name and title should be different for your project, but the development server and dist directory should be the same:

What is your app name?: mint-tauri-test
What should the window title be?: Mint Tauri Test
Where are your web assets (HTML/CSS/JS) located, relative to the "<current dir>/src-tauri" folder that will be created?: ../app/dist
What is the url of your dev server?: http://localhost:3000
Enter fullscreen mode Exit fullscreen mode

And finally, we initialize the Mint side of the project:

mint init app
Enter fullscreen mode Exit fullscreen mode

Running the development server

There is one thing to do before running the server is to change:

"beforeDevCommand": "",
Enter fullscreen mode Exit fullscreen mode

to:

"beforeDevCommand": "cd app && mint start",
Enter fullscreen mode Exit fullscreen mode

in the src-tauri/tauri.conf.json file. This will make it so that the Mint developer server is started before the Tauri development server.

To start the development server, just run:

yarn tauri dev
Enter fullscreen mode Exit fullscreen mode

(at first, this will take a while because it compiles a bunch of Rust crates, but subsequent invocations will take less time)

At this point, you should see the default Mint application in a window.

Mint Tauri Window


That's it for this post! Let me know what you think in the comments below!

In the next post, I'll show how to integrate with the Tauri APIs to show notifications and read some files!

Top comments (0)