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

ความคิดเห็น • 33

  • @r2_rho
    @r2_rho ปีที่แล้ว +2

    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.

  • @ryandsouza2962
    @ryandsouza2962 ปีที่แล้ว +1

    Great vid! Axum is an amazing framework to build API's in Rust! Waiting for the Postgres vid :)

    • @lindblomdev
      @lindblomdev  4 หลายเดือนก่อน +1

      Any day now 🙈

  • @skaunov_code
    @skaunov_code ปีที่แล้ว +1

    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`.

    • @lindblomdev
      @lindblomdev  ปีที่แล้ว

      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. 👊

  • @adrianstan2828
    @adrianstan2828 ปีที่แล้ว

    Great !

    • @lindblomdev
      @lindblomdev  ปีที่แล้ว

      Glad you found it interesting 🙏

  • @costabasil
    @costabasil ปีที่แล้ว

    Can hardly wait for the next video with Postgres!! I really appreciate the level of details and explanations for various things

    • @lindblomdev
      @lindblomdev  4 หลายเดือนก่อน

      I know it's late, but it's coming very very soon.

    • @costabasil
      @costabasil 4 หลายเดือนก่อน

      @@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.

    • @lindblomdev
      @lindblomdev  4 หลายเดือนก่อน

      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.

  • @ProGamerru
    @ProGamerru 5 หลายเดือนก่อน +1

    Great video. I'd like to see a video about authorization and authentication

    • @lindblomdev
      @lindblomdev  4 หลายเดือนก่อน +1

      Thanks. I will add users to the todo app in an upcoming video.

    • @ProGamerru
      @ProGamerru 4 หลายเดือนก่อน +1

      ​@@lindblomdev Thank you. This is exactly what I'm designing now

    • @ProGamerru
      @ProGamerru 3 หลายเดือนก่อน +1

      @@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.

    • @lindblomdev
      @lindblomdev  3 หลายเดือนก่อน +1

      @@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. 😆

  • @DavidSmith-ef4eh
    @DavidSmith-ef4eh 10 หลายเดือนก่อน

    Can you do a diesel (or if there is an better ORM for rust) tutorial?

    • @kai-.-man
      @kai-.-man 4 หลายเดือนก่อน

      SeaORM, or SQLX (not orm)

    • @lindblomdev
      @lindblomdev  4 หลายเดือนก่อน +1

      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.

  • @s.joseph406
    @s.joseph406 ปีที่แล้ว

    Hi, kindly compare actix and axum, what is the difference and which is better

    • @lindblomdev
      @lindblomdev  4 หลายเดือนก่อน

      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 👊

  • @ИванРагозин-я8я
    @ИванРагозин-я8я 9 หลายเดือนก่อน

    I think releasing videos like this without a link to the github = crime

    • @lindblomdev
      @lindblomdev  9 หลายเดือนก่อน

      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. 😶‍🌫️

  • @classyboy2000
    @classyboy2000 11 หลายเดือนก่อน +3

    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....

    • @lindblomdev
      @lindblomdev  4 หลายเดือนก่อน

      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.

  • @khanra17
    @khanra17 ปีที่แล้ว

    boring af

    • @lindblomdev
      @lindblomdev  ปีที่แล้ว +1

      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.

    • @kolakup7672
      @kolakup7672 ปีที่แล้ว +3

      @@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.

    • @kolakup7672
      @kolakup7672 ปีที่แล้ว

      rtard stick to the basics and go program in scratch

    • @lindblomdev
      @lindblomdev  4 หลายเดือนก่อน +1

      thanks for the back up 😆👊

    • @boscodsouza5087
      @boscodsouza5087 21 วันที่ผ่านมา

      Definitely not boring.