Complete REST API in Go – Build an Event App (GIn, JWT, SQL, Swagger)

preview_player
Показать описание
Build a complete REST API for an event management app in Go using Gin and SQL! This tutorial walks you through setting up the project, creating database migrations and models, adding routes and handlers, writing SQL queries, and implementing user registration, JWT authentication, and authorization. You’ll also test everything with Curl and add Swagger documentation.

🧑‍💻 Article & Code:

⏱️ Timestamps:
0:00 - Introduction
1:09 - Setup
2:33 - Overview of database tables
3:10 - Creating project structure
4:07 - Working with migrations
16:02 - Connecting the api app to the database
16:48 - Creating the models
23:19 - Setup the Gin server and run it
31:54 - Adding routes and handlers for events
45:45 - Creating database queries for events
55:43 - Register user
01:02:27 - Testing creating a user and CRUD for events with Curl
01:05:57 - Connect attendees with events
01:26:04 - Testing connecting attendees with events with Curl
01:27:18 - Authentication using JWT token
01:36:05 - Adding auth middleware and protecting our routes
01:44:37 - Testing authentication with curl
01:46:01 - Authorization check if the user has permission
01:53:19 - Add Swagger
02:02:24 - Final words

🛠️ Resources:
How to deploy this app to aws

Рекомендации по теме
Комментарии
Автор

Best Go Gin tutorial on YouTube! I’d also love it if you could create tutorials on microservices and clean architecture.

KitessaFikadu
Автор

please keep going with more projects using go and gin,
i really thank you for this video, many thanks

m.keshavarzi
Автор

Thank you! It helped me a lot! The post with the step by step was excellent

andrehp
Автор

Awesome man, bring more complete gin rest api series with diff projects

MWStudiooo
Автор

Hey Patrik, thanks for the helpful tutorial on go-gin-rest! You are

I’d love to see a follow-up tutorial on hosting the application on the cloud (AWS or relevant). It would be really beneficial for beginners like me. Looking forward to it! 😊

hardikmehta
Автор

You are the Go guru on YouTube we want more from you

ALMOUSLECKATALIBAG
Автор

I’ve learned Go and am working on a project similar to yours by following your code. Since Go has a vast library, I found it hard to implement everything from scratch. So, I’m referring to your video, either by typing or copying the code. However, I fully understand the backend and can explain every line of it—I just struggle to write it entirely with my own logic. Is this okay in start?

gajendarop
Автор

can you please make minimilastic client too just teach us how to connect it with api and make auth etc work on client side that woul be too helpful.
btw you are hell of a goood teacher please keep uploading thanks a lot

prashlovessamosa
Автор

how to install golang-migrate in windows

saifshaikh
Автор

If you had the option to accept Super Thanks I'd so Super Thank you right now - I'd Super Thank you HARD

pookiepats
join shbcf.ru