Build an in-memory todo app in Rust using Axum web framework

Поделиться
HTML-код
  • Опубликовано: 8 сен 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

Комментарии • 32

  • @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 9 месяцев назад +1

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

  • @skaunov_code
    @skaunov_code 11 месяцев назад +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  11 месяцев назад

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

  • @ProGamerru
    @ProGamerru 3 месяца назад +1

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

    • @lindblomdev
      @lindblomdev  2 месяца назад +1

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

    • @ProGamerru
      @ProGamerru 2 месяца назад +1

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

    • @ProGamerru
      @ProGamerru Месяц назад +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  Месяц назад +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. 😆

  • @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  2 месяца назад

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

    • @costabasil
      @costabasil 2 месяца назад

      @@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  2 месяца назад

      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.

  • @adrianstan2828
    @adrianstan2828 Год назад

    Great !

    • @lindblomdev
      @lindblomdev  Год назад

      Glad you found it interesting 🙏

  • @DavidSmith-ef4eh
    @DavidSmith-ef4eh 8 месяцев назад

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

    • @kai-.-man
      @kai-.-man Месяц назад

      SeaORM, or SQLX (not orm)

    • @lindblomdev
      @lindblomdev  Месяц назад +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.

  • @classyboy2000
    @classyboy2000 9 месяцев назад +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  2 месяца назад

      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.

  • @s.joseph406
    @s.joseph406 10 месяцев назад

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

    • @lindblomdev
      @lindblomdev  2 месяца назад

      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 👊

  • @user-of6ls2ng5l
    @user-of6ls2ng5l 7 месяцев назад

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

    • @lindblomdev
      @lindblomdev  6 месяцев назад

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

  • @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 10 месяцев назад +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 10 месяцев назад

      rtard stick to the basics and go program in scratch

    • @lindblomdev
      @lindblomdev  2 месяца назад +1

      thanks for the back up 😆👊