Mô tả

Microservices is the latest 'buzzword' and hot topic in the web development industry at the moment and nowadays having microservices as part of your skillset is becoming more and more essential.  This course aims to teach you how to build a microservices based app using .Net for the backend services and Next.js for the client app.   We start from nothing and build up the app until we have a completed app that we can publish to a Kubernetes cluster on the internet.

Here are some of the things that are covered in this course:

  • Creating several backend services using .Net that provide functionality for the app

  • Service to service communication using RabbitMQ and gRPC

  • Using IdentityServer as the identity provider.

  • Creating a gateway using Microsoft YARP

  • Building a client side app with Next.js using the new App Router functionality (since Next.js 13.4)

  • Using SignalR for push notifications to the client app

  • Dockerizing our different services

  • CI/CD workflows using GitHub actions

  • Adding ingress controllers

  • Publishing the app locally using docker compose

The goals of the main part of this course is to build this app and be able to run and publish everything locally without having to sign up or pay for any cloud services.   Once you have completed the main part of the course there are 3 optional Appendixes that cover:

  • Unit and integration testing

  • Publishing locally to Kubernetes

  • Publishing the app to a Kubernetes cluster on the internet

Tools you need for this course

In this course all the lessons are demonstrated using Visual Studio Code, a free (and fantastic) cross platform code editor.   You can of course use any code editor you like and any Operating system you like... as long as it's Windows, Linux or Mac.  Please ensure that your computer can run Docker as this is a requirement for this course (please see the pre-requisite lesson available as a preview to confirm this). 

Is this course for you?

This course is very practical, about 90%+ of the lessons will involve you coding along with me on this project.  If you are the type of person who gets the most out of learning by doing, then this course is definitely for you.  

On this course we will build an example Auction Application with several services that we will use to provide its functionality.   For the client side of things we are using Next.js to take advantage of its client side and server side capabilities which is an excellent fit for what we are building.  All you will need to get started is a computer with your favourite operating system that is capable of running Docker, and a passion for learning how to build a microservies based application using .Net and Next.js.    

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

To build an application with .Net using Microservices architecture

To build a client app for the application using NextJS

To use RabbitMQ for Service bus communications

To install and use IdentityServer in the Microservices app

To be able to test the projects using Unit and Integration testing with XUnit

To publish the Microservices app to Docker compose

To publish the Microservices app to Kubernetes cluster both locally and on the internet

Yêu cầu

  • Some coding experience is required to participate in this course
  • Windows, Mac or Linux computer that is capable of running Docker

Nội dung khoá học

17 sections

Introduction

6 lectures
Introduction
04:56
Course pre-requisites
03:49
Setting up the developer environment
05:40
Course assets and source code
04:48
VS Code troubleshooting and tips
05:29
Microservices - the big picture
06:57

Section 2 - Creating the first microservice

15 lectures
Introduction to section 2
05:26
Creating the first micro service
11:22
Reviewing and simplifying the project
12:24
Adding the entity classes
10:04
Adding the Database context class
13:39
Adding a Postgres database server
10:10
Creating seed data
08:26
Shaping the data to return
09:48
Adding an API controller
11:47
Adding a postman collection
08:16
Adding the create auction endpoint
08:43
Adding the update auction endpoint
06:56
Adding the delete auction endpoint
04:52
Saving changes into source control
06:44
Summary
01:49

Section 3 - Creating a Search microservice

12 lectures
Introduction to Section 3
06:05
Creating the second micro services
09:01
Adding the MongoDb server
08:36
Adding the Item model
07:56
Adding seed data
08:13
Adding a search controller
09:42
Paginating the results
05:09
Adding filtering and ordering
11:42
Synchronous messaging
08:08
Adding Http communication to get the data
16:23
Making our Http communication resilient
15:21
Summary of Section 3
01:22

RabbitMQ

14 lectures
Introduction to Section 4
05:54
What is RabbitMQ
05:46
Installing RabbitMQ
04:33
Adding and configuring mass transit
09:49
Adding the contracts
05:08
Adding a consumer to consume a message from the Service bus
10:44
Publishing the Auction Created event to the bus
08:57
What could go wrong?
10:48
Adding a message outbox
13:25
Using message retries
06:35
Consuming fault queues
09:02
Challenge: Adding the update and delete consumers
04:47
Challenge solution
06:40
Summary of section 4
01:08

