What #axum tutorials do I want to check out for a full app using #tailwind with #daisyui and maybe even #datastar
@pointlessone @rayk @tomekw I'm afraid you have biased view. There are two angles to the "web frameworks".
1. #Axum and #Rails don't even play the same sport, the former's performace comes at cost of orders of magnitude more complex implementation; it was never intended to be #Django in #Rust
2. The fact we have web frameworks in Rust is "an accident", the language was never intended to specifically write ones. Rust is a proper system programming language, the same class as C (not #Go w/GC).
Built a full-stack Rust web app entirely with Claude Code. Claude wrote all the code, I just directed the features, architecture and tech.
Stack:
- Axum with async-graphql API
- Dioxus WASM frontend
- ReDB database
It's an artillery calculator for the game Foxhole — place markers on maps, get firing solutions with wind compensation.
Feel free to check it out: https://arty.dp42.dev
Source code on my github
#Rust #WASM #Dioxus #Axum #AI #ClaudeCode #OpenSource #GameDev
* looks at the repo of a rust template
* clicks at the maintainers name
* clicks a link on his profiles
Huh? "Coaching for your Daddy Phase"?
[Перевод] Гексагональная архитектура в Rust: отвязываем бизнес-логику от Solana
Представьте: вы строите сервис выдачи дипломов на Solana. Всё отлично, пока дело не доходит до тестов. Внезапно оказывается, что для проверки бизнес-логики нужно поднимать валидатор, искать тестовые токены и молиться на стабильность сети. Знакомая боль? В этой статье я покажу, как мы решили проблему, используя async-trait и dyn Trait. Мы превратили интеграционные тесты длиной в минуты в юнит-тесты, которые проходят за миллисекунды. Узнать решение
https://habr.com/ru/articles/983874/
#rust #solana #гексагональная_архитектура #блокчейн #unittesting #dependency_injection #axum #web3 #mocking #refactoring
A bonus entry: error handling.
This is more of a Rust thing, not specific to Axum. So Rust has no exceptions. Instead rust has a Result type that can be either a "good" return value or an "error”.
My fellow Rubyists probably know of this concept from other languages or maybe you’ve encountered Railway-Oriented Programming pattern (it resurfaces once in a while, here's a recent one: https://www.alchemists.io/articles/railway_pattern ).
Anyway, one quirk is that since it's just a normal value, it doesn't have a backtrace attached to it. It can bubble up all the way to the main function and you wouldn't be any wiser where it came from.
Another “inconvenience” is that Result<T, E> is generic but it also means that every concrete variant of both parameter types yields a completely separate type. There's no inheritance, you have to specifically address every instance of the Result type. Where in Ruby you can handle all exceptions by catching StandardError, you can't do that in Rust.
The idiomatic solution is to have your own error type that wraps other error types and implement conversion from those error types to your own error type.
There are a few crates (packages, like gems) that try to address various aspects of this. I settled on rootcause which sorts out the backtrace deficiency. It allows for even more reach contexts attached to the errors. This is even better than in Ruby. It's always obvious in Rust where you can potentially get an error so it’s easy to provide relevant context.
However it only partially addresses the multitude of errors issue. I still had to implement my own error type to wrap around rootcause's Report because Rust doesn't allow to implement external traits (like Axum's IntoResponse) for external types (like, rootcause's Report). So in order for my handlers to be able to return proper Results that Axum could turn into responses I have to have this intermediate glue type.
But it let me have error pages with backtraces like in Rails, which is neat. But again, it's not a built-in feature, it's something I had to build myself.
I suspect there's nothing like errbit/sentry/rollbar. What do people use to catch failures in production? Anything for monitoring, metrics?