david hwang
david hwang
  • 29
  • 218 230
Ep9 Send Email Notifications in Goroutines (WaitGroup and Semaphores in Golang)
Now that we have the gRPC implemementations to list and update notification events, let's create an ecomm-notification microservice to send email notification for each of the events.
github.com/dhij/ecomm
blog post on keeping reference to the variable in a loop fixed in Go 1.22: go.dev/blog/loopvar-preview
0:00 intro and recap
1:56 loop every 30 seconds with a ticker
3:23 goroutines and a common mistake
4:33 add waitGroup and semaphores
6:45 add methods to send email and update db accordingly
11:53 add the ecomm-notification main file and run the server
14:13 add a quick fix for the demo
15:21 bring up services and test endpoints
Переглядів: 471

Відео

Ep8 Golang Enqueue Notifications into a Stateful Database Queue
Переглядів 4092 місяці тому
Let's see how we can use a database as a queue and enqueue notification events. These notification events will later be consumed by our notification microservice to send email notifications to the customers. github.com/dhij/ecomm 0:00 intro 3:58 add migration files to update order status 4:46 add storer to update order status 6:01 add RPC to update order status 10:58 add handler and route to up...
Ep7 Protobuf, gRPC Client & Server Setup in Golang
Переглядів 1 тис.2 місяці тому
gRPC setup is an essential step to allow performant communication between microservices and before moving onto the next part where we will be adding the notification microservice. github.com/dhij/ecomm 0:00 intro 5:28 add the protobuf and RPC definitions 8:00 compile protobufs and RPCs 10:09 set up and register our server with the gRPC server 14:58 set up gRPC client on ecomm-api microservice 1...
Ep6 Golang Microservice Admin & Authorization Middlewares
Переглядів 6672 місяці тому
Now that we have our JWT, we can add admin and authorization middlewares to apply authorization rules to our endpoints. github.com/dhij/ecomm 0:00 intro 1:33 add user id foreign key to an order 3:31 middleware example 4:28 implement the middlewares 8:30 why we use an empty struct for the context key 9:41 add middlewares to routes 13:04 read user claims/information from our handlers 16:05 test t...
Ep5 Golang Microservice JWT Authentication and Refresh Token
Переглядів 1,9 тис.3 місяці тому
We will look at JWT authentication and session management with refresh tokens. We will create endpoints to login/logout/renew/revoke the tokens. github.com/dhij/ecomm 0:00 intro 0:25 what is JWT 2:13 how authentication works & why we need refresh token 3:18 access vs refresh token 4:17 add the users table and storer/server/handler methods to create/list/update/delete user 13:00 add the login en...
Ep4 Golang Microservice HTTP RESTful API Routing with go-chi
Переглядів 6773 місяці тому
Now that we have the storer methods to interact with the database, we can get started with routing at the http layer. github.com/dhij/ecomm 0:00 intro 1:20 create the server and methods 2:49 add the createProduct, getProduct, listProducts, updateProduct, and deleteProduct handler methods 13:38 add routes to the products endpoints 15:34 import the missing mysql driver package in db 15:56 run mys...
Ep3 Golang Microservice Query Multiple Tables with One-To-Many in a Database Transaction with sqlx
Переглядів 7143 місяці тому
To query multiple tables with one-to-many relationships, we have to ensure that the queries are either committed on success or rolled back on failure altogether. That is where the database transaction comes into place to make our operations atomic. github.com/dhij/ecomm 0:00 intro 1:08 intro to database transaction 1:44 define the structs 2:21 add the CreateOrder storer method 3:07 add the data...
Ep2 Golang Microservice Query MySQL & sqlmock to Write Unit Tests for an E-commerce Backend
Переглядів 1,1 тис.4 місяці тому
Now that we have set up our database in our last episode, we can now start querying the MySQL database from our Go app. github.com/dhij/ecomm 0:00 intro 0:24 sql vs. sqlx comparison 1:52 go mod init & connect to DB 4:03 create our main.go file 5:28 create our MySQL storer file 6:11 add the Create/Get/List/Update/DeleteProduct storer methods 10:38 write unit tests with sqlmock for TestCreateProd...
Ep1 Golang Microservice Database Setup for E-commerce Backend (Docker & golang-migrate)
Переглядів 1,6 тис.4 місяці тому
Before we start with anything, we need to set up our database. In this episode, we design our database schema, bring up MySQL on a docker container, and create & apply database migration files to automate the database setup. github.com/dhij/ecomm 0:00 intro and database schema design 1:51 dbdiagram.io to generate the SQL file 3:16 intro to docker concepts & commands 6:25 connect to the MySQL co...
Ep0 Golang Microservice Course Overview - Build an E-commerce Backend
Переглядів 2,1 тис.4 місяці тому
This is a practical and beginner-friendly course to build an e-commerce backend in Go. Stay tuned for the upcoming videos! github.com/dhij/ecomm
Nginx Ingress Controller & Cert Manager Setup in 2024
Переглядів 5 тис.6 місяців тому
set up nginx ingress controller and cert manager. you don't have to watch the older video to follow along but it might help: ua-cam.com/video/bkCNX8HF9mc/v-deo.htmlsi=QvNJGUmLZCp-T4LC github: github.com/dhij/cluster-demo ingress-nginx: github.com/kubernetes/ingress-nginx ingress doc: kubernetes.io/docs/concepts/services-networking/ingress/ ingress rewrite-target annotation doc: kubernetes.githu...
Deploy Go App to Production Kubernetes & Database
Переглядів 8817 місяців тому
feel free to watch the last two videos to continue following along: ua-cam.com/video/2QMoLyfIJx8/v-deo.htmlsi=qyWe-7eiGGmlTRtm ua-cam.com/video/p0n90IUfjp4/v-deo.htmlsi=s8RYFTGrQMPdQfQ5 learn how to migrate your database tables to a production database and kubernetes basics to deploy your app on a cluster. github: github.com/dhij/cluster-demo How to Connect to MySQL Database Clusters: docs.digi...
Install Older Version of Docker Desktop on MacOS (brew install, SHA256 mismatch)
Переглядів 3,9 тис.9 місяців тому
docker desktop: docs.docker.com/desktop/release-notes/ homebrew: formulae.brew.sh/cask/docker
Connect to MySQL on Golang and Create Docker-Compose file
Переглядів 1,6 тис.9 місяців тому
Now that we have a Dockerfile for our Go app from our last video, we want to run the Go app along with a MySQL container. In this video, we will extend our Go app to insert & get users into/from the database before writing our docker-compose yaml. We will validate everything works at the end of the video. github: github.com/dhij/cluster-demo
Dockerfile for Golang Step by Step 2024 (multi-stage build with distroless/scratch)
Переглядів 4,5 тис.9 місяців тому
This video covers how to build your Dockerfile and run the container by mapping the port. The Dockerfile uses multi-stage builds which allows us to build a small-sized minimal image. Here is the docker docs covering multi-stage builds: docs.docker.com/build/building/multi-stage/ If you are ever interested in what the difference between using the distroless vs. scratch as the base image is, have...
Goroutines Explained - channels, waitGroup, cancellation, & running loop in parallel
Переглядів 719Рік тому
Goroutines Explained - channels, waitGroup, cancellation, & running loop in parallel
My Experience Taking the CKA in 2023
Переглядів 8 тис.Рік тому
My Experience Taking the CKA in 2023
Deploy Hugo Blog to Github Pages via Github Actions w/ a Custom Domain
Переглядів 15 тис.Рік тому
Deploy Hugo Blog to Github Pages via Github Actions w/ a Custom Domain
Realtime Chat Part 3: Frontend UI with NextJS, Typescript, & TailwindCSS
Переглядів 6 тис.Рік тому
Realtime Chat Part 3: Frontend UI with NextJS, Typescript, & TailwindCSS
Go Realtime Chat Part 2: websocket connection + chat rooms management
Переглядів 19 тис.Рік тому
Go Realtime Chat Part 2: websocket connection chat rooms management
Go Realtime Chat Part 1: authentication + db connection setup (clean architecture, cookie-based JWT)
Переглядів 40 тис.Рік тому
Go Realtime Chat Part 1: authentication db connection setup (clean architecture, cookie-based JWT)
Unsupervised Clustering with Siamese Neural Network and DBSCAN (Keras, Triplet Loss, VGG16)
Переглядів 4,7 тис.Рік тому
Unsupervised Clustering with Siamese Neural Network and DBSCAN (Keras, Triplet Loss, VGG16)
Deploy Serverless Function on k3s/Kubernetes with OpenFaaS (x86/Arm, Linux VM, Go)
Переглядів 1 тис.Рік тому
Deploy Serverless Function on k3s/Kubernetes with OpenFaaS (x86/Arm, Linux VM, Go)
Install Kubernetes Cluster with kubeadm (Linux VM/Mac/Windows, x86/Arm)
Переглядів 56 тис.2 роки тому
Install Kubernetes Cluster with kubeadm (Linux VM/Mac/Windows, x86/Arm)
When to use Pointers in Go w/ Practical Example - Heap/Stack, Pointer Receiver
Переглядів 3 тис.2 роки тому
When to use Pointers in Go w/ Practical Example - Heap/Stack, Pointer Receiver
Thymeleaf Setup 2022 - CSS/Bootstrap, Page Layout, Fragments, Live Reload
Переглядів 7 тис.3 роки тому
Thymeleaf Setup 2022 - CSS/Bootstrap, Page Layout, Fragments, Live Reload
JWT Authentication - Part 3: Redux Typescript for Login
Переглядів 9 тис.3 роки тому
JWT Authentication - Part 3: Redux Typescript for Login
JWT Authentication - Part 2: React Typescript Authentication Page
Переглядів 11 тис.3 роки тому
JWT Authentication - Part 2: React Typescript Authentication Page
JWT Authentication - Part 1: Golang w/ Gin Backend Setup
Переглядів 12 тис.3 роки тому
JWT Authentication - Part 1: Golang w/ Gin Backend Setup

