Mô tả

In this course, you will learn step-by-step how to design, develop and deploy a backend web service from scratch. I believe the best way to learn programming is to build a real application. Therefore, throughout the course, you will learn how to build a backend web service for a simple bank. It will provide APIs for the frontend to do the following things:

  • Create and manage bank accounts.

  • Record all balance changes to each of the accounts.

  • Perform a money transfer between 2 accounts.

The programming language we will use to develop the service is Golang, but the course is not just about coding in Go. You will learn a lot of different topics regarding backend web development. They are presented in 6 sections:

  1. In the 1st section, you will learn deeply about how to design the database, generate codes to talk to the DB in a consistent and reliable way using transactions, understand the DB isolation levels, and how to use it correctly in production. Besides the database, you will also learn how to use docker for local development, how to use Git to manage your codes, and how to use GitHub Action to run unit tests automatically.

  2. In the 2nd section, you will learn how to build a set of RESTful HTTP APIs using Gin - one of the most popular Golang frameworks for building web services. This includes everything from loading app configs, mocking DB for more robust unit tests, handling errors, authenticating users, and securing the APIs with JWT and PASETO access tokens. 

  3. In the 3rd section, you will learn how to build your app with Docker and deploy it to a production Kubernetes cluster on AWS. The lectures are very detailed with a step-by-step guide, from how to build a minimal docker image, set up a free-tier AWS account, create a production database, store and retrieve production secrets, create a Kubernetes cluster with EKS, use GitHub Action to automatically build and deploy the image to the EKS cluster, buy a domain name and route the traffics to the service, secure the connection with HTTPS and auto-renew TLS certificate from Let's Encrypt.

  4. In the 4th section, we will discuss several advanced backend topics such as managing user sessions, building gRPC APIs, using gRPC gateway to serve both gRPC and HTTP requests at the same time, embedding Swagger documentation as part of the backend service, partially updating a record using optional parameters, and writing structured logger HTTP middlewares and gRPC interceptors.

  5. Then the 5th section will introduce you to asynchronous processing in Golang using background workers and Redis as its message queue. We'll also learn how to create and send emails to users via Gmail SMTP server. Along the way, we'll learn more about writing unit tests for our gRPC services that might involve mocking multiple dependencies at once.

  6. The final section 6th concludes the course with lectures about how to improve the stability and security of the server. We'll keep updating dependency packages to the latest version, use Cookies to make the refresh token more secure, and learn how to gracefully shut down the server to protect the processing resources. As this part is still a work in progress, we will keep making and uploading new videos about new topics in the future. So please come back here to check them out from time to time.

This course is designed with a lot of details, so that everyone, even those with very little programming experience can understand and do it by themselves. I firmly believe that after the course, you will be able to work much more confidently and effectively on your projects.

Bạn sẽ học được gì

Design database schema using DBML and automatically generate SQL code from it

Deeply understand the DB isolation levels, transactions and how to avoid deadlock

Automatically generate Golang code to interact with the database

Develop a RESTful backend web service using the Gin framework

Secure the APIs with user authentication, JWT and PASETO

Write stronger test set with high coverage using interfaces and mocking

Build a minimal Docker image for deployment and use Docker-compose for development

Set up Github Action to automatically build and deploy the app to AWS Kubernetes cluster

Register a domain and config Kubernetes ingress to route traffic to the web service

Enable automatic issue & renew TLS certificate for the domain with Let's Encrypt

Take your web service to the next level with gRPC and gRPC gateway

Run background workers to process tasks asynchronously with Redis and Asynq

Yêu cầu

  • Only basic programming skill is needed
  • If you're new to Go, I suggest learning its syntax first on the "Tour of Go" website

Nội dung khoá học

6 sections

Working with database [Postgres + SQLC]

14 lectures
Design DB schema and generate SQL code with dbdiagram.io
09:57
Setup development environment on Windows: WSL2, Go, VSCode, Docker, Make, Sqlc
09:14
Setup development environment on MacOS: Install Go and Visual Studio Code
06:18
Use Docker + Postgres + TablePlus to create DB schema
12:38
How to write & run database migration in Golang
09:51
Generate CRUD Golang code from SQL | Compare db/sql, gorm, sqlx & sqlc
21:21
Write SQL queries for transfers and entries table and generate Go code
3 questions
Write unit tests for database CRUD with random data in Golang
20:04
Configure the right sql_package in your sqlc.yaml file
1 question
A clean way to implement database transaction in Golang
19:52
DB transaction lock & How to handle deadlock in Golang
28:20
How to avoid deadlock in DB transaction? Queries order matters!
13:03
Deeply understand transaction isolation levels & read phenomena
29:36
Setup Github Actions for Golang + Postgres to run automated tests
19:26

