{"id":21149941,"url":"https://github.com/nicklaswallgren/go-template","last_synced_at":"2025-10-08T05:15:57.121Z","repository":{"id":37969922,"uuid":"477352153","full_name":"NicklasWallgren/go-template","owner":"NicklasWallgren","description":"Go-template is an opinionated Hexagonal backend template written in GO.","archived":false,"fork":false,"pushed_at":"2023-03-20T22:06:33.000Z","size":1032,"stargazers_count":27,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-09T09:44:00.013Z","etag":null,"topics":["boilerplate","clean-architecture","gin","go","go-template","golang","golang-application","gorm","gorm-orm","hexagonal-architecture","swagger","template"],"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/NicklasWallgren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-04-03T13:37:40.000Z","updated_at":"2024-12-23T09:00:53.000Z","dependencies_parsed_at":"2024-06-19T16:02:23.753Z","dependency_job_id":"9d000445-892c-4682-b490-f63e3b898ecd","html_url":"https://github.com/NicklasWallgren/go-template","commit_stats":{"total_commits":81,"total_committers":3,"mean_commits":27.0,"dds":0.2222222222222222,"last_synced_commit":"d389d3b8415ef18434f334641af80dd54118b353"},"previous_names":[],"tags_count":2,"template":true,"template_full_name":null,"purl":"pkg:github/NicklasWallgren/go-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicklasWallgren%2Fgo-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicklasWallgren%2Fgo-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicklasWallgren%2Fgo-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicklasWallgren%2Fgo-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NicklasWallgren","download_url":"https://codeload.github.com/NicklasWallgren/go-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicklasWallgren%2Fgo-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278891753,"owners_count":26063858,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","clean-architecture","gin","go","go-template","golang","golang-application","gorm","gorm-orm","hexagonal-architecture","swagger","template"],"created_at":"2024-11-20T09:48:12.808Z","updated_at":"2025-10-08T05:15:57.081Z","avatar_url":"https://github.com/NicklasWallgren.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpre\u003e\n██████╗  ██████╗     ████████╗███████╗███╗   ███╗██████╗ ██╗      █████╗ ████████╗███████╗\n██╔════╝ ██╔═══██╗    ╚══██╔══╝██╔════╝████╗ ████║██╔══██╗██║     ██╔══██╗╚══██╔══╝██╔════╝\n██║  ███╗██║   ██║       ██║   █████╗  ██╔████╔██║██████╔╝██║     ███████║   ██║   █████╗\n██║   ██║██║   ██║       ██║   ██╔══╝  ██║╚██╔╝██║██╔═══╝ ██║     ██╔══██║   ██║   ██╔══╝\n╚██████╔╝╚██████╔╝       ██║   ███████╗██║ ╚═╝ ██║██║     ███████╗██║  ██║   ██║   ███████╗\n╚═════╝  ╚═════╝        ╚═╝   ╚══════╝╚═╝     ╚═╝╚═╝     ╚══════╝╚═╝  ╚═╝   ╚═╝   ╚══════╝\n\u003c/pre\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"resources/assets/gophere_logo.png\" width=\"125\"\u003e\n\u003c/p\u003e\n\n[![Build Status](https://github.com/NicklasWallgren/go-template/workflows/Test/badge.svg)](https://github.com/NicklasWallgren/go-template/actions?query=workflow%3ATest)\n[![Reviewdog](https://github.com/NicklasWallgren/go-template/workflows/reviewdog/badge.svg)](https://github.com/NicklasWallgren/go-template/actions?query=workflow%3Areviewdog)\n[![Go Report Card](https://goreportcard.com/badge/github.com/NicklasWallgren/go-template)](https://goreportcard.com/report/github.com/NicklasWallgren/go-template)\n[![GoDoc](https://godoc.org/github.com/NicklasWallgren/go-template?status.svg)](https://godoc.org/github.com/NicklasWallgren/go-template)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cabd5fbbcde543ec959fb4a3581600ed)](https://app.codacy.com/gh/NicklasWallgren/go-template?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=NicklasWallgren/go-template\u0026utm_campaign=Badge_Grade)\n\n# Go Template - Hexa(go)nal architecture based on DDD\n\nGo-template is an opinionated Hexagonal backend template written in GO.\n\n## Architecture\n\nThe template is inspired by:\n - Hexagonal Architecture (also known as Port And Adapters)\n - Domain-Driven Design (DDD)\n - Clean Architecture\n - SOLID Principles\n - 12 Factor Methodology\n\n## Features\n\n- Provides database migration with [pressly/gooose](https://github.com/pressly/goose).\n- Integrates [go-swagger](https://github.com/go-swagger/go-swagger) for compile-time generation of swagger.(yml|json).\n- Integrates [SwaggerUI](https://github.com/swagger-api/swagger-ui) for live-previewing Swagger v2 schema.\n- Comes with an initial MariaDB and Postgres database structure (\n  see [migrations](https://github.com/NicklasWallgren/go-template/tree/main/resources/database/migrations))\n- API endpoints for health and readiness probes.\n- Easily testable. Integration tests with support for snapshots.\n- Mocks via [mockery](https://github.com/vektra/mockery)\n- K8s manifest files.\n- Provides support for parallel database integration tests.\n- Comes with support for AMQP publisher and consumer (via RabbitMQ).\n- Various convenience scripts via `Makefile`.\n- Multi-staged Dockerfile with support for BuildX for faster builds.\n- CLI Layer which is easily extensible (and provided by spf13/cobra)\n    - Command to handle migrations (migration).\n    - Command to serve the http server.\n    - Command to launch amqp consumer.\n- Support for observability via [dd-trace-go](https://github.com/DataDog/dd-trace-go/)\n- Dependency injection via [fx](https://github.com/uber-go/fx)\n\n## Prerequisites\n\nRequires the following prerequisites for development in a local environment\n\n- Docker CE (v20.10+)\n- Docker Compose (v1.27+)\n- Go 1.19\n\n## Quickstart\nInitialize a new git repository through [GitHub Template feature](https://github.com/allaboutapps/go-starter/generate)\n\n```bash \n# Clone the repository and then start the dev environment through the Makefile\nmake\n```\n\n## Merge with the repository to get future updates\n```bash\ngit merge --no-commit --no-ff --allow-unrelated-histories NicklasWallgren/go-template\n```\n\n## Set the custom project name\n```bash\nfind . -not -path '*/\\.*' -type f -exec sed -i \"\" \"s|github.com/NicklasWallgren/go-template|\u003cREPLACE\u003e|g\" {} \\;\n```\n\n## CLI\n```bash\n# Start the HTTP server\ngo-template start\n# Start the AMQP consumers\ngo-template start-consumers\n# Create a new migration file\ngo-template migrate --create \u003cNAME\u003e\n# Rollup migrations\ngo-template migrate --up\n```\n\n## Re-generate mocks \n```bash\nmockery --all --output ./tests/mocks --keeptree --case underscore --with-expecter\n```\n\n### Backlog\n- Use https://github.com/RichardKnop/machinery for queue handling\n- Implement gRPC api\n\n### Code Guide\n\nWe use GitHub Actions to make sure the codebase is consistent (`golangci-lint run`) and continuously tested (`go test $(go list ./...) -p 1`). We try to keep comments at a maximum of 120 characters of length and code at 120.\n\n## Contributing\nIf you find any problems or have suggestions about this template, please submit an issue. Moreover, any pull request, code review and feedback are welcome.\n\n## License\n[MIT](./LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicklaswallgren%2Fgo-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicklaswallgren%2Fgo-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicklaswallgren%2Fgo-template/lists"}