# Announcing "Tauri Elm App" - A template for building desktop apps with Tauri

**URL:** <https://discourse.elm-lang.org/t/announcing-tauri-elm-app-a-template-for-building-desktop-apps-with-tauri/9460>\
**Category:** Show and Tell\
**Created:** [November 16, 2023, 5:07pm UTC](https://discourse.elm-lang.org/t/announcing-tauri-elm-app-a-template-for-building-desktop-apps-with-tauri/9460 "2023-11-16T17:07:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ad-si](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ad-si/32/4713_2.png) [@ad-si](https://discourse.elm-lang.org/u/ad-si)\
**Post date:** [November 16, 2023, 5:07pm UTC](https://discourse.elm-lang.org/t/announcing-tauri-elm-app-a-template-for-building-desktop-apps-with-tauri/9460/1 "2023-11-16T17:07:19Z")

</div>

I wanted to build a desktop app and I had heard great things about [Tauri](https://tauri.app/). Unfortunately the existing templates for combining Elm with Tauri either didn’t work for me, or used different components than what I’d have picked.

So I developed my own template: 🎉

> **[GitHub - Airsequel/tauri-elm-app: A template for building desktop apps with...](https://github.com/Airsequel/tauri-elm-app)**
>
> A template for building desktop apps with Tauri, Elm, and Tailwind CSS. - GitHub - Airsequel/tauri-elm-app: A template for building desktop apps with Tauri, Elm, and Tailwind CSS.

It took me quite a few tries to find a setup that worked well. (Elm Land didn’t work, Parcel crashed regularly, pure Elm is missing hot reloading, …). In the end I settled with:

- [elm-watch](https://lydell.github.io/elm-watch/) for hot reloading and bundling. (Since desktop apps don’t have to handle a URL, plain Elm is good enough.) Thanks @lydell for building it! 🙇‍♂️
- [elm-tailwind-modules](https://github.com/matheus23/elm-tailwind-modules) for styling the app with Tailwind CSS

Next steps are adding a CI script with GitHub actions, and maybe adding a second example app which interfaces with a rust backend.

Thanks to Tauri the resulting apps work really weil.  
I hope you all will use it to build some Elm desktop apps! 😁

---

<div class="post-metadata">

**Author:** ![tlentz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/tlentz/32/2499_2.png) [@tlentz](https://discourse.elm-lang.org/u/tlentz)\
**Post date:** [November 17, 2023, 6:56pm UTC](https://discourse.elm-lang.org/t/announcing-tauri-elm-app-a-template-for-building-desktop-apps-with-tauri/9460/2 "2023-11-17T18:56:34Z")

</div>

Sweet. I’ve used Tauri at work for our desktop app. It’s quite nice.

Is there a reason you don’t use vite in your template considering tauri uses vite by default? I haven’t had an experience with bun, but I noticed you chose that.

---

<div class="post-metadata">

**Author:** ![ad-si](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ad-si/32/4713_2.png) [@ad-si](https://discourse.elm-lang.org/u/ad-si)\
**Post date:** [November 17, 2023, 7:35pm UTC](https://discourse.elm-lang.org/t/announcing-tauri-elm-app-a-template-for-building-desktop-apps-with-tauri/9460/3 "2023-11-17T19:35:17Z")

</div>

Vite would have been the next I thing I would have tried if elm-watch hadn’t worked 😄. But I was happy with elm-watch, so I kept it. Is there anything I would gain by using Vite?

Bun is just for installing dependencies and executing the CLI tools. It’s really fast at that, so I like to use it for that nowadays. However, when setting up CI, I realized that it’s not working properly with Windows. So for the Windows build I’m actually using node.js now.

---

<div class="post-metadata">

**Author:** ![tlentz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/tlentz/32/2499_2.png) [@tlentz](https://discourse.elm-lang.org/u/tlentz)\
**Post date:** [November 17, 2023, 8:35pm UTC](https://discourse.elm-lang.org/t/announcing-tauri-elm-app-a-template-for-building-desktop-apps-with-tauri/9460/4 "2023-11-17T20:35:01Z")

</div>

I haven’t used elm-watch either, does it do bundling of javascript? Your template repo doesn’t seem to have any js files or require any bundling of js files/assets.

So for instance how would you call a tauri command from your elm app?

Vite gives you the proper bundling

---

<div class="post-metadata">

**Author:** ![ad-si](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ad-si/32/4713_2.png) [@ad-si](https://discourse.elm-lang.org/u/ad-si)\
**Post date:** [November 17, 2023, 9:05pm UTC](https://discourse.elm-lang.org/t/announcing-tauri-elm-app-a-template-for-building-desktop-apps-with-tauri/9460/5 "2023-11-17T21:05:57Z")

</div>

Sure, the bundling happens here: [https://github.com/Airsequel/tauri-elm-app/blob/3d183768b22e2d58b5c55dcc4a9cab6eda21fef5/makefile#L20](https://github.com/Airsequel/tauri-elm-app/blob/3d183768b22e2d58b5c55dcc4a9cab6eda21fef5/makefile#L20)

An example for calling the rust backend isn’t included yet, but it will work as seen in this project: [GitHub - eaon/tauri-elm-counter: Tauri (Vanilla) + Elm based counter example, where the counter is incremented/decremented/reset by Tauri's Rust backend (Mirror)](https://github.com/eaon/tauri-elm-counter/tree/main)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [November 27, 2023, 9:06pm UTC](https://discourse.elm-lang.org/t/announcing-tauri-elm-app-a-template-for-building-desktop-apps-with-tauri/9460/6 "2023-11-27T21:06:04Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
