
Learn to build a go-based gRPC API using language-specific clients to call server endpoints, in a relaxed, collaborative course with environment setup in the next video.
Set up your Golang gRPC environment by installing dependencies, generating code from proto files with protoc, and organizing generated files into pdb and v1 folders.
Install and configure MySQL as part of your environment, alongside Go extensions and code snippets in Visual Studio Code, then prepare migrations and repositories for the backend.
Set up go modules and dependency management, then define the user type as a model with id, email, first name, last name, and password, including json tags and schema validation.
Implement user type validation by using the validator package and tags, creating validate_tor.go, and applying a validate function to enforce required fields like first name, last name, and password.
Create a global repo singleton to manage API and MySQL database interactions via the xorm repository package, and inject it into gRPC handlers for data access.
Implement the create function in the users repository to store a new user, validating first name, last name, email, and password, and inserting via the X form insert function.
Develop find by id and find by email in the UsersRepo, returning a user pointer and error, with input validation and a database lookup by id or email.
Implement the users repository update function with input validation, perform the db update, and return errors for invalid input. Discuss the affected rows concept.
Test without mocking the database by using a live database and a valid connection to verify real queries. Create a branch and push changes.
Explore unit tests for the users repository, implementing FindById and FindByEmail with sqlmock, covering success paths, database errors, and zero-row scenarios.
Learn to generate mocks for repos and enable full-scale testing of your Go gRPC API using a mocking framework and a bash script to automate repo mocks.
Discover how protobufs and protoc generate code in Go, C++, and Java from proto definitions, along with mocks, using a Makefile and plugins to build gRPC endpoints.
Define protobuf types in a types.proto file. Create a user message with first name, last name, and email, omitting password in responses, and generate Go code using protoc.
Scaffold the gRPC users handler under v1, defining create, find by phone, find by email, and update operations with context-aware requests and user replies.
Develop and validate the gRPC users create endpoint in Go, wiring a global repo, context usage, and comprehensive user validation for email, first name, last name, and password.
Builds tests for the gRPC users handler create operation, bootstraps mocks and repositories, and validates error handling and successful user creation.
drive a second test for the gRPC users create handler to achieve 100 percent test coverage by manipulating the global repo in context, validating error handling with a valid user.
Run a gRPC api server from the command line, expose v1 users endpoints, configure interceptors and a docker container workflow, and test the service via net.Listen on a port.
install grpc_cli to test your golang gRPC API endpoints, configure the reflection service to reveal available endpoints like v1 users.
Create the author repo to manage JWT-based authentication and token data for protected routes in the Golang gRPC API, testing with gRPC tools.
Extract data from a token by decrypting and validating JWT claims, parse user id, email, and visibility, and return a user object in the auth repo workflow.
Create and refine test files for the auth repository, generate mocks and marks, and run gingko and go tests to validate repository tests and user tests.
Explore how to flesh out auth tests in the repo, covering get new claims, get signed token, and extract data from token, using mocks and test cases to boost coverage.
Watch the testing video to add the required item to your global repo, ensuring access to the rest of the videos for the Golang gRPC API course.
Build and test a gRPC login endpoint using JWT authentication in Go, validating login requests, verifying user credentials, and returning a signed token with claims.
Create and configure a new test file for the auth handler using Ginkgo bootstrap, wire up router and server references, and prepare the testing setup for the Go gRPC API.
Build and refine unit tests for the login flow in Golang, covering invalid requests, global and user repos, error handling, and token generation.
Test the login auth endpoint in a Golang gRPC API by verifying authentication, using a sample user and credentials, and validating the service response.
Explore how gRPC authentication works in Go, focusing on passing data through parameters and returns to endpoints, and how tokens, JWTs, and validation shape secure remote calls.
Learn to secure a Golang gRPC API by adding a JWT field to routes and implementing interceptors to enforce authentication on sensitive operations like read and update.
In this course, you will learn how to create gRPC API's using Golang. You will learn production ready techniques to put you at the top of Golang gRPC programmers. We will learn how to get 100% coverage from all of our models and endpoints. We will also build unary and stream interceptors. We will also explore sqlmock and how it can help us achieve 100% coverage. We will build our own mock files from our models. Come and explore the new and excited gRPC with me!
I've added a lecture on querying gRPC services using VueJS and gRPC-web.