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
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
-
@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
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
And finally, we initialize the Mint side of the project:
mint init app
Running the development server
There is one thing to do before running the server is to change:
"beforeDevCommand": "",
to:
"beforeDevCommand": "cd app && mint start",
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
(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.
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)