КОМЕНТАРІ

  • @RanaAhsanAnsar-q7i
    @RanaAhsanAnsar-q7i 3 години тому

    Awesome Tutorial Thanks

  • @prashlovessamosa
    @prashlovessamosa 2 дні тому

    Mr David please give us some updates.

  • @elegantapps3055
    @elegantapps3055 5 днів тому

    great course with great teacher

  • @Carlos-kc8vx
    @Carlos-kc8vx 10 днів тому

    Hey currently your gohugo version doesn't work with the theme papermod

  • @MohammadDLitoo
    @MohammadDLitoo 13 днів тому

    we are in oct buddy!!!! still waiting for this awesome course

  • @KhoiNguyen-fj6jp
    @KhoiNguyen-fj6jp 16 днів тому

    Here is the cli he ran to create the migration docker run -it --rm --network host --volume "$(pwd)/db:/db" migrate/migrate:v4.17.0 create -ext sql -dir /db/migrations init_schema

  • @THENOOBYPRO
    @THENOOBYPRO 17 днів тому

    niceee vid man , but next time include my right ear too

  • @pretorgaming244
    @pretorgaming244 18 днів тому

    may i ask, why you use panic in deleteOrder func.

  • @abhishekshukla5484
    @abhishekshukla5484 18 днів тому

    good content and explaination

  • @richlawson3003
    @richlawson3003 21 день тому

    Great instructions helped my undderstand the concepts.

  • @1ofakind632
    @1ofakind632 22 дні тому

    i love this video

  • @KhoiNguyen-fj6jp
    @KhoiNguyen-fj6jp 25 днів тому

    I like how he explains Docker stuff. Well done.

  • @ramdoni3935
    @ramdoni3935 29 днів тому

    still waiting until you come Back Broooo hehheheheh

    • @dhij
      @dhij 28 днів тому

      i am sorry for the delay bro, i have a big event coming this weekend and i am traveling the following week so I will probably work on the videos the second week of October 😓

    • @ramdoni3935
      @ramdoni3935 22 дні тому

      @@dhij yoshaaa still wait your best content learn for SWE ComeBack Again :) hehehehe

    • @ramdoni3935
      @ramdoni3935 14 днів тому

      @@dhij second week in october .. ready for ComeBack My Boyyy hehehehhehe :)

  • @MVybz
    @MVybz Місяць тому

    hands down one of the best golang series out there!

  • @mohamed_akram1
    @mohamed_akram1 Місяць тому

    Thank you.

  • @josepmdc
    @josepmdc Місяць тому

    your channel is a gold mine, thank you for making these videos!

    • @dhij
      @dhij Місяць тому

      Glad to hear you liked the videos!

  • @ramdoni3935
    @ramdoni3935 Місяць тому

    Yoshaaa please continue your best journey 😊😊

    • @dhij
      @dhij Місяць тому

      sorry for the delay, the uploads are going to be slower till October unfortunately because i am preparing for an event in October 😓

    • @gokusaiyan1128
      @gokusaiyan1128 Місяць тому

      @@dhij thanks for your work

    • @ramdoni3935
      @ramdoni3935 Місяць тому

      @@dhij yoshaa stilll waiting and keep Smile bro:)

  • @Akkad-t8q
    @Akkad-t8q Місяць тому

    Why is it everyone doing tutorials so eager to press enter after the autocompleting the command, why cant you wait half a second after autocompleting it so it is visible, like as if this is some eastern egg in the video that I need to pause to catch.

  • @KhanhHoang-fi6yh
    @KhanhHoang-fi6yh Місяць тому

    Thnk for videos. Please give some advice for my project. I am trying to combine python grpc server to combine with above golang project.

  • @DJMerrell86
    @DJMerrell86 Місяць тому

    Your voice audio only plays in my left ear

    • @dhij
      @dhij Місяць тому

      my apology, thats my bad 😓

  • @k2x2x2s
    @k2x2x2s Місяць тому

    This is so amazing. Thank you David!

    • @dhij
      @dhij Місяць тому

      My pleasure!

  • @Livingston28
    @Livingston28 Місяць тому

    This is just the bestttt

    • @dhij
      @dhij Місяць тому

      Glad to hear you found it helpful!

  • @ContainerTalks
    @ContainerTalks Місяць тому

    Can you also create a video on cert-manager for wildcard ? or do you have any tutorial about wildcard certificate.

  • @AryaKabiri
    @AryaKabiri Місяць тому

    thank you

  • @sambhavmishra5423
    @sambhavmishra5423 Місяць тому

    Good to see you back!

    • @dhij
      @dhij Місяць тому

      🥳🥳🥳

  • @TechDoctorMalayalam
    @TechDoctorMalayalam Місяць тому

    Helpful video

    • @dhij
      @dhij Місяць тому

      awesome!

  • @selvamp5775
    @selvamp5775 Місяць тому

    Nice, Any specific reasons to choose Go for backend?

    • @dhij
      @dhij Місяць тому

      nope, this is a Go tutorial so things are built with Go 🙂

  • @abhishekprasad4488
    @abhishekprasad4488 Місяць тому

    Hey are going to add docker-compose in your project in future? Actually I'm trying on my own but since I'm new to Docker i find it little difficult

    • @dhij
      @dhij Місяць тому

      hello, yup i will work on that on the next episode. my old videos ua-cam.com/video/2QMoLyfIJx8/v-deo.html and ua-cam.com/video/p0n90IUfjp4/v-deo.html might help, did you get a chance to have a look?

    • @abhishekprasad4488
      @abhishekprasad4488 Місяць тому

      @@dhij thank you 🤝, I will look into it

  • @Huboh
    @Huboh Місяць тому

    This is nice david. Also, You missed returning the error from context.Err() when waiting for context.Done()

    • @dhij
      @dhij Місяць тому

      hello there, thank you! do you mean the part where we have a case for `<-ctx.Done()` in the select statement? we wouldn't need to return the error there since our `Run()` method doesn't return any error 🙂 but of course it will be up to you to decide how you want that to be structured.

    • @Huboh
      @Huboh Місяць тому

      @@dhij yeah that part, gotcha!

  • @prashlovessamosa
    @prashlovessamosa Місяць тому

    Thanks I was waiting for it.

    • @dhij
      @dhij Місяць тому

      cool, thank you for waiting!

  • @abhishekprasad4488
    @abhishekprasad4488 Місяць тому

    How many videos are left to complete this series? Great series 👍

    • @dhij
      @dhij Місяць тому

      Thank you! I would say at least 5-6 more 🙂

    • @sambhavmishra5423
      @sambhavmishra5423 Місяць тому

      Don't worry, take your time​@@dhij

  • @esra_erimez
    @esra_erimez Місяць тому

    Well done.

    • @dhij
      @dhij Місяць тому

      thank you!

  • @rohangupta1266
    @rohangupta1266 Місяць тому

    this series is streets ahead

  • @priyankatile1767
    @priyankatile1767 2 місяці тому

    @dhij I got error as 'error' is of type 'unknown'.ts(18046) (local var) error: unknown at error.response && error.response.data.message ? error.response.data.message : error.message. How to resolve this?

    • @dhij
      @dhij Місяць тому

      hello the error seems to suggest the type for the error is not defined :)

  • @prashlovessamosa
    @prashlovessamosa 2 місяці тому

    please upload next part

    • @dhij
      @dhij 2 місяці тому

      thank you for your patience, i should have it some time next week 🙂

  • @335-arifdwinugroho2
    @335-arifdwinugroho2 2 місяці тому

    Very cool, the explanation is easy to understand. hope you are always healthy

  • @335-arifdwinugroho2
    @335-arifdwinugroho2 2 місяці тому

    very cool, but missing server validation I guess, because if I send an empty json file { } the service will still process it

    • @dhij
      @dhij 2 місяці тому

      yup the project is oriented towards learning and is nowhere perfect/production-ready 🙂

  • @335-arifdwinugroho2
    @335-arifdwinugroho2 2 місяці тому

    Very helpful especially for beginners like me. the concept used is very good.

    • @dhij
      @dhij 2 місяці тому

      Glad to hear you found it helpful!

  • @vaidikbajpai1026
    @vaidikbajpai1026 2 місяці тому

    So happy that u dropped another video will be it later today.

    • @dhij
      @dhij 2 місяці тому

      Glad to hear you like the series!

  • @prashlovessamosa
    @prashlovessamosa 2 місяці тому

    David can you please share these diagrams in the repo too.

    • @dhij
      @dhij 2 місяці тому

      Thank you for the reminder, i will update the repo and the README

  • @prashlovessamosa
    @prashlovessamosa 2 місяці тому

    Great 👍 Lovin this series so much for my brain.

    • @dhij
      @dhij 2 місяці тому

      Thats awesome!

  • @vutuan-p3d
    @vutuan-p3d 2 місяці тому

    great thank. please share ur experience to do debug and logger

    • @dhij
      @dhij 2 місяці тому

      appreciate the feedback 👍 i will take note of that

  • @ramdoni3935
    @ramdoni3935 2 місяці тому

    Yoshaaaaaaaa First one Human on Earth 😂😂😂😂 Watch your best learn journey

    • @dhij
      @dhij 2 місяці тому

      you are too fast 😂

    • @ramdoni3935
      @ramdoni3935 2 місяці тому

      @@dhij letsssgooo continue your content amazing Brow :)hheheheh

  • @faizanmohammed7687
    @faizanmohammed7687 2 місяці тому

    Couldn't do it, it sucks how confusing git and github is. actions and all.

    • @dhij
      @dhij 2 місяці тому

      oh no, do take your time to learn one thing at a time! let me know if you have any specific question 👍

  • @PinguinoRodriguez-hd8bw
    @PinguinoRodriguez-hd8bw 2 місяці тому

    You're the best man! I couldn't get this working at all, your explanation was clear and concise.

    • @dhij
      @dhij 2 місяці тому

      Thats awesome, thank you!

  • @vaidikbajpai1026
    @vaidikbajpai1026 2 місяці тому

    done watching and absorbing all the info thanks for the videos so far.

    • @dhij
      @dhij 2 місяці тому

      Thats awesome!! Hope you found it useful 👍

  • @_elifilen
    @_elifilen 2 місяці тому

    I followed all the steps (I had to change some commandes becouse I don"t have touch and vim ) but it give a blank page. also my project folder didn't upload

    • @dhij
      @dhij 2 місяці тому

      i could take a look if you have a public github repo 👍

  • @vaidikbajpai1026
    @vaidikbajpai1026 2 місяці тому

    There is a correction at 16:20, i think u have mistakenly included a test for CreateOrder into the test suites of GetOrders.

  • @vaidikbajpai1026
    @vaidikbajpai1026 2 місяці тому

    great content

  • @ilayohana3150
    @ilayohana3150 2 місяці тому

    does anyone really understand all of this