Identity Server

14 lectures
Introduction to Section 5
07:39
OAuth and OpenIDConnect
10:29
Creating the Identity Server project
05:00
Reviewing and configuring our new project
12:51
Seeding data and adding a migration
17:19
Reviewing the login page in identity server
05:48
Adding a register page
08:11
Adding a register page part 2
07:32
Adding a register page part 3
08:33
Adding client credentials to allow clients to request a token
12:52
Adding a custom profile service to identity server
06:10
Configuring auth on the resource server
06:46
Configuring the auth endpoints on the resource server
08:05
Summary of section 5
02:47

Adding a Gateway Service

10 lectures
Introduction to Section 6
04:11
Adding the Gateway service
06:42
Adding the Reverse Proxy configuration
10:15
Adding authentication to the Gateway config
07:22
Testing our Gateway service in Postman
07:54
Adding the remaining contracts we need
04:44
Adding the remaining consumers to the Auction Service
10:30
Adding the remaining consumers in the Search Service
06:19
Adding a new client to the Identity service configuration
07:10
Summary of Section 6
01:02

Dockerizing our application

10 lectures
Introduction to Section 7
03:55
Creating a docker account
04:41
Dockerizing the Auction Service
14:08
Updating our docker compose file for the Auction Service container
13:52
Dockerising the Search service
08:51
Dockerising the Identity Service
04:46
Debugging a .Net service in a docker container
11:02
Dockerising the Gateway Service
08:05
Testing our docker containers
11:21
Summary of Section 7
03:02

Adding the client side application

22 lectures
Introduction to Section 8
08:36
Creating the NextJS project
08:03
Reviewing and simplifying the NextJS Project
11:11
Creating a nav bar
14:57
Fetching data from the API
05:30
Adding an Auction Card component
05:01
Styling the auction cards
13:13
Adding a countdown timer to the auction card
13:02
Adding loading to the images
07:03
Adding types to the project
06:19
Adding pagination to our list
08:35
Using server functions in client components
11:27
Adding a set page size option
09:14
Using Zustand for state management
10:03
Refactoring our code to use the zustand state
10:52
Adding a search bar
05:33
Adding the search functionality
08:28
Adding a reset to the search function
04:18
Adding the sorting functionality
08:54
Adding the filtering functionality
04:23
Adding a component to display when zero results
10:50
Summary of section 8
01:08

Client side identity with NextAuth (AuthJS)

11 lectures
Introduction to Section 9
03:18
Before we begin
04:54
Installing Next Auth into our client app
12:29
Adding the login functionality
06:23
Getting the session details in the client
12:43
Populating the session data
10:39
Populating the User actions dropdown
08:58
Protecting routes
08:54
Testing API authentication
08:07
Getting the access token to use to authenticate to our resource server
11:01
Summary of Section 9
05:42

CRUD operations in the client app

15 lectures
Introduction to Section 10
01:32
Routing in NextJS
06:20
Getting the auctions won
07:38
Creating an Auction form
04:22
Creating an Auction form part 2
09:38
Creating a reusable text input
08:53
Creating the auction form part 3
07:27
Creating a reusable date input
09:13
Creating a fetch wrapper
14:06
Adding the create auction server action
10:09
Adding react hot toast to display notifications if something goes wrong
05:06
Adding the auction details page content
09:27
Adding the edit auction page
14:05
Adding the delete auction functionality
08:42
Summary of section 10
04:24

Creating the bid service

18 lectures
Introduction to Section 11
02:34
Creating the Bid Service
08:45
Adding the models to the Bid Service
04:45
Adding an API Controller for the bids
10:32
Adding the get bids endpoint
02:18
Adding the auction created consumer
04:02
Testing the bid functionality in Postman
03:25
Adding the DTOs and Automapper
06:03
Adding a producer for the BidPlaced
07:47
Challenge solution
07:03
Adding a Background service for the auction finished event
15:34
What is gRPC?
05:48
Adding gRPC part 1
13:56
Adding gRPC part 2
06:01
Adding a gRPC client
12:01
Updating the Gateway service
03:21
Dockerising the BidService
10:35
Summary of Section 11
00:59

Adding a SignalR service