Building RESTful HTTP JSON API [Gin + JWT + PASETO]

12 lectures
Implement RESTful HTTP API in Go using Gin
25:21
Load config from file & environment variables in Go with Viper
09:32
Mock DB for testing HTTP API in Go and achieve 100% coverage
26:54
Implement transfer money API with a custom params validator
14:24
Add users table with unique & foreign key constraints in PostgreSQL
14:07
How to handle DB errors in Golang correctly
11:12
How to securely store passwords? Hash password in Go with Bcrypt!
16:53
How to write stronger unit tests with a custom gomock matcher
12:00
Why PASETO is better than JWT for token-based authentication?
15:24
How to create and verify JWT & PASETO token in Golang
23:30
Implement login user API that returns PASETO or JWT access token in Go
13:51
Implement authentication middleware and authorization rules in Golang using Gin
29:17

Deploying the application to production [Docker + Kubernetes + AWS]

14 lectures
How to build a small Golang Docker image with a multistage Dockerfile
11:59
How to use docker network to connect 2 stand-alone containers
10:07
How to write docker-compose file and control service start-up orders
16:08
How to create a free-tier AWS account
06:44
Auto build & push docker image to AWS ECR with Github Actions
20:44
How to create a production database on AWS RDS
10:08
Store & retrieve production secrets with AWS secrets manager
23:31
Kubernetes architecture & How to create an EKS cluster on AWS
17:27
How to use kubectl & k9s to connect to a kubernetes cluster on AWS EKS
15:03
How to deploy a web app to Kubernetes cluster on AWS EKS
20:53
Register a domain & set up A-record using Route53
10:30
How to use Ingress to route traffics to different services in Kubernetes
09:50
Auto issue & renew TLS certificates with cert-manager and Let's Encrypt
14:25
Automatic deploy to Kubernetes with Github Action
14:37

Advanced Backend Topics [Sessions + gRPC]

17 lectures
How to manage user session with refresh token
22:55
Generate DB documentation page and schema SQL dump from DBML
11:09
Introduction to gRPC
07:47
Define gRPC API and generate Go code with protobuf
16:15
How to run a golang gRPC server and call its API
10:08
Implement gRPC API to create and login users in Go
13:37
gRPC Gateway: write code once, serve both gRPC & HTTP requests
16:42
How to extract information from gRPC metadata
08:43
Automatic generate & serve swagger documentation from Go server
13:18
Embed static front-end files inside Golang backend server's binary
10:23
Validate gRPC parameters and send human/machine friendly response
15:42
Run DB migrations directly inside Golang code
11:44
Partial update DB record with SQLC nullable arguments
18:21
Build gRPC update API with optional parameters
14:18
Add authorization to protect gRPC API
14:28
Write structured logs for gRPC APIs
15:18
How to write HTTP logger middleware in Go
10:04

Asynchronous processing with background workers [Asynq + Redis]

11 lectures
Implement background worker with Redis task queue
19:38
Integrate async worker to Go web server
13:58
Send async tasks to Redis within a DB transaction
09:26
How to handle errors and print logs for Async workers
10:41
Some delay might be good for your async tasks
06:14
How to send email in Go via Gmail
15:05
How to skip test in Go and config test flag in vscode
03:29
Email verification feature: design DB and send email
18:36
Implement email verification API in Go
16:45
Unit test gRPC API with mock DB & Redis
24:33
How to test a gRPC API that requires authentication
14:33

Improve the stability and security of the server

13 lectures
Upgrade and config sqlc with version 2 syntax
05:43
Switch DB driver from lib/pq to pgx
17:43
How to properly handle DB errors with pgx driver
09:35
Docker compose: port + volume mapping
09:01
How to install & use binary packages in Go
04:42
Implement role-based access control (RBAC) in Go
14:35
Grant AWS EKS cluster access to Postgres and Redis using security group
14:21
Deploy gRPC + HTTP server to AWS EKS cluster
15:56
Don't lose money on AWS
03:53
Graceful shutdown gRPC/HTTP servers and async worker
14:10
Go 1.22 fixed the most common for-loop trap
07:21
Hey, it's not the end yet!
00:19
What's next?
00:18

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.