Build an in-memory todo app in Rust using Axum web framework
ฝัง
- เผยแพร่เมื่อ 21 พ.ย. 2024
- We will be building a to-do web application in Rust using the Axum web framework. In Rust, Axum is one of the most popular web frameworks of 2023.
While building this rust/axum web application we will come across some Rust hurdles that we will need to tackle.
Here is a list of some of the things we will learn in this video (while building the app):
Rust module system which will help us with how to structure axum rust folders
Why use Rust Mutex
Why use Rust RwLock
What is the difference between Rust standard Mutex/RwLock and Tokio Mutex/RwLock
This video is belonging to a rust web development crash course: • Rust Web Development C...
(its NOT required to see all videos, its just that somethings might not be explained, as they might have been explained earlier in the series).
Chapter list:'
00:34 - Build the Vue composable
05:44 - Build the Vue view
08:03 - Correct an issue from last video (where I used npm by misstake)
09:24 - Intro to Rust modules
13:45 - Making the state submodule
20:00 - Making the routes submodule
29:30 - Rust Mutex and RwLock
32:00 - Axum path extractor
33:01 - Making the in_memory module
33:45 - Hook up routes
As usual, here is a friend link to read the article this video is based on over at medium, for free: medium.com/@li...
#rustlang #webdevelopment #crashcourse #tutorial #vuejs #axum #rustprogramming #rustapi
Dont listen to the haters, this was excellently done. I particularly appreciate your level of detail explaining the refactor needed when incorporating Arc and Mutex, and the explanation of Tokio Mutex vs Std Mutex was super helpful.
Great vid! Axum is an amazing framework to build API's in Rust! Waiting for the Postgres vid :)
Any day now 🙈
That's a nice one!
I personally had two problems along.
Couldn't get past CORS with SSH VS Code ports autoforwarding.
And had to add `let id = state.get_id();` to `create_todo` before `.write()` and make `state` `mut`.
Damit! I just keep messing up 🙈 next video will not have any issues like these 🤞and i will also provide git repo link along wirh next video for people who want that.
Thanks for adding your fix here as a comment. 👊
Can hardly wait for the next video with Postgres!! I really appreciate the level of details and explanations for various things
I know it's late, but it's coming very very soon.
@@lindblomdev It is indeed too late for me 🙂 I moved away from rust! Sorry, I found it horrible to program in, and I moved back to scala. I wanted to see what the fuss is about and I guess I know now. The emperor has no cloths.
haha :D i havent used anything that makes me question my decision to use the tech as rust. "why am i using a systems programming language to build web apis?" has come up a lot. My answer to myself every time is "skill issue". With more experience it should be smoother. With that said, i still make my living writing C# and JS/TS. As for Scala, i only looked at the play framwork a long time ago, but never actually used it, heard good things though.
Great !
Glad you found it interesting 🙏
Great video. I'd like to see a video about authorization and authentication
Thanks. I will add users to the todo app in an upcoming video.
@@lindblomdev Thank you. This is exactly what I'm designing now
@@lindblomdev It's so cool that you're answering. I came to the conclusion that it's convenient to put authorization for a separate service. If something goes wrong, just restart the authorization server. And the balancer will be able to connect already authorized users to the API servers without downtime.
@@ProGamerru yeah i like to put auth in its own service for another reason too. That its an endpoint that is different than the rest of the app, and its computationally heavy. If someone finds a way to exploit that, its nice if only the auth service goes down and not the whole app. 😆
Can you do a diesel (or if there is an better ORM for rust) tutorial?
SeaORM, or SQLX (not orm)
I don't think I'm a good person to do that right now, as I don't use it. There should be lots of content on diesel, as it was the biggest one for a very long time.
Hi, kindly compare actix and axum, what is the difference and which is better
i think that is for someone else to do, as i havent used actix. When i looked it, it didnt use async/await (as it wasnt in Rust stable at the time), same goes for Diesel. With that said, i think if you just look at come code examples, you can see which is more inline with how you think. And switching cost is pretty low, so just pick one and build whatever you want to build, just start and it will be fine 👊
No setup? No GH repo link? Am I taking crazy pills? You just start the video in your project with ~dozens of files and no explanations. I must me missing something....
It's supposed to be a series. There should be a Playlist, will look over the descriptions to make sure in the coming days. Also add github links.
I think releasing videos like this without a link to the github = crime
Yes. That's why I haven't uploaded any videos as of late. Laying low, avoiding 5-0 until I get my video mirror repo up and in order. 😶🌫️
boring af
That is honest and valid feedback. Did you watch it all the way through? If not, where did you stop? Do you have an example of someone doing a similar thing, but not boring af? If so, please share, it doesn't need to be in the same topic.
If you have trouble pasting in a link, just give the channel and video title and can find it.
@@lindblomdev No its not valid feedback. Please ignore morons. Thank you for your hard work. I wish to see content from you every day on axum. Thank you again.
rtard stick to the basics and go program in scratch
thanks for the back up 😆👊
Definitely not boring.