{"id":15096000,"url":"https://github.com/utain/go-12factor-example","last_synced_at":"2025-07-18T17:31:22.347Z","repository":{"id":41321281,"uuid":"227110705","full_name":"utain/go-12factor-example","owner":"utain","description":"Example the 12factor app using golang","archived":false,"fork":false,"pushed_at":"2023-05-05T02:32:03.000Z","size":304,"stargazers_count":50,"open_issues_count":5,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T22:12:23.566Z","etag":null,"topics":["12-factor","cobra","docker","example","gin","gin-gonic","golang","gorm","webservice"],"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/utain.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":"2019-12-10T12:05:26.000Z","updated_at":"2025-01-06T23:45:35.000Z","dependencies_parsed_at":"2024-06-19T05:19:04.336Z","dependency_job_id":"6ea3d521-28b4-45b3-8cdb-101636916621","html_url":"https://github.com/utain/go-12factor-example","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/utain/go-12factor-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utain%2Fgo-12factor-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utain%2Fgo-12factor-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utain%2Fgo-12factor-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utain%2Fgo-12factor-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/utain","download_url":"https://codeload.github.com/utain/go-12factor-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/utain%2Fgo-12factor-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265801700,"owners_count":23830456,"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":["12-factor","cobra","docker","example","gin","gin-gonic","golang","gorm","webservice"],"created_at":"2024-09-25T15:44:46.744Z","updated_at":"2025-07-18T17:31:22.321Z","avatar_url":"https://github.com/utain.png","language":"Go","readme":"# GO Example (Web Service)\n\nTrying to implement follow [The Twelve Factor App](https://12factor.net/)\n\n## Dependencies\n\n1. Command-line interface: github.com/spf13/cobra\n2. Configuration: github.com/spf13/viper\n3. Testing: github.com/stretchr/testify\n4. Mocking DB: github.com/DATA-DOG/go-sqlmock\n5. ORM: gorm.io/gorm\n6. Logging: github.com/op/go-logging\n7. HTTP Server: github.com/gin-gonic/gin\n8. API Document: github.com/swaggo/swag/cmd/swag\n\n## Project structure\n\n```sh\n.\n├── Dockerfile\n├── LICENSE\n├── Makefile\n├── README.md\n├── cmd\n│   ├── othercmd # example other command line app\n│   └── server   # start reading code from here\n├── internal\n│   ├── api/v1\n│   ├── config\n|   |-- dto\n│   ├── entities\n|   |-- errors\n|   |-- log\n│   ├── services\n│   └── utils\n├── config\n│   └── default.yaml\n├── docs\n├── dist\n│   ├── drawin\n│   ├── linux\n│   └── windows\n├── docker-compose.yml\n├── go.mod\n└── go.sum\n```\n\n## Get started\n\n### Cross platform build environment setup\n\n**macOS**\n\n```sh\n# install dep to build binary for linux and windows\nbrew install FiloSottile/musl-cross/musl-cross\nbrew install mingw-w64\n```\n\n**Command Line**\n\nRun project with docker compose\n\n```sh\ndocker compose -f dev.yml up --build\n```\n\nRun project without build\n\n```sh\ngo run ./cmd/server [command] --[flag-name]=[flag-value]\n```\n\nGenerate API Document\n\n```sh\nmake doc\n# open url http://localhost:5000/doc/index.html\n```\n\nBuild using `make` command\n\n```sh\n# Build single binary with specify os\nmake build[-mac|win|linux]\n# Build all os\nmake all\n# Running test\nmake test\n# Start server without build binary file\nmake run\n```\n\nBuild with docker\n\n```sh\ndocker compose build # build docker image\ndocker compose up # run on docker\n# or\ndocker compose up --build # build and run\ndocker push [image-name] # public docker image to registry\n```\n\n\n## Configuration\n\n[Viper](https://github.com/spf13/viper#why-viper) uses the following precedence order. Each item takes precedence over the item below it:\n\n- explicit call to Set\n- flag\n- env\n- config\n- key/value store\n- default\n\n## Example List\n- Simple in [main branch](https://github.com/utain/go-12factor-example)\n- Port/Adapter in [hexagonal branch](https://github.com/utain/go-12factor-example/tree/hexagonal)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futain%2Fgo-12factor-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futain%2Fgo-12factor-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futain%2Fgo-12factor-example/lists"}