{"id":18655510,"url":"https://github.com/go-rel/gin-example","last_synced_at":"2025-10-07T13:48:35.725Z","repository":{"id":37332808,"uuid":"346731927","full_name":"go-rel/gin-example","owner":"go-rel","description":"Go Todo Backend Example Using Modular Project Layout for Product Microservice using Gin framework","archived":false,"fork":false,"pushed_at":"2024-08-20T14:15:30.000Z","size":16282,"stargazers_count":84,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-13T13:27:15.197Z","etag":null,"topics":["go","golang","hacktoberfest","project-template"],"latest_commit_sha":null,"homepage":"https://go-rel.github.io/","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/go-rel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"Fs02"}},"created_at":"2021-03-11T14:35:58.000Z","updated_at":"2025-07-01T03:31:06.000Z","dependencies_parsed_at":"2023-12-22T14:04:14.842Z","dependency_job_id":"ad49afd8-df50-47a4-8891-c3abcac17d19","html_url":"https://github.com/go-rel/gin-example","commit_stats":{"total_commits":106,"total_committers":4,"mean_commits":26.5,"dds":"0.21698113207547165","last_synced_commit":"9a44bfec8e3d7faf2682e2e9c9b935695468b7ab"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":"Fs02/go-todo-backend","purl":"pkg:github/go-rel/gin-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-rel%2Fgin-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-rel%2Fgin-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-rel%2Fgin-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-rel%2Fgin-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-rel","download_url":"https://codeload.github.com/go-rel/gin-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-rel%2Fgin-example/sbom","scorecard":{"id":432399,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-rel/gin-example","commit":"9a44bfec8e3d7faf2682e2e9c9b935695468b7ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":2,"reason":"Found 1/4 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/go-rel/gin-example/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/go-rel/gin-example/go.yml/master?enable=pin","Warn: containerImage not pinned by hash: deploy/api/Dockerfile:2","Warn: containerImage not pinned by hash: deploy/api/Dockerfile:14: pin your Docker image by updating alpine:3.11 to alpine:3.11@sha256:bcae378eacedab83da66079d9366c8f5df542d7ed9ab23bf487e3e1a8481375d","Warn: goCommand not pinned by hash: vendor/github.com/json-iterator/go/build.sh:10","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 2 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T03:41:18.989Z","repository_id":37332808,"created_at":"2025-08-19T03:41:18.989Z","updated_at":"2025-08-19T03:41:18.989Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278786691,"owners_count":26045588,"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-07T02:00:06.786Z","response_time":59,"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":["go","golang","hacktoberfest","project-template"],"created_at":"2024-11-07T07:19:10.160Z","updated_at":"2025-10-07T13:48:35.674Z","avatar_url":"https://github.com/go-rel.png","language":"Go","funding_links":["https://github.com/sponsors/Fs02"],"categories":[],"sub_categories":[],"readme":"# Gin + Rel Todo Backend Example\n\n[![GoDoc](https://godoc.org/github.com/go-rel/gin-example?status.svg)](https://godoc.org/github.com/go-rel/gin-example)\n[![Build Status](https://travis-ci.com/go-rel/gin-example.svg?branch=master)](https://travis-ci.com/go-rel/gin-example)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-rel/gin-example)](https://goreportcard.com/report/github.com/go-rel/gin-example)\n[![Maintainability](https://api.codeclimate.com/v1/badges/d506b5b2df687cbcd358/maintainability)](https://codeclimate.com/github/go-rel/gin-example/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/d506b5b2df687cbcd358/test_coverage)](https://codeclimate.com/github/go-rel/gin-example/test_coverage)\n\nGo Todo Backend Example Using Modular Project Layout for Product Microservice. It's suitable as starting point for a medium to larger project.\n\nThis example uses [Gin](https://github.com/gin-gonic/gin) for http router and [REL](https://github.com/go-rel/rel) for database access.\n\nFeature:\n\n- Modular Project Structure.\n- Full example including tests.\n- Docker deployment.\n- Compatible with [todobackend](https://www.todobackend.com/specs/index.html).\n\n## Installation\n\n### Prerequisite\n\n1. Install [mockery](https://github.com/vektra/mockery#installation) for interface mock generation.\n2. Install [rel cli](https://go-rel.github.io/migration/#running-migration) for database migration.\n\n### Running\n\n1. Prepare `.env`.\n    ```\n    cp .env.sample .env\n    ```\n2. Start mysql and create database. [^mac]\n   [^mac]: Regular MySQL Docker images are not built for the new Mac ARM processors. To use a MySQL docker image that works on ARM, you may update [docker-compose.yml#L5](docker-compose.yml#L5) to use a different one, such as `image: \"arm64v8/mysql:latest\"` instead of `image: \"mysql:latest\"`. See [Dockerhub arm64v8/mysql](https://hub.docker.com/r/arm64v8/mysql) for more details. \n    ```\n    docker-compose up -d\n    ```\n2. Prepare database schema.\n    ```\n    rel migrate\n    ```\n3. Build and Running\n    ```\n    make\n    ```\n\n## Project Structure\n\n```\n.\n├── api\n│   ├── handler\n│   │   ├── todos.go\n│   │   └── [other handler].go\n│   └── middleware\n│       └── [other middleware].go\n├── bin\n│   ├── api\n│   └── [other executable]\n├── cmd\n│   ├── api\n│   │   └── main.go\n│   └── [other cmd]\n│       └── main.go\n├── db\n│   ├── schema.sql\n│   └── migrations\n│       └── [migration file]\n├── todos\n│   ├── todo.go\n│   ├── create.go\n│   ├── update.go\n│   ├── delete.go\n│   ├── service.go\n│   └── todostest\n│       ├── todo.go\n│       └── service.go\n├── [other domain]\n│   ├── [entity a].go\n│   ├── [business logic].go\n│   ├── [other domain]test\n│   │   └── service.go\n│   └── service.go\n└── [other client]\n    ├── [entity b].go\n    ├── client.go\n    └── [other client]test\n        └── client.go\n```\n\nThis project structure is based on a modular project structure, with loosely coupled dependencies between domain, Think of making libraries under a single repo that only exports certain functionality that used by other service and http handler. One of domain that present in this example is todos.\n\nLoosely coupled dependency between domain is enforced by avoiding the use of shared entity package, therefore any entity struct should be included inside it's own respective domain. This will prevent cyclic dependency between entity. This shouldn't be a problem in most cases, becasause if you encounter cyclic dependency, there's huge chance that the entity should belongs to the same domain.\n\nFor example, consider three structs: user, transaction and transaction items. transaction and its transaction items might need cyclic dependency and items doesn't works standalone (items without transaction should not exists), thus it should be on the same domain.\nIn the other hand, user and transaction shouldn't require cyclic dependency, transaction might have a user field in the struct, but user shouldn't have a slice of transaction field, therefore it should be on a separate domain.\n\n### Domain vs Client\n\nDomain and Client folder is very similar, the difference is client folder doesn't actually implement any business logic (service), but instead a client that calls any internal/external API to works with the domain entity.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-rel%2Fgin-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-rel%2Fgin-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-rel%2Fgin-example/lists"}