{"id":26502772,"url":"https://github.com/heppu/go-template","last_synced_at":"2026-04-09T09:50:28.277Z","repository":{"id":283077385,"uuid":"943076071","full_name":"heppu/go-template","owner":"heppu","description":"Template repo for Go project","archived":false,"fork":false,"pushed_at":"2025-03-18T13:15:57.000Z","size":807,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T13:27:51.702Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/heppu.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":"2025-03-05T06:04:59.000Z","updated_at":"2025-03-18T13:16:00.000Z","dependencies_parsed_at":"2025-03-18T13:29:30.396Z","dependency_job_id":"e8beab1d-64ff-4569-9470-808f91441b3c","html_url":"https://github.com/heppu/go-template","commit_stats":null,"previous_names":["heppu/go-template"],"tags_count":2,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fgo-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fgo-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fgo-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heppu%2Fgo-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heppu","download_url":"https://codeload.github.com/heppu/go-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244671106,"owners_count":20491133,"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":[],"created_at":"2025-03-20T18:33:48.817Z","updated_at":"2025-12-31T00:04:44.994Z","avatar_url":"https://github.com/heppu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/heppu/go-template.svg)](https://pkg.go.dev/github.com/heppu/go-template) [![codecov](https://codecov.io/github/heppu/go-template/graph/badge.svg?token=H3u7Ui9PfC)](https://codecov.io/github/heppu/go-template) ![main](https://github.com/heppu/go-template/actions/workflows/go.yaml/badge.svg?branch=main)\n\n# Go project template\n\nThis template provides a solid foundation for building scalable, observable, and maintainable Go services.\n\n## Getting started\n\n### Creating new project\n\n1. Fork this repo\n2. Create project repo using the fork as a template\n3. Clone the project repo and run `make -f rename.mk`\n4. Run `make all` to verify that everything works\n5. Create a PR see how the github workflow gets triggered\n\n### Adding endpoints\n\n1. Add paths and components in [server/openapi.yaml](server/openapi.yaml)\n2. Run `make generate`\n3. Implement missing methods in [app/app.go]\n\n### Adding tables\n\n1. Add new migration file `{NUM}_{NAME}.up.sql` eg `002_add_users_table.up.sql` under [store/migrations](store/migrations)\n2. Write `CREATE TABLE` statement in that file\n3. Now your migration is automatically applied when application starts\n\n### Example\n\nYou can test this with simple example spec by running:\n\n```sh\nmv ./server/openapi-simple.yaml ./server/openapi.yaml\nmake generate\n```\n\nAnd now just implement missing methods in `./app/app.go`.\n\n## Project layout\n\nThe template is structured to provide a solid foundation while allowing easy customization for your specific project needs.\n\n### Go files\n\n- `./api/` - rest api layer generated from [openapi.yaml](server/openapi.yaml)\n- `./app/` - business logic that maps to rest endpoints inside api\n- `./applicationtest/` - application/integration tests (tests executed against application binary)\n- `./cmd/demo/` - main package for application, automatically renamed based on repo name\n- `./server/` - configures http.Server with api handler\n- `./store/` - database layer with migration support\n- `./store/migrations/` - database schema migration files\n\n### Non Go files\n\n- `./.github/` - github actions workflow files\n- `./.golanci.yaml` - golangci-linter configuration\n- `./.ogen.yaml` - ogen generator configuration\n- `./.codecov.yml` - codecov configuration\n- `./server/openapi.yaml` - api specification\n- `./server/swaggerui` - swagger ui files\n- `./docker-compose.yaml` - configuration for services used in test\n- `./Dockerfile` - image definition for Go binaries\n- `./Makefile` - build tooling configuration\n- `./ci.mk` - build tooling configuration for CI only targets\n- `./rename.mk` - script to run rename after cloning initial template\n- `./telemetry/` - configuration for otel related tools\n- `./target/` - container for build and test artifacts\n\n## Tooling\n\n### Libraries\n\n- [go-srvc/srvc](https://github.com/go-srvc/srvc) - Service library for life cycle management\n- [go-srvc/mods](https://github.com/go-srvc/mods) - Ready made modules for srvc\n- [golang-migrate](https://github.com/go-tstr/tstr/) - Database migration management\n- [jmoiron/sqlx](https://github.com/jmoiron/sqlx) - Mapping data between structs and SQL\n- [go-tstr/tstr](https://github.com/go-tstr/tstr) - Testing library with application test support\n- [stretchr/testify](https://github.com/stretchr/testify) - Test assertions\n- [automaxprocs](github.com/uber-go/automaxprocs) - Set runtime CPU resources automatically\n- [automemlimit](github.com/KimMachineGun/automemlimit) - Set runtime MEM resources automatically\n\n### External Tools\n\n- [Make](https://www.gnu.org/software/make/) - Build automation\n- [Docker](https://docs.docker.com/engine/install/) - For containerization and local testing\n- [Docker Compose](https://docs.docker.com/compose/install/) - For local testing\n\n### Go Tools (using [go tool](https://go.dev/doc/modules/managing-dependencies#tools))\n\n- [golangci-lint](https://golangci-lint.run/) - Code quality and style enforcement\n- [gotestsum](https://github.com/gotestyourself/gotestsum) - Test output formatter\n- [ogen](https://ogen.dev/docs/intro) - OpenAPI code generation with observability and validation\n\n### CI\n\n- [GitHub Actions](https://docs.github.com/en/actions) - CI workflows\n- [Codecov](https://app.codecov.io/github/heppu/go-template) - Code coverage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheppu%2Fgo-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheppu%2Fgo-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheppu%2Fgo-template/lists"}