Complete REST API in Go – Build an Event App (GIn, JWT, SQL, Swagger)
Coding with Patrik
0:00 / 0:00
Complete REST API in Go – Build an Event App (GIn, JWT, SQL, Swagger)
62 943 просмотра · 1 год назад
Coding with Patrik
5,51 тыс. подписчиков
62 943 просмотра · 1 год назад
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.
🚀 Master Go → https://levelupgo.dev
🧑💻 Source Code
https://github.com/patni1992/Rest-api...
⏱️ 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
• Deploy a Go App to AWS (EC2) with Nginx, S...
Install Golang migrate https://github.com/golang-migrate/mig...
Install Air https://github.com/air-verse/air
Gin Framework https://gin-gonic.com/