{"id":14987634,"url":"https://github.com/gbrayhan/microservices-go","last_synced_at":"2025-05-15T11:06:35.047Z","repository":{"id":41361607,"uuid":"240394317","full_name":"gbrayhan/microservices-go","owner":"gbrayhan","description":"Golang Microservice Boilerplate using MySQL, Docker and Swagger, API REST. Gin Go and GORM with pagination and implementation of a Clean Architecture.","archived":false,"fork":false,"pushed_at":"2025-04-28T17:46:15.000Z","size":444,"stargazers_count":609,"open_issues_count":1,"forks_count":69,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-28T17:46:52.982Z","etag":null,"topics":["boilerplate","boilerplate-go","boilerplate-golang","boilerplate-microservice","clean-architecture","docker","gin","go","golang","golang-examples","gorm","hexagonal-architecture","jwt","microservices-architecture","pagination","rest-api","swagger"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbrayhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["gbrayhan"],"patreon":"BossonH","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2020-02-14T00:14:43.000Z","updated_at":"2025-04-28T17:45:12.000Z","dependencies_parsed_at":"2024-05-07T03:26:57.289Z","dependency_job_id":"84925f5d-7c6a-4db0-9a27-b78b221775d9","html_url":"https://github.com/gbrayhan/microservices-go","commit_stats":{"total_commits":71,"total_committers":12,"mean_commits":5.916666666666667,"dds":0.5070422535211268,"last_synced_commit":"17714e86b0d085a8d083a9fe24cfd166d71856e8"},"previous_names":[],"tags_count":4,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbrayhan%2Fmicroservices-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbrayhan%2Fmicroservices-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbrayhan%2Fmicroservices-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbrayhan%2Fmicroservices-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbrayhan","download_url":"https://codeload.github.com/gbrayhan/microservices-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328385,"owners_count":22052632,"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":["boilerplate","boilerplate-go","boilerplate-golang","boilerplate-microservice","clean-architecture","docker","gin","go","golang","golang-examples","gorm","hexagonal-architecture","jwt","microservices-architecture","pagination","rest-api","swagger"],"created_at":"2024-09-24T14:15:04.968Z","updated_at":"2025-05-15T11:06:35.041Z","avatar_url":"https://github.com/gbrayhan.png","language":"Go","funding_links":["https://github.com/sponsors/gbrayhan","https://patreon.com/BossonH"],"categories":[],"sub_categories":[],"readme":"# Golang Microservices Boilerplate - Clean Architecture\n\n[![issues](https://img.shields.io/github/issues/gbrayhan/microservices-go)](https://github.com/gbrayhan/microservices-go/tree/master/.github/ISSUE_TEMPLATE)\n[![forks](https://img.shields.io/github/forks/gbrayhan/microservices-go)](https://github.com/gbrayhan/microservices-go/network/members)\n[![stars](https://img.shields.io/github/stars/gbrayhan/microservices-go)](https://github.com/gbrayhan/microservices-go/stargazers)\n[![license](https://img.shields.io/github/license/gbrayhan/microservices-go)](https://github.com/gbrayhan/microservices-go/tree/master/LICENSE)\n[![CodeFactor](https://www.codefactor.io/repository/github/gbrayhan/microservices-go/badge/main)](https://www.codefactor.io/repository/github/gbrayhan/microservices-go/overview/main)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/6c10cc49928447f38952edaab67a94a4)](https://www.codacy.com/gh/gbrayhan/microservices-go/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=gbrayhan/microservices-go\u0026amp;utm_campaign=Badge_Grade)\n\nExample structure to start a microservices project with golang. Using a MySQL databaseSQL. Using a Hexagonal\nArchitecture tha is a Clean Architecture.\n\n## Manual Installation\n\nIf you would still prefer to do the installation manually, follow these steps:\n\nClone the repo:\n\n```bash\ngit clone https://github.com/gbrayhan/microservices-go\n```\n\n\n**TL;DR command list**\n\n    git clone https://github.com/gbrayhan/microservices-go\n    cd microservices-go\n    cp .env.example .env\n    docker-compose up  --build  -d\n\n## Table of Contents\n\n- [Features](#features)\n- [Commands](#commands)\n- [Environment Variables](#environment-variables)\n- [Project Structure](#project-structure)\n- [API Documentation](#api-documentation)\n- [Error Handling](#error-handling)\n- [Validation](#validation)\n- [Linting](#linting)\n\n## Features\n\n- **Golang v1.24.2**: Stable version of go\n- **Framework**: A stable version of [gin-go](https://github.com/gin-gonic/gin)\n- **Token Security**: with [JWT](https://jwt.io)\n- **SQL databaseSQL**: [Postgresql](https://www.postgresql.org/) using internal sql package of\n  go [sql](https://golang.org/pkg/databaseSQL/sql/)\n- **Testing**: unit and integration tests using package of go [testing](https://golang.org/pkg/testing/)\n- **API documentation**: with [swaggo](https://github.com/swaggo/swag) @latest version that is a go implementation\n  of [swagger](https://swagger.io/)\n- **Dependency management**: with [go modules](https://golang.org/ref/mod)\n- **Docker support**\n- **Code quality**: with [CodeFactor](https://www.codefactor.io/) and [Codacy](https://www.codacy.com/)\n- **Linting**: with [golangci-lint](https://golangci-lint.run/usage/install/) an implementation of a Golang linter\n\n\n## Security Checks using Trivy\n\nhttps://github.com/aquasecurity/trivy?tab=readme-ov-file\n\ncommand:\n```bash\ntrivy fs . \n```\n\n## Commands\n\n### Build and run image of docker\n\n```bash\ndocker-compose up  --build  -d\n```\n\n### Swagger Implementation\n\n```bash\nswag init -g src/infrastructure/rest/routes/routes.go\n```\n\nTo visualize the swagger documentation on local use\n\nhttp://localhost:8080/v1/swagger/index.html\n\nTo see the postman collection use \n  \nhttps://www.postman.com/kts-mexico/workspace/boilerplategomicroservice\n\n\n### Unit test command\n\n```bash\n# run recursive test\ngo test  ./test/unit/...\n# clean go test results in cache\ngo clean -testcache\n```\n\n### Lint inspection of go\n\n```bash\ngolangci-lint run ./...\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbrayhan%2Fmicroservices-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbrayhan%2Fmicroservices-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbrayhan%2Fmicroservices-go/lists"}