8 lectures
Introduction to Section 12
02:13
Creating the Notification service
05:29
Adding a SignalR Hub
05:16
Adding the Consumers
07:49
Adding CORS support to the Gateway
05:19
Dockerising the NotificationService
02:35
Updating the Docker compose file
04:33
Summary of section 12
00:56

Adding the bids/notifications to the client

16 lectures
Introduction to Section 13
00:32
Refactoring the auctions into a zustand store
09:53
Updating the Auction cards with the current high price
05:25
Getting the bids for an auction
03:23
Creating a bid item
09:55
Creating a bid store
09:49
Creating a bid form
14:32
Updating the error handling
06:28
Adding conditionals to the form and testing
05:03
Adding SignalR to the client app
13:59
Adding the new bid to SignalR
05:01
Adding a toast for an auction created
06:50
Adding a toast for an auction finished event
08:13
Disabling the auction finished form when the auction finishes
11:45
Preventing low bids
03:44
Summary Section 13
00:51

Publishing the app to production (locally)

9 lectures
Introduction to Section 14
03:29
Preparing the client app
12:01
Creating the Dockerfile for nextjs
11:43
Fixing the identity server issues in docker compose
15:08
Giving the Identity Server a static ip address
11:41
Adding an ingress to Docker compose
10:33
Adding SSL to the ingress
07:12
Final app cleanup and resolving SignalR issue
12:26
End of course summary
04:54

Appendix A - Testing

21 lectures
Intro to Appendix A - Testing
10:00
The simplest unit test possible
13:51
Reviewing the code in the Auction controller and what we are testing
05:59
Creating an Auction Repository and interface
08:22
Refactoring the Auctions controller to use the repository
04:33
Mocking things
06:01
Unit testing the GET methods part 1
08:48
Unit testing the GET methods part 2
08:33
Unit testing the POST request
12:14
Challenge - Practicing creating unit tests for the other controller methods
04:18
Challenge solution
06:06
Integration testing setup
08:57
Setting up a Custom web application factory for integration testing
10:01
Adding test data to the DB
07:40
Creating an integration test for the GET method part 1
11:12
Creating an integration test for a GET request part 2
10:26
Creating an integration test for the POST request
13:38
Challenge - Practicing creating integration tests for the other methods
01:50
Challenge solution
03:09
Testing the Service bus
10:36
Using Collection fixtures to share the DB across test classes
10:38

Appendix B - Publishing to Kubernetes (locally)

20 lectures
Intro to Appendix B - Kubernetes
09:37
No ‘depends on’ in Kubernetes - using Polly to retry instead
12:54
Adding a GitHub action to push our Identity Server image to Docker hub
15:02
Deploying our IdentityServer to a Digital Ocean server
07:23
Configuring the Linux server to host the identity server
10:47
Creating the first Kubernetes manifest for a deployment
11:12
Adding a persistent volume claim
06:37
Adding a load balancer to allow us to connect to the postgres deployment
04:51
Adding a cluster ip our services can use
02:49
Creating a deployment for RabbitMQ
06:54
Creating a Mongodb deployment
04:39
Creating the auction service deployment
11:22
Creating the search service deployment
05:51
Creating the bid service deployment
04:54
Creating the notification service deployment
04:06
Creating the gateway service deployment
07:10
Creating the client app deployment
07:53
Adding an nginx ingress controller for docker-compose
09:53
Adding SSL to the ingress controller
09:39
Fixing Identity Server issues
16:23

Appendix C - Publising to Kubernetes (Internet)

19 lectures
Introduction to Appendix C
02:54
Kubernetes secrets
06:45
Using a manifest to create secrets
06:33
Updating the rest of the secrets
10:07
Adding a workflow to deploy our Auction service
09:21
Creating a kubernetes cluster on Digital Ocean
05:59
Connecting to our new kubernetes cluster
07:06
Creating a workflow to deploy our manifests automatically
07:38
Dev resources and prod resources
06:37
Creating the other deployment workflows for the other services
09:40
Deploying the secrets and the ingress controller
06:14
Deploying our manifests via github actions
08:08
Checking our deployment
03:36
Getting a domain name to point at our Load balancer
07:40
Tying up the loose ends part 1
13:48
Tying up the loose ends part 2
04:51
Adding SSL to our deployment part 1
09:32
Adding SSL to our deployment part 2
09:10
Finishing up the deployment
08:11

Đá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.