How To Build a Complete API In Golang (Docker, JWT, MySQL)
ฝัง
- เผยแพร่เมื่อ 22 พ.ค. 2024
- ► Join the private community to level up as software engineer: selfmadeengineer.com
In this video we're going to be building a complete REST API in Golang using JWT, MySQL and at the end dockerize the whole thing so we can ship it to the cloud.
Links:
Patreon: / tiagotaquelim
Discord: / discord
Github: github.com/sikozonpc/
Resources:
Project source code: github.com/sikozonpc/go-rest-api
Direnv (for envs variables loading): direnv.net/
More complex production example: • Complete Backend API i...
Hope you liked and thanks for watching!
Time Stamps 👇
00:00:00 Intro
00:01:31 API Server
00:05:46 Database
00:11:28 Env vars sourcing
00:14:04 Tasks Service
00:24:42 Functional testing tasks
00:26:10 Unit testing the tasks service
00:38:00 Add JWT authentication
00:47:21 Functional testing auth
00:47:50 User register endpoint
00:56:05 Docker service
Video titles ideas (for the algo):
REST API in Golang
Building a JSON API in Golang
How to build a REST API in Golang
I've made a more in-depth video/course that will cover some of your guys questions here: th-cam.com/video/7VLmLOiQ3ck/w-d-xo.html
Thanks for watching
This is amazing. Thanks Tiago!
Really appreciate the video with actual code and not just some theory
Thanks, man. right when I need these types of videos. Subbed.
👍 more content like this in go only, started this one.
Actually a high quality content. Keep up the great work
Thanks💪
I actually was searching for something exactly like this! Thanks a bunch!!! That was very useful! Keep up!
Awesome! Thank you so much!
Thanks mate, suuuuper useful
Appreciate your hard work!
Thank you so much for the kind words!
I want to thank you for putting in the time. Keep doing it.
Thanks a lot! 💪
Recently discovered your channel and I must say, I've learned a lot from your content. Keep up the great work
Thank you 💪🔥
Love it!
muito bom Tiago.. Thanks a lot
Thank you!
My man is alergic to creating directories
🤣
thanks
very nice content.
Thanks!
really good video
Thank you!
Great video, btw: which font and ide theme are you using? Looks great!
Thanks! The theme is called Gruvebox and the font is either "Menlo" (for mac) or "JetBrains Mono".
hello my new favourite golang content creator.
Hey! Thank you so much!
I'm curious I see that you have a very flat file structure, other than simplicity do you see a reason for not using folder structure like the cmd/ interna/ pkg/ handlers/ etc? Awesome video!
Thanks man! I did that for a couple reasons: firstly so I could move faster and so it would not be opinionated.
However I've seen a lot of people are interested in a more "complete" folder structure so I'm currently working on a bigger video/course where I do that.
prettty cool, is it possible that u can create an industry level go api using gin, and postgres which are both in docker
container
Yes that is possible
Hi Tiago, I used to use MVC folders structuring, can we somehow structure this project also in different folders? or is this the best practice in go ?
Sure it's completely to personal preference. I've decided to not do that to not be opinionated during the tutorial.
how have you configured vs code like that? seems great!
I have my dotfiles on my github: github.com/sikozonpc/dotfiles
Hi sir, upload complete backend tutorial in golang
I'm currently working on a big complete backend API video/course!
In production, how would you structure these files into folders?
It really depends on how you want to structure it and how the project is going to grow.
But, I have left in the description of the video an example of a project that I've been working on and I've separated everything into folders.
Where each folder is domain.
What software you use for that sql client ? Thanks 16:29
It's called TablePlus
@@TiagoTaquelim hey thank you for telling me the name. Cpuld you also provide a simple steps to initiate the connection from the beginning ? I fail to make a connection like something is missing
@@abhiprayasaputra9426 Join the Discord server and post where do you need help there, it's easier to explain.
@@TiagoTaquelim oh okay , thanks
Off topic but please what theme do u use?
Gruvebox
what is your theme?
It's called gruvebox.
New to Golang here. Not even sure if I’ll go deeper into it tbh.
Question: Why do I have the impression Go devs overuse single-character variable names? It’s just awful!!!
vi logo que era tuga pa
🤣🤣
Why can't u use folders?
Simplicity.
In my latest video I use a complete folder structure.
Nice! I would like to see this but starting from an OpenAPI spect description. How much code we could save with a generator?
You Haven't Explained about How to used WIthJWTAuth, You have just used it, 15:21 (there no WithJWTAuth) but at 16:43 voila
not at 38:38 I understand it ( while testing you haven't changed it, but I don't know why it is showing that at 16:43?)