{"id":18336931,"url":"https://github.com/gogolcorp/go-yave","last_synced_at":"2025-04-06T04:36:02.975Z","repository":{"id":40493528,"uuid":"353732496","full_name":"gogolcorp/go-yave","owner":"gogolcorp","description":"🥭 | A Golang repository template with conventions, guidelines, project folder structure, Dockerization, CI/CD, labeler, releaser, automation [...] and some more, to start a new Go project in SECONDS. ","archived":false,"fork":false,"pushed_at":"2022-11-30T17:52:56.000Z","size":3083,"stargazers_count":19,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-03-21T17:37:02.253Z","etag":null,"topics":["ci-cd","commit-conventions","conventions","custom-labels","docker","golang","goyave","guidelines-template","issue-template","labeler","project-layout","releaser","repository-template"],"latest_commit_sha":null,"homepage":"","language":"HCL","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/gogolcorp.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}},"created_at":"2021-04-01T14:46:45.000Z","updated_at":"2024-11-15T09:18:00.000Z","dependencies_parsed_at":"2023-01-22T04:51:32.539Z","dependency_job_id":null,"html_url":"https://github.com/gogolcorp/go-yave","commit_stats":null,"previous_names":["blyndusk/repo-template","blyndusk/go-yave"],"tags_count":10,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogolcorp%2Fgo-yave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogolcorp%2Fgo-yave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogolcorp%2Fgo-yave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gogolcorp%2Fgo-yave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gogolcorp","download_url":"https://codeload.github.com/gogolcorp/go-yave/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247435040,"owners_count":20938530,"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":["ci-cd","commit-conventions","conventions","custom-labels","docker","golang","goyave","guidelines-template","issue-template","labeler","project-layout","releaser","repository-template"],"created_at":"2024-11-05T20:09:30.299Z","updated_at":"2025-04-06T04:35:57.950Z","avatar_url":"https://github.com/gogolcorp.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/logo.png\" width=\"256\"\u003e\u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://github.com/gogolcorp/go-yave/releases\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/v/release/gogolcorp/go-yave\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gogolcorp/go-yave/commits/main\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/release-date/gogolcorp/go-yave\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gogolcorp/go-yave/issues\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/issues/gogolcorp/go-yave\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gogolcorp/go-yave/pulls\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/issues-pr/gogolcorp/go-yave\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/gogolcorp/go-yave/blob/main/LICENSE\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/gogolcorp/go-yave\"/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/gogolcorp/go-yave/actions/workflows/web.ci.yml\"\u003e\n      \u003cimg src=\"https://github.com/gogolcorp/go-yave/actions/workflows/web.ci.yml/badge.svg\"/\u003e\n    \u003c/a\u003e\n       \u003ca href=\"https://github.com/gogolcorp/go-yave/actions/workflows/web.cd.yml\"\u003e\n      \u003cimg src=\"https://github.com/gogolcorp/go-yave/actions/workflows/web.cd.yml/badge.svg\"/\u003e\n    \u003c/a\u003e\n     \u003ca href=\"https://github.com/gogolcorp/go-yave/actions/workflows/api.ci.yml\"\u003e\n      \u003cimg src=\"https://github.com/gogolcorp/go-yave/actions/workflows/api.ci.yml/badge.svg\"/\u003e\n    \u003c/a\u003e\n     \u003ca href=\"https://github.com/gogolcorp/go-yave/actions/workflows/api.cd.yml\"\u003e\n      \u003cimg src=\"https://github.com/gogolcorp/go-yave/actions/workflows/api.cd.yml/badge.svg\"/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/creating-a-repository-from-a-template\"\u003eHow to use this repo as a template for your project\u003c/a\u003e\n\u003c/p\u003e\n\n## I - Introduction\n\nThe purpose of this repository is to provide a **solid**, **complete** and **adaptable** base of a [Golang](https://golang.org/)-oriented product in a **project-managed** repository, in order to start a new project with a **maximum time saving**.\n\nThis repository provides **commit writting** and **branch naming conventions**, **issues** and **pull request templates**, and a **custom issues labels preset**.\n\nBut also **CI/CD** and **release** using [GitHub Actions](https://github.com/features/actions), [GitHub Container Registry](https://github.com/features/packages) and [Docker](https://www.docker.com/).\n\nAnd finally, a simple **RESTful API**, using [Golang](https://golang.org/), [Postgres](https://www.postgresql.org/) and [Adminer](https://www.adminer.org/), build with [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/), using a [Makefile](\u003chttps://en.wikipedia.org/wiki/Make_(software)\u003e).\n\n\u003e This repository gathers all the good practices that I have learned over time, both in terms of **organization** and **good maintenance** of a project over time as well as in terms of **automation, availability** and **consistancy**.\n\n## II - Table of content\n\n- [I - Introduction](#i---introduction)\n- [II - Table of content](#ii---table-of-content)\n- [III - Folder structure](#iii---folder-structure)\n- [IV - Conventions, templates and labels](#iv---conventions-templates-and-labels)\n  - [A - Commit conventions](#a---commit-conventions)\n  - [B - Branch naming convention](#b---branch-naming-convention)\n  - [C - Issue template](#c---issue-template)\n  - [D - Pull request template](#d---pull-request-template)\n  - [E - Custom issues labels preset](#e---custom-issues-labels-preset)\n- [V - CI/CD, release and container registry](#v---cicd-release-and-container-registry)\n  - [A - CI](#a---ci)\n  - [B - CD](#b---cd)\n  - [C - Release](#c---release)\n  - [D - Labeler](#d---labeler)\n- [VI - Project setup](#vi---project-setup)\n  - [A - Stack](#a---stack)\n  - [B - Makefile](#b---makefile)\n- [VII - Contributing](#vii---contributing)\n- [VIII - License](#viii---license)\n\n## III - Folder structure\n\nThe structure of this project follows [these conventions](https://github.com/golang-standards/project-layout).\n\n- `/.github`: Conventions, template, labels, ci, cd, settings\n- `/cmd`: main files\n- `/build`: Dockerfiles\n- `/config`: Environment files\n- `/deploy`: Docker Compose files\n- `/internal`: \"private\" code\n- `/pkg`: \"public\" code\n- `/scripts`: Makefile bash scripts for setup/install/start\n\n## IV - Conventions, templates and labels\n\n### A - Commit conventions\n\n```\ntag(scope): #issue_id - message\n```\n\nSee [COMMIT_CONVENTIONS.md](assets/docs/COMMIT_CONVENTIONS.md) for more informations.\n\n### B - Branch naming convention\n\n```\ntype_scope-of-the-work\n```\n\nSee [BRANCH_NAMING_CONVENTIONS.md](assets/docs/BRANCH_NAMING_CONVENTIONS.md) for more informations.\n\n### C - Issue template\n\nSee [user-story.md](.github/ISSUE_TEMPLATE/user-story.md) for more informations.\n\n### D - Pull request template\n\nSee [pull_request_template.md](.github/pull_request_template.md) for more informations.\n\n### E - Custom issues labels preset\n\nThe labels preset is located at [.github/settings.yml](.github/settings.yml).\n\nYou can **add, edit or remove** them. To automatically update these labels, you need to **install** the [\"Settings\" GitHub app](https://github.com/apps/settings), which will **syncs repository settings defined in the file above to your repository**.\n\n## V - CI/CD, release and container registry\n\n### A - CI\n\n[![GO](https://github.com/gogolcorp/go-yave/actions/workflows/ci.go.yml/badge.svg)](https://github.com/gogolcorp/go-yave/actions/workflows/ci.go.yml)\n\nThe **CI** workflow is located at [.github/workflows/ci.go.yml](.github/workflows/ci.go.yml). It's triggered a **each push** on **all branches**.\n\nIt consist of:\n\n- **install Golang** on the VM\n- get the dependancies **using the cache of other Actions run**\n- **lint the files** to check or syntax errors\n- **build** the application\n\n### B - CD\n\n[![DOCKER](https://github.com/gogolcorp/go-yave/actions/workflows/cd.docker.yml/badge.svg)](https://github.com/gogolcorp/go-yave/actions/workflows/cd.docker.yml)\n\nThe **CD** workflow is located at [.github/workflows/cd.docker.yml](.github/workflows/cd.docker.yml). It's triggered a **each push** on **`main` branch**.\n\nIt consist of:\n\n- **login** into the GitHub container registry (ghcr.io)\n- **build and push** the Golang api using the **production Dockerfile** located at [build/pakage/sample-api/Dockerfile](build/pakage/sample-api/Dockerfile)\n\nAfter that, you can check the **pushed container** at: `https://github.com/\u003cusername\u003e?tab=packages\u0026repo_name=\u003crepository-name\u003e`\n\n\u003e IMPORTANT: you need to **update the production Dockerfile** with your **username** AND **_repository name_**. Otherwise, there will be errors at push:\n\n```bash\nLABEL org.opencontainers.image.source = \"https://github.com/\u003cusername\u003e/\u003crepository-name\u003e\"\n```\n\n### C - Release\n\n[![RELEASE](https://github.com/gogolcorp/go-yave/actions/workflows/md.release.yml/badge.svg)](https://github.com/gogolcorp/go-yave/actions/workflows/md.release.yml)\n\nThe **release** workflow is located at [.github/workflows/md.release.yml](.github/workflows/md.release.yml). It's triggered **manually by user input** at: [Actions \u003e RELEASE](https://github.com/gogolcorp/go-yave/actions/workflows/md.release.yml).\n\n\u003e IMPORTANT: you need to set the **image tag** in the action input, for the action to be able to push the docker image and create a release **with a specific version**. The image tag is a [SemVer](https://en.wikipedia.org/wiki/Software_versioning) tag, e.g. `1.0.2`.\n\nIt consist of:\n\n- check if the **environment match the branch**\n- do the CD (docker) action again, but **with a specific image tag**\n- create a release **with the same tag**, filled with the **generated changelog as closed issues since the last release**\n\nAfter that, you can check the release at `https://github.com/\u003cusername\u003e/\u003crepository-name\u003e/releases`.\n\n### D - Labeler\n\n[![LABELER](https://github.com/gogolcorp/go-yave/actions/workflows/ci.labeler.yml/badge.svg)](https://github.com/gogolcorp/go-yave/actions/workflows/ci.labeler.yml)\n\nThe **labeler** workflow consists in **assigning specific labels** on **pull requests** according to the files that have been modified in the **commits attached to this pull request**.\n\n\n## VI - Project setup\n\nThe project use **Docker** and **Docker Compose** to build and run local and distant images in our workspace.\n\n### A - Stack\n\nAll the images use the **same network**, more informations at [docker-compose.yml](docker-compose.yml)\n\n| CONTAINER | PORT        | IMAGE                                                                    |\n| :-------- | :---------- | :----------------------------------------------------------------------- |\n| GOLANG    | `3333:3333` | [build/pakage/sample-api/Dockerfile](build/pakage/sample-api/Dockerfile) |\n| ADMINER   | `3334:8080` | [build/package/adminer/Dockerfile](build/package/adminer/Dockerfile)     |\n| POSTGRES  | `5432:5432` | [postgres:latest](https://hub.docker.com/_/postgres)                     |\n\n\u003e Adminer is a GUI that allows us to **manage your database** by permetting to to **create, edit, delete** the different entities, tables, etc.\n\n### B - Makefile\n\n#### TL;DR \u003c!-- omit in toc --\u003e\n\n```bash\nmake setup-env start logs\n```\n\n#### `make help` \u003c!-- omit in toc --\u003e\n\n**Display** informations about other commands.\n\n#### `make setup-env` \u003c!-- omit in toc --\u003e\n\n**Copy** the sample environment files.\n\n#### `make start` \u003c!-- omit in toc --\u003e\n\nUp the containers with **full cache reset** to avoid cache errors.\n\n#### `make stop` \u003c!-- omit in toc --\u003e\n\n**Down** the containers.\n\n#### `make logs` \u003c!-- omit in toc --\u003e\n\n**Display and follow** the logs.\n\n#### `make lint` \u003c!-- omit in toc --\u003e\n\n**Lint** the Go files using `gofmt`.\n\n## VII - Contributing\n\nSee [CONTRIBUTING.md](assets/docs/CONTRIBUTING.md) for more informations.\n\n## VIII - License\n\nUnder [MIT](./LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgogolcorp%2Fgo-yave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgogolcorp%2Fgo-yave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgogolcorp%2Fgo-yave/lists"}