THANK YOU SO MUCH, i had been looking everywhere for a tutorial that doesn't use a stack of complex crates, finally i can write something from scratch and update gradually as i learn.
Really good low level tutorial. No routing framework. I love how you were parsing the request string to derive the route and method. We often run to the frameworks and forget whats actually going on under the covers. I like that you included the build and fix iteration process. You made it look approachable
@@francescociulla I've been going for quite a long time to stay in high-quality Rust programming language lessons, and maybe youtube brought me almost all the channels that probably have something to do with the Rust programming language 🤣 and it'd be fantastic if you have a crush course about actrix web
That's awesome sir, 😎, I am a data engineer working mostly with python and databases. I want to learn Rust. Please keep creating more videos with Rust on data related and backend stuff. Thanks in advanced 👍
this is a very good tutorial to show a low level backend development with rust. but im afraid that we can't use this on production because it lacks scalability and security. i prefer using framework for backend development.
thank you and you sould absolutely use a framework. This is more to demonstrate how you can do something you might be familiar with (building a webserver) with Rust, and also connect it to a db running inside a container.
Great tutorial thanks for sharing your skills for free. However if you don't mind a quick feedback I'm a PHP developer and I have to learn Rust due to new green project and I believe it would be great if you could slow down a litle bit to explain and do some comparaison sometime. I'm taking the time to pause and add comment to the code by search the meaning of some of those method you are using but I tough maybe you would apreciate some feedback. thanks again for your help getting better at Rust
As a rust beginner I like this a lot because of some rust concepts in a real world demo. Also the combination with the docker was new to me. Nevertheless I do not understand how the id is incremented. Any help ?
Here is small addition to your brilliant tutorial. In the Postman you can create Rest API methods right from template. "+" -> Collection template -> RESTful API basics and then you have your 4 method for CRUD. Next small addition - you can send random "name" and "email" using helpers: ```{ "name": "{{$randomFirstName}}", "email": "{{$randomEmail}}" }```
I keep getting the following error when i run docker compose build: #0 71.72 error: error communicating with database: failed to lookup address information: Name or service not known. I see the container when i run docker ps -a
@@francescociulla so I copied the docker-compose and docker file from your github and updated it to run my binary. When I am in psql i can see the database postgres is this is what is the last term in the database_url?
@@johnwilliams7999 can you try to run my whole project instead and see if that works, following the step by step procedure? Copy pastying the dockerfile in your project I don't think it will make it work automatically. Let me know
@@francescociulla I have my own api I created with axum and postgres is all working even deployed on render. I'm following along because of the docker stuff asim thinking of maybe trying to deploy on cludflare, but I can try out ur project later.
@@johnwilliams7999 it says name or service not know. You should start from there and understand from the context what is the name it's searching for. Good luck, there is not much rust docker material on TH-cam
@@francescociulla oof i meant to post the comment in the other video...any comment? th-cam.com/video/N-7uYm1PszM/w-d-xo.html And do you cover any best practices or enterprise level projects?
i've a serious query to ask. since, you have set the context (as .) in the build section of the rustapp service inside docker-compose.yml, then why do we even need image for that service (rustapp) explicitly inside docker-compose.yml? i mean, docker-compose build command would try to find the Dockerfile out in the specified context and image building process would be started for that service (rustapp). so we'll have our image (for rustapp) built from the Dockerfile itself. Do we even need that extra image tag for rustapp? services: rustapp: image: rust:tag build: context: . args: shouldn't we remove that image section from here?
Hi Ranitbiswas6278 You raise an interesting point. The image section in the docker-compose.yml file indeed seems redundant if the Dockerfile is already specified in the build section. In this scenario, when you run docker-compose build, Docker automatically builds an image based on the Dockerfile in the specified context. The image section is typically used to specify a pre-built image that Docker should use instead of building from a Dockerfile. So, if you already have a pre-built image, you might not need the build section at all. However, if you want to ensure consistency and reproducibility by always building the image from the Dockerfile, then keeping the build section makes sense. Removing the image section won't affect the functionality, but it might clarify the intention of always building from the Dockerfile. Thanks point it out btw The main reason why I did that is that usually i don't use the context inside the build, but in this case I wanted to showcase an use of the "args"
@@francescociulla exactly. i was talking about this video particularly. we don't even need that image section in our rustapp service since we are already building it via Dockerfile. And please make few videos on 1. Diesel ORM, 2. Rust gRPC implementation (using Tonic), 3. Unit testing in Rust (mocking and stubbing in a simple CRUD based project) I'm very fond of your way of teaching-kind of slow but steady. i like that. Best wishes from India
i really like those crud videos, thank you for showing different ways of reaching the same target Francesco!
cheers from south america 🇧🇷
you are welcome. I featured the comment on Twitter twitter.com/FrancescoCiull4/status/1733385760093384925 . Also stay tuned for today's live stream
Thanks! To be honest, I needed only Docker and docker-compose part, but it was really nice and helpful video. God bless you.
thank you , that's the part I am focused the most! Glad you liked it!
THANK YOU SO MUCH,
i had been looking everywhere for a tutorial that doesn't use a stack of complex crates, finally i can write something from scratch and update gradually as i learn.
you are more than welcome!
it would be nice if you could turn off copilot for tutorial videos, becuase it is hard for beginners to follow along
I like this style because it makes the videos not too long. the goal is to focus on the connection on the b connection and the docker part.
Really good low level tutorial. No routing framework. I love how you were parsing the request string to derive the route and method. We often run to the frameworks and forget whats actually going on under the covers. I like that you included the build and fix iteration process. You made it look approachable
You are welcome!
cheers from Armenia, thanks for sharing this amazing tutorial
you are welcome. How did you find the channel?
@@francescociulla I've been going for quite a long time to stay in high-quality Rust programming language lessons, and maybe youtube brought me almost all the channels that probably have something to do with the Rust programming language 🤣 and it'd be fantastic if you have a crush course about actrix web
That's awesome sir, 😎, I am a data engineer working mostly with python and databases. I want to learn Rust. Please keep creating more videos with Rust on data related and backend stuff. Thanks in advanced 👍
you are welcome Sany!
Thank you! You convinced me to port my PHP CRUD classes to a Rust based service :-)
you are welcome
Great example. Maybe you can show an example with swagger included
😊
Thanks, and that's a good idea
this is a very good tutorial to show a low level backend development with rust. but im afraid that we can't use this on production because it lacks scalability and security. i prefer using framework for backend development.
thank you and you sould absolutely use a framework. This is more to demonstrate how you can do something you might be familiar with (building a webserver) with Rust, and also connect it to a db running inside a container.
I liked that architecture schema image in the video ..
Thank you so much, I changed it
Came for Rust, stayed for the accent.
you are welcome
thank you bro you made my day. please more video with topic using Rust and the framework, maybe Authentication and CRUD using Rust
that's a great idea and this is coming soon!
Thanks for the video. Maybe you can do one where you use swagger?
you are welcome. that's a good idea, thanks
Great tutorial thanks for sharing your skills for free.
However if you don't mind a quick feedback I'm a PHP developer and I have to learn Rust due to new green project and I believe it would be great if you could slow down a litle bit to explain and do some comparaison sometime.
I'm taking the time to pause and add comment to the code by search the meaning of some of those method you are using but I tough maybe you would apreciate some feedback.
thanks again for your help getting better at Rust
thanks! did you check the php crud api video? th-cam.com/users/livecdlHJeHVFW4?si=GCNnvqq6T8etiao3
i'm 3 mins in the tutorial and i already know you're a good instructor but one question what terminal do you use ?
Thank you. It's a customized git bash
Shocked more people dont use cargo-add for dependency management.
this is just an example for beginners, but of course it should be used
Rust is hard, but thank you so much sir
You are welcome. i just posted the other comment on Twitter
Every time we connect to the database for operation. DB connection should be only once?
As a rust beginner I like this a lot because of some rust concepts in a real world demo. Also the combination with the docker was new to me. Nevertheless I do not understand how the id is incremented. Any help ?
Thank you. The id is autoincrmeented by postgres, by defining it as serial primary key
Thank you for the tutorial but please what did you use in 5:11 to have the function already set and autocompleted?
Github Copilot
Well done, thank you!
What extension do you use to auto complete?
GitHub Copilot. thank you
You didn't use any backend framework like Axum. Is it better or not without framework ? and why many people use framework for crud ? Thanks a lot
The challenge here was to make it work without frameworks. i think I played with something called "rocket" or something like that
how and where do you found the dependencies versions that you typed at 1:58 ?
thank you for your share👍
it has been autocompleted by GitHub copilot and I tried them before, andd they were stable. that's it
Here is small addition to your brilliant tutorial. In the Postman you can create Rest API methods right from template. "+" -> Collection template -> RESTful API basics and then you have your 4 method for CRUD. Next small addition - you can send random "name" and "email" using helpers:
```{
"name": "{{$randomFirstName}}",
"email": "{{$randomEmail}}"
}```
Thank you Viktor, I made a tutorial on Postman with Docker but what you said it's useful
th-cam.com/video/1eeR0LoIs-M/w-d-xo.htmlsi=9DmBQCsvLx4dkisF
Very useful schema ☺
💚
Amazing , Big Thanks.
you are welcome
It feels like mario or luigi is teaching me
I try my best but my italian accent is still strong
I am new in dev can you explain which extension u r using here that vs code is suggesting code to write
It's Github Copilot
Thanks man!
you are welcome. what's your experience with Rust?
Awesome guy!
thanks!
Awesome video. Btw, which drawing web app are you using?
it's called excalidraw
I keep getting the following error when i run docker compose build:
#0 71.72 error: error communicating with database: failed to lookup address information: Name or service not known. I see the container when i run docker ps -a
maybe I should make a livestream to check this error. hard to help you with that, but maybe someone had the same issue. works for me.
@@francescociulla so I copied the docker-compose and docker file from your github and updated it to run my binary. When I am in psql i can see the database postgres is this is what is the last term in the database_url?
@@johnwilliams7999 can you try to run my whole project instead and see if that works, following the step by step procedure? Copy pastying the dockerfile in your project I don't think it will make it work automatically. Let me know
@@francescociulla I have my own api I created with axum and postgres is all working even deployed on render. I'm following along because of the docker stuff asim thinking of maybe trying to deploy on cludflare, but I can try out ur project later.
@@johnwilliams7999 it says name or service not know. You should start from there and understand from the context what is the name it's searching for. Good luck, there is not much rust docker material on TH-cam
How your vs code is suggesting what to write or not
GitHib Copilot
github copilot confused me often
all in one main file ??? brrrrrrr
just a simpleexample, fo course not a prod ready code lol
Ty
You are welcome!
CRUST API?
Exactly
nice
You are welcome Quentin
please with jwt. tq
that's a great idea, I like jwt
noice
🔥🔥
Just read the Docker documentation or learn the wrong way from this video.
You are right, this is not a production ready Dockerfile.
By the way, I'm in the official group that writes the Docker documentation 🫡
@@francescociulla oof i meant to post the comment in the other video...any comment?
th-cam.com/video/N-7uYm1PszM/w-d-xo.html
And do you cover any best practices or enterprise level projects?
Does everyone allowed to comment?
If respectful yes ofc
0:00 intro. Architecture schema. Prerequisites
1:00 Project initialization. Dependencies. Model. Constants
4:16 Main function. Utility functions. Handle client function
10:37 Controllers: Create, Read, Update, Delete
16:39 Docker: .dockerignore, Dockerfile, docker-compose.yml
22:09 Run Postgres, container. Docker compose build (Bug fixing). Run Rust app container
26:15 Test: Postman, TablePlus, docker exec.
i've a serious query to ask.
since, you have set the context (as .) in the build section of the rustapp service inside docker-compose.yml, then why do we even need image for that service (rustapp) explicitly inside docker-compose.yml?
i mean, docker-compose build command would try to find the Dockerfile out in the specified context and image building process would be started for that service (rustapp). so we'll have our image (for rustapp) built from the Dockerfile itself.
Do we even need that extra image tag for rustapp?
services:
rustapp:
image: rust:tag
build:
context: .
args:
shouldn't we remove that image section from here?
Hi Ranitbiswas6278
You raise an interesting point. The image section in the docker-compose.yml file indeed seems redundant if the Dockerfile is already specified in the build section. In this scenario, when you run docker-compose build, Docker automatically builds an image based on the Dockerfile in the specified context.
The image section is typically used to specify a pre-built image that Docker should use instead of building from a Dockerfile. So, if you already have a pre-built image, you might not need the build section at all. However, if you want to ensure consistency and reproducibility by always building the image from the Dockerfile, then keeping the build section makes sense.
Removing the image section won't affect the functionality, but it might clarify the intention of always building from the Dockerfile. Thanks point it out btw
The main reason why I did that is that usually i don't use the context inside the build, but in this case I wanted to showcase an use of the "args"
@@francescociulla exactly. i was talking about this video particularly. we don't even need that image section in our rustapp service since we are already building it via Dockerfile.
And please make few videos on
1. Diesel ORM,
2. Rust gRPC implementation (using Tonic),
3. Unit testing in Rust (mocking and stubbing in a simple CRUD based project)
I'm very fond of your way of teaching-kind of slow but steady. i like that.
Best wishes from India
@@ranitbiswas6278 i am going live in 10 mins and I can answer this live