{"id":37185578,"url":"https://github.com/grimerssy/go-example","last_synced_at":"2026-01-14T21:28:48.643Z","repository":{"id":50705163,"uuid":"505143290","full_name":"grimerssy/go-example","owner":"grimerssy","description":"go-template example","archived":false,"fork":false,"pushed_at":"2022-08-10T11:22:06.000Z","size":222,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T02:00:29.877Z","etag":null,"topics":["bdd","clean-architecture","go","grpc","jwt","rest-proxy","sql"],"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/grimerssy.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}},"created_at":"2022-06-19T15:09:56.000Z","updated_at":"2023-01-22T20:00:11.000Z","dependencies_parsed_at":"2022-09-24T15:03:18.053Z","dependency_job_id":null,"html_url":"https://github.com/grimerssy/go-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"grimerssy/go-template","purl":"pkg:github/grimerssy/go-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimerssy%2Fgo-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimerssy%2Fgo-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimerssy%2Fgo-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimerssy%2Fgo-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grimerssy","download_url":"https://codeload.github.com/grimerssy/go-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimerssy%2Fgo-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28435057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bdd","clean-architecture","go","grpc","jwt","rest-proxy","sql"],"created_at":"2026-01-14T21:28:47.985Z","updated_at":"2026-01-14T21:28:48.634Z","avatar_url":"https://github.com/grimerssy.png","language":"Go","readme":"# Example go project\n\n---\n\n### Introduction\n\nThis is a server application built using [go-template](https://github.com/grimerssy/go-template) \nto showcase how to use it.\n\nYou might find this project over-engineered as it is just a simple API which \nlets \nyou signup, login and get a greeting from it. Yet it uses three-layer \narchitecture and can be called using gRPC, RESTful HTTP/1.1 and HTTP/2.\n\nWhy is it like that? It is, as the name suggests, an example. Its goal is to \nnot only show how to use [go-template](https://github.com/grimerssy/go-template),\nbut to show my approach to building real-world backend apps using Go, which \nyou might find useful.\n\nThe project follows [standard Go project layout](https://github.com/golang-standards/project-layout)\nand is directly written to be a guide to writing more maintainable and \neasily extensible code in Go. \n\n___\n\n### Dependencies\n\nLet's move on to libraries, which I used in this project, and which this \napplication is build around. \n\n- [grpc-go](https://github.com/grpc/grpc-go) - building gRPC server\n- [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) - \n  building RESTful HTTP proxy on top of gRPC server\n- [wire](https://github.com/google/wire) - dependency injection\n- [migrate](https://github.com/golang-migrate/migrate) - working with \n  database migrations\n- [viper](https://github.com/spf13/viper) - reading configuration files\n- [jwt-go](https://github.com/golang-jwt/jwt) - JWT authorization\n- [zap](https://github.com/uber-go/zap) - logging\n- [optimus-go](https://github.com/pjebs/optimus-go) - hiding database ids from \nend user\n- [sqlx](https://github.com/jmoiron/sqlx) - better SQL experience\n- [ginkgo](https://github.com/onsi/ginkgo) and \n[gomega](https://github.com/onsi/gomega) - BDD testing\n- [gomock](https://github.com/golang/mock) and\n[go-sqlmock](https://github.com/DATA-DOG/go-sqlmock) - mocking dependencies \n  for testing\n\nFeel free to explore if you are interested in learning any one of these \nlibraries or if you want to build highly decoupled apps but have not found your\nbest approach yet.\n\n---\n\n### How to run\n\n1. Make sure you have [Go](https://go.dev/dl/) and \n[Buf](https://docs.buf.build/installation) installed.\n2. Start Postgres database locally on port `:5432`. \u003cbr\u003e\nThe easiest way is to start Postgres container in Docker. \u003cbr\u003e\nTo do it, install [Docker](https://docs.docker.com/get-docker/) first, then \n   run `docker run -p 5432:5432 --name go-example_db -e POSTGRES_USER=user -e \nPOSTGRES_PASSWORD=password postgres` in your terminal (username and password \n   are set to defaults which match the values in `configs/*.env` files).\n   To stop the container afterwards, run `docker stop go-example_db`.\n3. Clone this repository.\n4. Run `make init` command to install required dependencies.\n5. Run `go mod tidy` command to install libraries used in this project.\n6. Build the project using `make build` command\n7. Run compiled binary with `bin/server -dev` command to run it in \n   development mode or change `-dev` flag to `-stage` or `-prod` to run in \n   staging and production environments accordingly (for simplicity, the\n   configuration is the same for each environment, feel free to change `*.yaml` \n   and `*.env` files in `config/` directory)\n\n---\n\n### More to come\n\nCurrently, this is not final form of this project, here are some things you \nwill see in the future: \n\n- Github CI/CD pipeline\n- Containerization using Docker \n- More test coverage (mw, server and pkg tests)\n\nMight be implemented:\n\n- TLS configuration for HTTPS support\n- Kubernetes cluster\n- NGINX proxy \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrimerssy%2Fgo-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrimerssy%2Fgo-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrimerssy%2Fgo-example/lists"}