Full Stack Rust Webapp + Docker Image Build

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.ย. 2024

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

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

    dude your organizational skills are outstanding, every reference on description with all explained in the video. I must say I need nothing more to use rust in my freelance right now

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

      thank you for the kind words! are you clients generally open to using Rust?

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

    You're missing .dockerignore file to ignore the locally built binaries 😉 it shall speed up the docker build a bit as it will minimize the docker context to be copied.

    • @codetothemoon
      @codetothemoon  ปีที่แล้ว +12

      oh nice thanks for pointing this out Marek!

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

      And reduce layer cache invalidation.
      Though it can be faster to cross compile to the container target outside the container.

  • @Mustafa-099
    @Mustafa-099 ปีที่แล้ว +6

    The smooth animation and the way everything is explained makes watching your content such a fun experience!
    Thank you so much for this awesomeness sir :)

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

      thanks for the kind words, really happy you got something out of the video!

  • @martinbecker1069
    @martinbecker1069 ปีที่แล้ว +8

    I realise this is an old-ish video but FYI, you can use multi-step builds to have a docker image that contains none of the build dependencies, this would reduce the size of the final image. That said this was an interesting video, very informative!

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

      ... that's exactly what he does in the video?

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

      @@dratir You're right, I'm used to seeing all 'From's finish with an 'AS something' which provides a build target. Because of that It didn't look to me like a multi-step build to me, re-watching clarified that.

  • @Kodlak15
    @Kodlak15 ปีที่แล้ว +6

    Your videos are outstanding. Thank you so much for the time and effort you have invested into them.

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

      Thanks Cody! Glad you're getting some value out of them 😎

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

    I don't know if this video covers it - but please release some kind of video targeting authentication, especially with OAuth and OIDC. That's been something that's been a pain in my backside for way too long, and your videos are really high quality.

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

      It doesn’t - and I do plan to make one on auth. I began researching but kept running into snags - seems like this is definitely a pain point for the community.

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

      @@codetothemoon would it be easier to use something like Auth0? I’m very new to it but it seems like it can plug into anything

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

      Just store the usernames and passwords in plaintext in your database. It’s pretty simple lol

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

    Good video - it would be nice if you had one for debugging the backend awa frontend while they are in Docker i.e. the host is not used to compile but the dev container is, and from there push to prod after solving the bug(s)

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

      thanks, and good idea, maybe I'll cover that!

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

    so glad i found this channel! so much info!

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

      So glad to have you onboard Eran!

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

    It would be great with CI/CD follow up

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

      nice yeah i'd love to do that, I'm actually currently looking into Railway, where apparently you can just point it to a GitHub repo with a Dockerfile and it takes care of the entire build and deployment for you (amazing). Then you can customize with Github Actions if needed. Will report back after I try it!

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

    I've been watching your videos recently, I really like them. Very nice, clear, concise explanations. Keep it up, man! :)

  • @amirnoorani5017
    @amirnoorani5017 10 หลายเดือนก่อน

    That was awesome! Could you show us how to deploy it to Github pages

  • @Baron-digit
    @Baron-digit 10 หลายเดือนก่อน

    Really helpful!
    Do you already have the deployment video?
    Maybe to additional questions:
    For changes to the app, what would be your process? (automation?)
    What would you recommend for a platform development?

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

    Friend, your content is fantastic. Thank tou 👍👍👊👊👊

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

      thank you and thanks for watching!

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

    Yew is a fantastic framework.

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

      I agree!

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

      I like it a lot, too, but I have a hard time justifying its use in a world where Svelte exists. Svelte is both faster and easier to use. Still, I love Rust and am hopeful we’ll get something similarly simple in the future.

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

    I'd like to see github actions actually

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

      Nice, I'll put this on the roadmap!

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

    soft would be the sun... Or maybe the earth? Fuck nvm. Point is I can't thank you enoughfor these tutorials. I've been playing guitar for

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

    Very nicely done Sir!

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

      Thanks Iron Hammer, glad you found it valuable!

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

    Why do we need Docker when we can compile to a self-dependant binary?

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

      I think one of the appealing aspects of Docker that is still relevant even when dependencies and portability aren't issues, as in the scenario you refer to - is "sandboxing" - ensuring that one application won't affect others that might be running on the same physical machine

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

    super incredible video

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

      Thanks so much for the kind words!

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

    Thanks, very helpful!

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

      Nice, very happy you found it valuable!

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

    Great video!. I really like it

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      Thanks for the kind words and thanks for watching!

  • @adela.k5463
    @adela.k5463 2 ปีที่แล้ว +2

    maybe show us how to deploy it to AWS Fargate?

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

      Yeah that's something I could definitely do, I've added it to the video idea list. Thanks!

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

    does rust have a future in backend development?

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

      I'm fairly confident that it does, but we will see! 😎

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

    Thank u so much. I've been so confused, but tNice tutorials video helped a lot.

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

    there is nothing to install in `wasm-bindgen v0.2.81`, because it has no binaries
    `cargo install` is only for installing programs, and can't be used with libraries.

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      thanks yeah I think I made a mistake here, I think I was looking at the Yew getting started instructions which references `cargo install wasm-bindgen-cli`, thought I'm not even sure if that is necessary anymore.

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

    Can you please create vscode devcontainer too? This is very cool, makes me excited about webdev again

    • @codetothemoon
      @codetothemoon  2 ปีที่แล้ว

      thanks for putting these on my radar - i'll take a look!

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

    Great content…
    Do we need an EC2 instance separately to run the docker on AWS?

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

      I’d recommend trying ECS / ECR for deploying Docker images. EKS should work too but I’ve never used it.

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

    When I create a new project, all I get is a "Hello, world!" function. Could you show how to set up the project so that I can also follow along all that code you have which I don't have?

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

      Hi Mathias - there are two other videos that are sort of prerequisites to this one - "Build A Rust Frontend" and "Build A Rust Backend", both on my channel. Check those out and let me know if you have any questions!

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

    How different would this be for a multi page application? Great video

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

      Thanks! I think if you have separate pages served from separate files, instead of SPA you'd probably use actix_files and specify each file as a service (or maybe an entire directory). But it's important to note that SPA doesn't necessarily mean your entire app is "one page" or even that all of your source comes from one file. Modern frontend frameworks like Yew, React, Angular etc generally handle page navigation by making it appear to the browser that the user is staying on the same page for their entire session. But under the hood the "single page" is making AJAX requests to the server to replace the page contents with a different page.

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

    Did you make a separate video for the task manager?

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

      I didn't, was planning on iterating on it from video to video but sort of left it hanging after this one. Is that something you'd be interested in seeing?

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

      @@codetothemoon absolutely, thank you for the quality content !

  • @gamer-gw9iy
    @gamer-gw9iy 2 ปีที่แล้ว +3

    How would you implement tests into this?

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

      good question - i think each package would have unit tests, then there would be a separate package with Cypress tests for E2E

  • @RVLexicon
    @RVLexicon 7 หลายเดือนก่อน

    Github Actions

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

    ☹️ p̲r̲o̲m̲o̲s̲m̲

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

    No serious frontend application could be built with rust. Building a frontend app with Yew must be like going back a decade and a half or more in frontend technology to the early days of php. You must be a serious masochist to want to do that to yourself.

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

      You are right to a certain extent as of now, yes the rust front end is still not mature as the js front ends, but to balance the entire pros and cons, there are benefits, i.e. WASM, and unified code for both the back end and front end. throughout a couple of years, I believe rust will be the master for both the front and back ends, especially with WASM shining. even in embedded, it is going great even with esp32 which needs C/C++, now you can develop with rust and the vendor is investing in rust.
      For me what I gain, is more than what I lose when I use rust for full-stack development.

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

    Does anybody else keep getting "No such file or directory (os error 2)". Cant use sudo cargo run so I'm doing cargo build and sudo ./target/debug/backend

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

      You need to run the executable from the backend directory to avoid the error turns out. Only for people who cant sudo cargo run.

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

      nice glad you got it sorted out!