Japp
Facturapp on desktop and mobile with the same code

Facturapp on desktop and mobile with the same code

How Tauri lets me keep a single web codebase for both the desktop and mobile versions of Facturapp.

When I started planning Facturapp, the first truly important decision wasn’t about design or which fields an invoice needed — it was what to wrap a web app in to ship it as a desktop and mobile app without duplicating the work.

Why not Electron

The obvious choice was Electron, which has been the de facto standard for years. But every Electron app bundles its own Chromium inside — so a “hello world” already weighs over a hundred megabytes before writing a single line of your own. For an invoicing app that a freelancer is going to install on a laptop that isn’t always exactly new, that weight seemed like a bad starting point.

What Tauri does differently

Tauri solves the same problem the opposite way: instead of bundling its own browser, it uses the rendering engine the operating system already has installed (WebView2 on Windows, WebKit on macOS and Linux). The result is that the same project that weighed over a hundred megabytes in Electron stays at just a few in Tauri. The native side — windows, filesystem, notifications — runs in Rust, and communicates with my Svelte interface through commands I define myself.

That was also the door that got me to start learning Rust seriously, even though at first I limited myself to copying example commands without fully understanding what they did underneath.

The part that cost me the most

It wasn’t Rust, surprisingly — for what little I needed at first, the commands are fairly mechanical. What cost me the most was designing the interface to work just as well with a finger on a touchscreen as with a mouse and keyboard on a laptop, without ending up with two separate interfaces to maintain. In the end the solution was the usual one in web: design for the smallest space first (mobile) and let desktop take advantage of the extra room, instead of the other way around.

Facturapp is still in progress, but with this foundation I no longer worry about “and how do I also ship it for mobile?” — that question is already solved from the start.

Leave without saving?

You have unsaved changes in this form. If you leave now, they'll be lost.

esen