Luca Palmieri writes about Rust web development, observability, authentication, and Docker builds, and is the author of Zero To Production in Rust.
HN commenters recommend his articles and book for learning Rust web backends, and often find answers to their questions in his posts.
It really doesn't, actix is already there. Recently built my startup code over the past couple years with Actix and it had literally everything we needed easily. We just need more documentation and reference code bases demonstrating how to do these things. Rust devs tend to be fairly advanced and seemingly don't write enough docs or shares.
>Routing/handlers
Actix has it.
>Templates
Minijinja or liquid-rust[1]
>Static file serving
actix-files[2]
>Logins
Actix with oidccore is fantastic and easy[3]
>Permissions
Actix FromRequest is literally perfect. We have perm levels (admin, owner) and per-route perms for more fine-grained control.[4]
> Database interface
Diesel with diesel_async for connection pooling has been flawless at scale.
> Admin tooling
We didn't do this, but it would be simple with a bin/load-data.rs file that runs via a docker start command or tmuxp pane.
> Hot reloading
Cargo watch is getting deprecated, but was great. Bacon and and Watchexec are fully qualified successors. CSS watch systems work with the templates already same way as they do for SPAs.
> Background tasks
Make a bin/worker.ts file which defines a single binary and then use redis or another queing sytem to communicate between the worker and core server. We loaded all of HN (40M docs) into a search index with this approach and it was easy.
> Monitoring/observability
There's a decent story here with structured logging. Zero to production in Rust has a good chapter on it (2020)…
I'd highly recommend reading some articles by Luca Palmieri[1], or even buying his book[2]. Although I didn't learn this stack by working through his book, whenever I had questions through the years, my searches usually led me to his articles which are often excerpts from the larger book.
The high level of API stability and lack of churn in the Actix ecosystem makes the book a particularly good investment for someone looking to settle on this stack in my opinion. In keeping with the topic of this submission, I doubt I'd be comfortable spending money on a similar book about building web apps with React.
[1]: https://www.lpalmieri.com/posts/2020-08-09-zero-to-production-3-how-to-bootstrap-a-new-rust-web-api-from-scratch
[2]: https://www.zero2prod.com
Sorry in advance for shoehorning Rust into a separate conversation...
The new meta in Rust is to lift out loggers and replace the concept with tracing. There is a `tracing` package where you can setup spans like in OpenTelemetry but it also supports the logger macros so you can attach log messages to the spans.
To consume this you add a subscriber configured at server startup to send structured logging to a Json logger, or ship them to a Jaeger endpoint. Or sentry, as suggested in the article.
https://www.lpalmieri.com/posts/2020-09-27-zero-to-production-4-are-we-observable-yet/
Author here!
This article started as a short section in Chapter 3 of Zero To Production (https://www.lpalmieri.com/posts/2020-05-24-zero-to-production-0-foreword/) to give some background on the decision making process I went through when picking the web framework we will be using to develop our email newsletter project throughout the book.
It eventually grew to be so long that it made little sense as part of Chapter 3 itself - I thus decided to publish it as its own article and link it in the introduction to Chapter 3 (hopefully to be released next week!).
Luca Palmieri[0] is trying to fill that gap with his series called "Zero to Production" in Rust that assumes the reader can solve project euler problems and is instead going to focus on "how do I build and deploy production software."
You can read the introduction[1] to the series to get a better sense.
[0] https://twitter.com/algo_luca
[1]https://www.lpalmieri.com/posts/2020-05-24-zero-to-production-0-foreword/
Also the same one who is making a new web server framework for Rust called Pavex, which is apparently pretty novel in how it works compared to others like Actix Web and Axum [0][1].
[0] https://www.lpalmieri.com/posts/a-taste-of-pavex-rust-web-framework/
[1] https://blog.logrocket.com/using-pavex-rust-web-development/