{"id":15137202,"url":"https://github.com/yerinadler/go-rest-api-boilerplate","last_synced_at":"2026-02-09T18:02:50.154Z","repository":{"id":230851514,"uuid":"773585555","full_name":"yerinadler/go-rest-api-boilerplate","owner":"yerinadler","description":"A boilerplate for REST API in Go","archived":false,"fork":false,"pushed_at":"2024-07-11T12:28:04.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T10:18:15.144Z","etag":null,"topics":["docker","go","golang","lgtm-stack","opentelemetry","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yerinadler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-03-18T02:42:48.000Z","updated_at":"2024-07-11T12:29:33.000Z","dependencies_parsed_at":"2024-04-01T07:24:22.679Z","dependency_job_id":"05eba057-65cf-4470-ab3c-293dbe7ffc5f","html_url":"https://github.com/yerinadler/go-rest-api-boilerplate","commit_stats":null,"previous_names":["yerinadler/go-rest-api-boilerplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yerinadler%2Fgo-rest-api-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yerinadler%2Fgo-rest-api-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yerinadler%2Fgo-rest-api-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yerinadler%2Fgo-rest-api-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yerinadler","download_url":"https://codeload.github.com/yerinadler/go-rest-api-boilerplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430835,"owners_count":20937873,"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":["docker","go","golang","lgtm-stack","opentelemetry","rest-api"],"created_at":"2024-09-26T07:00:27.275Z","updated_at":"2026-02-09T18:02:45.110Z","avatar_url":"https://github.com/yerinadler.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Rest API Project\nThis is a Go project created with Echo V4, Viper, Gorm, etc. This could be used as a foundational project. This project comes with pre-configured observability stack based on LGTM stack by Grafana and is instrumented with Opentelemetry SDK\n\n## Technologies used\n- Echo v4 - API Framework\n- Viper - Configuration Management\n- Opentelemetry - Observability library\n- Grafana Tempo - For trace visualisation\n- Grafana Loki - Log backend\n- Fluentbit - Log forwarder\n\n## How to run the project\nThe `docker-compose.yml` file provided with this project includes everything to setup and run the projects. Issue the command on the terminal to\nlaunch the project\n\n```bash\ndocker compose up -d --build\n```\n\n## Convention\nSince this is an opinionated project, I lay down the foundation based on my own use case\n\n### Project Structure\nThe project is based on simple configuration of 3-tier architecture with the following main directories serving each layer\n\n- Presentation Layer is represented as `api` directory\n- Business Layer (Domain Layer) is represented as `services` directory\n- The Data Access Layer is represented as `models` directory holding ORM specific files e.g. GORM definitions or MongoDB models\n\n\u003e These directories rest inside the `internal` directory\n\n#### Shared packages\nThe shared packages are all located in the `pkg` directory. This directory does not store business specific code, only shared modules e.g. response objects, utility functions, error codes, etc.\n\n### Configuration Management\nFor local development, the file `config.yaml` will be used to store local configuration. This file is not meant to be committed into the version control software\n\n#### Config unmarshalling\nThe main configuration object is `config/config.go` where all configurations (both from YAML and environment variables) are unmarshalled into. Thus, whenever the new configuration is added to the YAML file, you can add it to the `config/config.go`\n\n#### How to override the configuration with environment variables\nTo override nested configuration like\n\n```yaml\notlp:\n  endpoint: localhost:4317\n```\n\nUse the convention of `\u003cPARENT\u003e_\u003cCHILD\u003e` (underscore_delimited)\n\nFor example, to override the above YAML for Opentelemetry endpoint. Use below environment variable format\n\n```bash\nOTLP_ENDPOINT=localhost:4317\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyerinadler%2Fgo-rest-api-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyerinadler%2Fgo-rest-api-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyerinadler%2Fgo-rest-api-boilerplate/lists"}