Skip to main content
in Rant

Trying out Tauri by building ray

I'm always on the lookout for new technologies to explore and experiment with. Recently, I came across Tauri, a framework for building desktop apps using web technologies like HTML, CSS, and JavaScript. Intrigued, I decided to give it a try and document my experience here.

I had no prior experience with Rust, the programming language that Tauri is built on.

For inspiration, I decided to replicate the functionality of the Ray app, which is a desktop app for debugging systems in development. Like a simplified alternative to XDebug.

To get started, I created a new Tauri project using the Tauri CLI. This generated a basic project structure with Rust code for the backend and Vue code for the frontend. I then began working on the Rust code, starting with the TCP stream functionality.

It took me some time to get the TCP stream working correctly, but once I did, I was able to see incoming data displayed in my console.

fn start_listener(_window: Window) {
    let listener = TcpListener::bind("127.0.0.1:23517").unwrap();

    for stream in listener.incoming() {
        let stream = stream.unwrap();

        handle_connection(stream, _window.clone());
    }
}

From here I emit events with tauris event system for each of the incomming message and handles the rest in the front end of the application.

Next, I moved on to the Vue code. Tauri has various options for front end framework, I decided with Vue.

One of the features of the Spatie Ray app that I wanted to include in my Tauri app was the ability to filter incoming requests by path or method. I implemented this using a combination of Vue filters and Rust functions, with the frontend making API calls to the backend to retrieve filtered data.

Overall, I found the Tauri framework to be a powerful tool for building desktop apps with web technologies. While Rust was a new language for me, I appreciated its speed, i am really impressed with the compilers error output.

If you're interested in building your own Tauri app, I recommend starting with the official Tauri documentation and tutorials. While there is a learning curve, the payoff is a desktop app that is fast, safe, and easy to build.

The finished product

I will not publish the app since it's a ripp-of from a great product.

Related articles