The FREE source code is now available on GitHub here at github.com/WhiteSponge/rust_backend ! Have fun with it! Also some useful links here: Actix Web: actix.rs/ SurrealDB: surrealdb.com/
This was amazing, sir! A Leptos + Axum + SurrealDB tutorial would be really helpful, too. Questions: 1) Connecting to SurrealDB, why did you not use any of the boilerplate code provided by SurrealDB on their Rust SDK page? Where did the database connection code you use come from? 2) I'm still foggy concerning the context in which I should use SurrealQL, because you did not use any SurrealQL to interact with the database. Maybe only when using a custom advanced query? Also, I think it would be helpful for the learners if you took 30 seconds every now and then to explain more uncommon lines of code and why you chose to write it in such a way as opposed to.... "this is how you do it....and it works!" , and then move on to the next task.
Hey there! Thanks for your kind words! Leptos does indeed sound like an awesome idea! Regarding your questions: 1) It was some time back but there were some bugs caused by the boilerplate code lol. The latest versions of SurrealDB might have already fixed it but I haven't gone back to test that out yet 2) Personally I feel that it depends on your use case. SurrealQL can be useful if you're using something more complex (like what you have mentioned) Ahahaha thanks for the feedback! I always thought that I was blabbering for too long so I only tried to explain some lines of code but not everything :X Good to know that some people do appreciate it ahahahaha Thanks you're awesome :D
Very helpful tutorial. Thank you. Can please do tutorial on WebTransport using rust backend, and frontend with Tokio auxm please? Need one in-depth tutorial like this one for me like beginners to learn rust. Cheers
What would be the best Front-End Framework to mix with Rust in the Backend? Do you have any videos on that, e.g. a React or Next.js App, Web Assembly, whatever, being served by a Rust Backend? Thanks.
I would say go with the front-end framework that you are most familiar with (i.e you can build faster with it). For myself personally usually (at least for now) I would just go with SolidJS :D
@@bluewave3050, yeah, I found that in my research as well🤔 I also ended up looking at Axum as well for the API-ish thingy. But bro, when it comes to the frontend stuff, it's so.. I don't know😂 Sometimes the integration doesn't work well, sometimes the framework is too hard to get started with, sometimes the deployment wouldn't work as I'd like it to, and so on. Coming from C, C++ and lower, UI stuff is just so complicated haha. I always saw people talking about Web Dev in the /r/learnprogramming and thought it was because it was easy haha. It seems like it's because of Jobs. Idk. I even picked up some React in the past few days, just by looking into this😂. I'm now deciding a scope, and will make it as tiny as possible, just so I can get something done. If HTMX suffices, then amazing. I'm yet to look into SolidJS - it sorta displays a different approach compared to ReactJS, as far as I could see.
@@WhiteSponge a full course will be great ,as very few ppl have made it in yt,please ,take your time and for fullstack rustlanf webdev,it will be helpful liek this video,thanks
Have difficulties with Client connecting to DB. I do get Error: Os { code:48, kind: AddrInUse, message: “Address already in use” } error. I am on a Mac. Running surrealdb server on port 8000 and server is on 8080 when I try to connect SurrealDB for the first time. When I restart my machine it’s all good. What could be issue
@@VikramBhaskaran hello! Usually that happens when already have something running and occupying the same port number. And when you restart your machine, they are no longer using that port, hence why the error goes away. Try changing either Actix Web or SurrealDB to run on something like port 5000 instead and the other on port 8000
I'm trying to use the automatically created record ID from SurrealDB, but can't find a way to also reuse my model (in your case Pizza) for create_model and get_models. Was this the reason for why you initialize Pizza with your own uuid? Do you know a solution for my problem?
hello! for re-using models are you referring to getting/searching the result from the surrealdb? If so yea that's 1 of the reason(s) why I did it with my own uuid lol
I haven't tried Axum but Actix Web does have better documentation though. Both run on top of Tokio too so they are more or less similar. For now I would say Actix Web lol
hey @@WhiteSponge, it me again, i want to ask you about is it faster to use sveltekit (frontend) with actix+surealdb (backend) or just use sveltekit + surealdb? Because i showed that surealdb have sdk for js? if just crud database?
@@funnynews341 hey! How have you been doing? I would say go with the method you are most familiar for speed of development. If you're more familiar with SvelteKit, definitely go with that. And yes SurrealDB does have a JS version 😂
The FREE source code is now available on GitHub here at github.com/WhiteSponge/rust_backend ! Have fun with it!
Also some useful links here:
Actix Web: actix.rs/
SurrealDB: surrealdb.com/
still working youre a legend
hahah hope it was helpful!
great tutorial! really enjoying it so far!
Haha thanks for your kind words! Hope it was helpful and I'm working on the next tutorial too!
Need more and more tutorials like this
Hahah we will have more for sure!
Subbed, will be sure to watch more in my journey into learning Rust, thanks.
Thank you! Hope it was helpful 😀
This was amazing, sir! A Leptos + Axum + SurrealDB tutorial would be really helpful, too.
Questions:
1) Connecting to SurrealDB, why did you not use any of the boilerplate code provided by SurrealDB on their Rust SDK page? Where did the database connection code you use come from?
2) I'm still foggy concerning the context in which I should use SurrealQL, because you did not use any SurrealQL to interact with the database. Maybe only when using a custom advanced query?
Also, I think it would be helpful for the learners if you took 30 seconds every now and then to explain more uncommon lines of code and why you chose to write it in such a way as opposed to.... "this is how you do it....and it works!" , and then move on to the next task.
Hey there! Thanks for your kind words!
Leptos does indeed sound like an awesome idea!
Regarding your questions:
1) It was some time back but there were some bugs caused by the boilerplate code lol. The latest versions of SurrealDB might have already fixed it but I haven't gone back to test that out yet
2) Personally I feel that it depends on your use case. SurrealQL can be useful if you're using something more complex (like what you have mentioned)
Ahahaha thanks for the feedback! I always thought that I was blabbering for too long so I only tried to explain some lines of code but not everything :X
Good to know that some people do appreciate it ahahahaha
Thanks you're awesome :D
Great video, would be nice to have a part about deploying such application
Thanks for great video! 🚀
Haha thanks for being awesome!
this is cool, please continue
Hope you enjoyed it!
This is not enough please make more stuff like this.
Hahaha for sure!
Thank you!
Hope it was helpful 😀
Please make a video about how method chaining is implemented in Rust, as in the example of the HttpServer.
Google rust builder pattern. theres alot of resources explaining how to do it
Very helpful tutorial. Thank you. Can please do tutorial on WebTransport using rust backend, and frontend with Tokio auxm please? Need one in-depth tutorial like this one for me like beginners to learn rust. Cheers
Thanks for your kind words! Ohhh that sounds like an interesting topic for a video 🤔
Really instructive video thx so much. What extensions do you use in vim?
Hey thanks too! Haha I'm using Helix here not vim lol
What would be the best Front-End Framework to mix with Rust in the Backend?
Do you have any videos on that, e.g. a React or Next.js App, Web Assembly, whatever, being served by a Rust Backend?
Thanks.
I would say go with the front-end framework that you are most familiar with (i.e you can build faster with it).
For myself personally usually (at least for now) I would just go with SolidJS :D
@@bluewave3050, yeah, I found that in my research as well🤔
I also ended up looking at Axum as well for the API-ish thingy.
But bro, when it comes to the frontend stuff, it's so.. I don't know😂
Sometimes the integration doesn't work well, sometimes the framework is too hard to get started with, sometimes the deployment wouldn't work as I'd like it to, and so on.
Coming from C, C++ and lower, UI stuff is just so complicated haha. I always saw people talking about Web Dev in the /r/learnprogramming and thought it was because it was easy haha.
It seems like it's because of Jobs. Idk.
I even picked up some React in the past few days, just by looking into this😂.
I'm now deciding a scope, and will make it as tiny as possible, just so I can get something done. If HTMX suffices, then amazing. I'm yet to look into SolidJS - it sorta displays a different approach compared to ReactJS, as far as I could see.
@@bluewave3050 haha for sure!
can u make a full backend course in rustlang please mate,thanks for tutorial
haha hope it was helpful! A full course huh? That might be a good idea let me consider it first :D
@@WhiteSponge a full course will be great ,as very few ppl have made it in yt,please ,take your time and for fullstack rustlanf webdev,it will be helpful liek this video,thanks
Right? Right. Right!
I know right 😂
Does this have CORS enabled for fetching data from a react front end for example?
Yes it does! Check out the actix-cors crate!
What are your thoughts about helix? Is it ready for web development?
Yes only if you are ok with it having no plugins at the moment lol
Have difficulties with Client connecting to DB. I do get Error: Os { code:48, kind: AddrInUse, message: “Address already in use” } error. I am on a Mac. Running surrealdb server on port 8000 and server is on 8080 when I try to connect SurrealDB for the first time. When I restart my machine it’s all good. What could be issue
@@VikramBhaskaran hello! Usually that happens when already have something running and occupying the same port number. And when you restart your machine, they are no longer using that port, hence why the error goes away.
Try changing either Actix Web or SurrealDB to run on something like port 5000 instead and the other on port 8000
I am finding it difficult to understand how I should model relations, can you make a follow up tutorial with a more advanced schema?
Sure that sounds like a good idea for a new video too!
I'm trying to use the automatically created record ID from SurrealDB, but can't find a way to also reuse my model (in your case Pizza) for create_model and get_models. Was this the reason for why you initialize Pizza with your own uuid? Do you know a solution for my problem?
hello! for re-using models are you referring to getting/searching the result from the surrealdb? If so yea that's 1 of the reason(s) why I did it with my own uuid lol
actix or axum? what should i choice?
I haven't tried Axum but Actix Web does have better documentation though.
Both run on top of Tokio too so they are more or less similar.
For now I would say Actix Web lol
hey @@WhiteSponge, it me again, i want to ask you about is it faster to use sveltekit (frontend) with actix+surealdb (backend) or just use sveltekit + surealdb? Because i showed that surealdb have sdk for js? if just crud database?
@@funnynews341 hey! How have you been doing?
I would say go with the method you are most familiar for speed of development.
If you're more familiar with SvelteKit, definitely go with that.
And yes SurrealDB does have a JS version 😂
yes@@WhiteSponge , speed of development, and how about performance? are sveltekit + surrealdb have same speed of performance like actix+surrealdb?
@@funnynews341 actix web would on average perform better from my experience lol
addon - you can run surreal as a docker instance
For sure you can!
ya
😂
Hello how are you?
Lol hello Matthew
Are you Malaysian?
hey hello! Haha i'm not but I'm your neighbour! :D
why SurrealDB ?
I'm a fan of trying out new things lol
why r u pronouncing pizza like that
Ahahahah why not :D
said how it's spelt 😂