Fullstack Rust with Dioxus
By Anders C. Sørby
- 3 minutes read - 606 wordsIs Rust suitable for developing fullstack apps? After attending RustConf 2025, I decided to try out the partially unfinished framework Dioxus, which promises to be able to create fullstack apps for web, desktop, and mobile using pure Rust code. Rust has the advantage of being a compiled language that does not use garbage collection and is memory-safe. The ambition is to have a language that is not only the best in terms of performance, but also ergonomic, user-friendly, type-safe, and, not least, memory-safe. More and more people are convinced that Rust has achieved this, and Rust is being embraced by large tech companies and is set to replace the role of C/C++. The Linux kernel and Windows have also begun to integrate Rust to an increasing extent. And more and more organizations, such as the NSA, are recommending that existing code be rewritten in memory-safe languages such as Rust.
Frameworks such as Next.js also offer full stack written in the same code base with JavaScript or TypeScript. In other words, typical front-end languages are used for back-end. Dioxus takes the opposite approach and uses a low-level back-end language for front-end.
But is Rust really suitable for front-end?
When you have a lot of low-level features such as borrowing, ownership, explicit cloning, and lifetimes, it can get in the way of developing efficiently, maintainably, and readably. Surprisingly, my conclusion is that this is not a big problem. Rust forces the developer to make informed choices about resource usage, which leads to better code. In Dioxus, you rarely need to think about these more complicated parts of the language, and there are simple macros that do the heavy lifting so that the code remains light and concise.
Dioxus draws a lot of inspiration from React. Function names, patterns, and methodology will be familiar to those who have worked with React before. As in React, the UI is built from components that handle their own state. A component is just that. The rsx macro replaces React’s JSX syntax. It supports the necessary markup, if and for statements.
Dioxus first generates the page on the backend (SSR) before sending it to the client. Subsequent updates to the UI are then made via the same Rust code compiled to Web Assembly running in the browser. For mobile and desktop platforms, this happens natively.
Server functions are first-class within the code and are translated into HTTP calls in the background where objects are serialized and deserialized as JSON. The server and frontend are compiled from the same codebase, and functions that can only run in the backend, such as database and authentication, are separated using the “feature” function in Rust. This makes it very easy to set up an app without having to paste together lots of boilerplate code.
Dioxus’s own tool supports hot reloading and fast builds, giving you the same developer flow you are used to from other frameworks.
Rust’s error messages can be scary at first, but they often come with a suggestion on what to do to fix the error.
As a database, I tried out SurrealDB, which supports everything you could want and more. Among other things, you get relations, graphs, time series, documents, schema-less and schema-driven in one and the same database. This made it easy to get started with developing the app without having to spend time setting up migrations and tables.
Conclusion
Dioxus seems like a promising framework, but I wouldn’t bet too much on it until version 1.0 is released. However, it could also be the start of a new era in app development, where Rust becomes the obvious choice for full-stack development.