Which is the Rust friendly tech stack?

Hello, I am really curious about Rust and I think that the best way to learn it is to create a small side project in my free time. Nothing too complicated. Nothing too simple. A small authorization, authentication and user role management project seems to be the perfect candidate. Whatever I do in the future will certainly need authorization, authentication & user role management.

What would be the proffered tech stack for such application? At first I want to start really simple with a monolithic service. So basically I will have some front-end (react) app that needs a REST API. JWT authentication. Some NoSQL db. Cache. At later stages I will decompose the monolith to smaller services (aka micro services) so I will also need some RPC for the communication between the microservices. I do not have a use-case for message broker yet but any recommendations would be greatly appreciated. I plan to host everything in AWS so any recommendations there are also welcome!

I have around 5 years of experience with C#, and around 5 years of experience with Java. Before that in school I started programming with C++ but my knowledge there is very limited. I am really curious to compare the whole Rust vs Java development experience!

1 Like

In Rust, there's no batteries-included web framework; you'll need to stitch the different parts of your web app yourself.

That being said, I recommend you to look into the most popular web server libraries in Rust which are Actix-web and Axum for setting up the foundation of your application.

2 Likes

As @moy2010 said, all the pieces are there, but you'll need to put them together yourself.

Axum is a good option for a web application framework. An alternative I've come across recently is poem, and when used with poem-openapi it can even automatically create openapi documentation for you.

For database access, you could use sqlx. This works with multiple databases, you could start with SQLite.

For password hashing, there's argon2

You can even write the web frontend in rust using something like leptos or yew, though this is more bleeding edge than other areas of rust.

I'll note that this is decent as a learning exercise, but user authentication has a lot of pitfalls, and for a personal project I would use an open source identity provider like keycloak to do all the heavy lifting for me, and just use the openidconnect library in my own code.

2 Likes