{"id":21801099,"url":"https://github.com/wpcodevo/golang-mongodb-api","last_synced_at":"2025-05-07T17:50:03.096Z","repository":{"id":44432512,"uuid":"492490703","full_name":"wpcodevo/golang-mongodb-api","owner":"wpcodevo","description":"In this article, you'll learn how to implement JWT access and refresh tokens with gRPC using Golang, MongoDB-Go-driver, Gomail, Docker, and Docker-compose.","archived":false,"fork":false,"pushed_at":"2024-03-30T11:35:34.000Z","size":139,"stargazers_count":171,"open_issues_count":1,"forks_count":53,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T17:49:56.795Z","etag":null,"topics":["crud","crud-api","gin","go","golang","grpc","grpc-client","grpc-go","grpc-server","jwt","mongodb","rest","restful","restful-api"],"latest_commit_sha":null,"homepage":"https://codevoweb.com/crud-grpc-server-api-client-with-golang-and-mongodb","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wpcodevo.png","metadata":{"files":{"readme":"readMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-15T13:11:11.000Z","updated_at":"2025-04-12T11:18:21.000Z","dependencies_parsed_at":"2025-01-10T09:32:38.705Z","dependency_job_id":null,"html_url":"https://github.com/wpcodevo/golang-mongodb-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Fgolang-mongodb-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Fgolang-mongodb-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Fgolang-mongodb-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpcodevo%2Fgolang-mongodb-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpcodevo","download_url":"https://codeload.github.com/wpcodevo/golang-mongodb-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931391,"owners_count":21827104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crud","crud-api","gin","go","golang","grpc","grpc-client","grpc-go","grpc-server","jwt","mongodb","rest","restful","restful-api"],"created_at":"2024-11-27T11:16:17.447Z","updated_at":"2025-05-07T17:50:03.065Z","avatar_url":"https://github.com/wpcodevo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Build gRPC Server API \u0026 Client with Golang and MongoDB\n\n## 1. API with Golang + MongoDB + Redis + Gin Gonic: Project Setup\n\nIn this article, you'll learn how to set up a Golang application with MongoDB-Go-driver, Gin Gonic, and Go Redis. Later, we'll access both the Redis and MongoDB databases directly in VS Code using a MySQL VS Code extension.\n\n![API with Golang + MongoDB + Redis + Gin Gonic: Project Setup](https://codevoweb.com/wp-content/uploads/2022/05/API-with-Golang-MongoDB-Redis-and-Gin-Gonic-Project-Setup.webp)\n\n### Topics Covered\n\n- Setup Golang with MongoDB and Redis\n- Creating MongoDB and Redis Database with Docker-compose\n- Setup Environment Variables\n- How to Connect Golang App to Redis and MongoDB\n- Test the Golang API\n- How to Connect to MongoDB and Redis Servers in VS Code\n\nRead the entire article here: [https://codevoweb.com/api-golang-mongodb-gin-gonic-project-setup](https://codevoweb.com/api-golang-mongodb-gin-gonic-project-setup)\n\n\n## 2. Golang \u0026 MongoDB: JWT Authentication and Authorization\n\nIn this article, you'll learn how to implement RS256 JWT (JSON Web Token) Authentication and Authorization with Golang, Gin Gonic, MongoDB-Go-driver, and Docker-compose.\n\n![Golang \u0026 MongoDB: JWT Authentication and Authorization](https://codevoweb.com/wp-content/uploads/2022/05/Golang-and-MongoDB-JWT-Authentication-and-Authorization.webp)\n\n### Topics Covered\n\n- Golang \u0026 MongoDB JWT Authentication Overview\n- JWT Authentication Example with Golang and MongoDB\n- How to Generate Public and Private Keys\n- Update Environment Variables with Viper\n- Creating the User models with structs\n- Creating an Auth and User Interfaces\n    - Authentication Interface\n    - User Interface\n- Create utility functions to hash and verify password\n- Create services that interact with the database\n    - Auth interface implementation\n    - User interface implementation\n- Create a utility function to sign and verify JWT tokens\n    - Create Json Web Token\n    - Verify JSON Web Token\n- Create the authentication controllers\n    - Signup user controller\n    - Login user controller\n    - Refresh access token controller\n    - Logout user controller\n- Authentication Middleware Guard\n- Create the user controllers\n- Create API Routes with Gin\n    - Auth Routes\n    - User Routes\n- Add the Routes to the Gin Middleware Pipeline\n\nRead the entire article here: [https://codevoweb.com/golang-mongodb-jwt-authentication-authorization](https://codevoweb.com/golang-mongodb-jwt-authentication-authorization)\n\n## 3. API with Golang + MongoDB: Send HTML Emails with Gomail\n\nIn this article, you'll learn how to send HTML emails with Golang, Gomail, MongoDB-Go-Driver, Redis, and Docker-compose. Also, you'll learn how to generate HTML templates with the standard Golang html/template package.\n\n![API with Golang + MongoDB: Send HTML Emails with Gomail](https://codevoweb.com/wp-content/uploads/2022/05/API-with-Golang-MongoDB-Send-HTML-Emails-with-Gomail.webp)\n\n### Topics Covered\n\n- Send Emails with Golang, MongoDB, and Gomail Overview\n- Creating the HTML Email Templates with Golang\n- Create an SMTP Provider Account\n- Load and Validate Environment Variables Viper\n- Create a Utility Function to Send the Emails\n- Update the SignUp Controller\n\nRead the entire article here: [https://codevoweb.com/api-golang-mongodb-send-html-emails-gomail](https://codevoweb.com/api-golang-mongodb-send-html-emails-gomail)\n\n\n## 4. API with Golang, Gin Gonic \u0026 MongoDB: Forget/Reset Password\n\nIn this article, you'll learn how to implement forget/reset password functionality with Golang, Gin Gonic, Gomail, MongoDB-Go-driver, Redis, and Docker-compose. \n\n![API with Golang, Gin Gonic \u0026 MongoDB: Forget/Reset Password](https://codevoweb.com/wp-content/uploads/2022/05/API-with-Golang-Gin-Gonic-MongoDB-Forget-Reset-Password.webp)\n\n### Topics Covered\n\n- Forget/Reset Password with Golang, Gin, and MongoDB\n- Create the MongoDB Model Structs\n- Create the HTML Email Templates with Golang\n- Define a Utility Function to Parse the HTML Templates\n- Create a Function to Send the HTML Emails\n- Add the Forgot Password Controller\n- Add the Reset Password Controller\n- Register the Gin API Routes\n\nRead the entire article here: [https://codevoweb.com/api-golang-gin-gonic-mongodb-forget-reset-password](https://codevoweb.com/api-golang-gin-gonic-mongodb-forget-reset-password)\n\n\n## 5. Build Golang gRPC Server and Client: SignUp User \u0026 Verify Email\n\nIn this article, you'll learn how to create a gRPC server to register a user and verify their email address using Golang, MongoDB-Go-driver, Gomail, and Docker-compose. \n\n![Build Golang gRPC Server and Client: SignUp User \u0026 Verify Email](https://codevoweb.com/wp-content/uploads/2022/05/Build-Golang-gRPC-Server-and-Client-SignUp-User-Verify-Email.webp)\n\n### Topics Covered\n\n- gRPC Project setup in Golang\n- Create the gRPC Request and Response Messages\n    - Define the gRPC User messages\n    - Define the gRPC Request and Response Message to SignUp User\n- Create the gRPC Service Methods\n- Generate the gRPC client and server interfaces\n- Start the gRPC Server\n- Test the gRPC API Server with Golang Evans\n- Create the gRPC API Controllers\n    - Register User gRPC Controller\n    - Verify User gRPC Controller\n- Create the gRPC Client to Register a User\n\nRead the entire article here: [https://codevoweb.com/golang-grpc-server-and-client-signup-user-verify-email](https://codevoweb.com/golang-grpc-server-and-client-signup-user-verify-email)\n\n## 6. Build Golang gRPC Server and Client: Access \u0026 Refresh Tokens\n\nIn this article, you'll learn how to implement JWT access and refresh tokens with gRPC using Golang, MongoDB-Go-driver, Gomail, Docker, and Docker-compose.\n\n![Build Golang gRPC Server and Client: Access \u0026 Refresh Tokens](https://codevoweb.com/wp-content/uploads/2022/05/Build-Golang-gRPC-Server-and-Client-Access-Refresh-Tokens.webp)\n\n### Topics Covered\n\n- Create the gRPC Request and Response Messages\n    - Create the gRPC User messages\n    - Define the gRPC Request and Response Message to Login User\n    - Update the Authentication gRPC Service\n    - Create a gRPC User Service\n- Create the gRPC Controllers\n- Create the gRPC Servers\n- Register the gRPC Servers\n- Create the gRPC Clients in Golang\n- Connect the gRPC Client to the gRPC Server\n\nRead the entire article here: [https://codevoweb.com/golang-grpc-server-and-client-access-refresh-tokens](https://codevoweb.com/golang-grpc-server-and-client-access-refresh-tokens)\n\n## 7. Build CRUD RESTful API Server with Golang, Gin, and MongoDB\n\nIn this article, you'll learn how to build a CRUD RESTful API server with Golang, Gin Gonic, MongoDB-Go-driver, Docker, and Docker-compose.\n\n![Build CRUD RESTful API Server with Golang, Gin, and MongoDB](https://codevoweb.com/wp-content/uploads/2022/05/Build-CRUD-RESTful-API-Server-with-Golang-Gin-and-MongoDB.webp)\n\n### Topics Covered\n\n- Golang, Gin Gonic, MongoDB CRUD RESTful API Overview\n- Create the Models with Structs\n- Create the Service Interface\n- Create Methods to Implement the Interface\n    - Initialize the Service Struct\n    - Define a Service to Create a Post\n    - Define a Service to Update Post\n    - Define a Service to Delete Post\n    - Define a Service to Get Single Post\n    - Define a Service to Get All Posts\n- Create Controllers to Perform the CRUD Operations\n    - Initialize the Controller Struct\n    - Define a Controller to Create a Post\n    - Define a Controller to Update a Post\n    - Define a Controller to Delete a Post\n    - Define a Controller to Get a Single Post\n    - Define a Controller to Get All Posts\n- Create the Routes for the Controllers\n- Initialize the Constructors and Start the Gin Server\n\nRead the entire article here: [https://codevoweb.com/crud-restful-api-server-with-golang-and-mongodb](https://codevoweb.com/crud-restful-api-server-with-golang-and-mongodb)\n\n\n## 8. Build CRUD gRPC Server API \u0026 Client with Golang and MongoDB\n\nIn this article, you'll learn how to build a CRUD gRPC API server with Golang, MongoDB-Go-driver, and Docker-compose. You'll also build a gRPC client to interact with the gRPC API.\n\n![Build CRUD gRPC Server API \u0026 Client with Golang and MongoDB](https://codevoweb.com/wp-content/uploads/2022/06/Build-CRUD-gRPC-Server-API-Client-with-Golang-and-MongoDB.webp)\n\n### Topics Covered\n\n- Define the Models with Structs\n- Create the ProtoBuf Messages\n- Define the gRPC Service and RPC Methods\n- Define a Custom Service Interface\n- Create Methods to Implement the Service Interface\n    - Create a Constructor to Implement the Service Interface\n    - Create a new Post\n    - Update a Post\n    - Find a Post\n    - Retrieve All Posts\n    - Delete a Post\n- Define the gRPC Controllers\n- Register the gRPC Services and Start the gRPC Server\n- Test the gRPC API Server with Evans CLI\n- Create the gRPC API Handlers in Golang\n    - CreatePost gRPC Handler\n    - UpdatePost gRPC Service Handler\n    - GetPost gRPC Service Handler \n    - DeletePost gRPC Service Handler\n    - GetPosts gRPC Service Handler\n- Testing the gRPC Services with Evans Cli\n- Create the gRPC Clients\n    - gRPC Client to Create a Post\n    - gRPC Client to Update a Post\n    - gRPC Client to Get a Single Post\n    - gRPC Client to Get All Posts\n    - gRPC Client to Delete a Post\n- Register the gRPC Services\n\nRead the entire article here: [https://codevoweb.com/crud-grpc-server-api-client-with-golang-and-mongodb](https://codevoweb.com/crud-grpc-server-api-client-with-golang-and-mongodb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpcodevo%2Fgolang-mongodb-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpcodevo%2Fgolang-mongodb-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpcodevo%2Fgolang-mongodb-api/lists"}