{"id":13430368,"url":"https://github.com/xmlking/micro-starter-kit","last_synced_at":"2025-04-10T00:19:28.324Z","repository":{"id":35511837,"uuid":"191110902","full_name":"xmlking/micro-starter-kit","owner":"xmlking","description":"Cloud Native GoLang Microservices - gRPC, GraphQL","archived":false,"fork":false,"pushed_at":"2022-06-23T23:36:48.000Z","size":16361,"stargazers_count":206,"open_issues_count":20,"forks_count":39,"subscribers_count":9,"default_branch":"develop","last_synced_at":"2025-04-02T22:07:25.101Z","etag":null,"topics":["cicd","gateway","go-micro","golang","grpc","kubernetes","micro","microservices","monorepo"],"latest_commit_sha":null,"homepage":"https://xmlking.gitbook.io/micro/v/develop/","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/xmlking.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":["xmlking"],"open_collective":"xmlking"}},"created_at":"2019-06-10T06:33:50.000Z","updated_at":"2025-03-15T02:06:25.000Z","dependencies_parsed_at":"2022-07-24T20:32:14.086Z","dependency_job_id":null,"html_url":"https://github.com/xmlking/micro-starter-kit","commit_stats":null,"previous_names":[],"tags_count":23,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fmicro-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fmicro-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fmicro-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fmicro-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmlking","download_url":"https://codeload.github.com/xmlking/micro-starter-kit/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131535,"owners_count":21052868,"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":["cicd","gateway","go-micro","golang","grpc","kubernetes","micro","microservices","monorepo"],"created_at":"2024-07-31T02:00:52.753Z","updated_at":"2025-04-10T00:19:28.295Z","avatar_url":"https://github.com/xmlking.png","language":"Go","readme":"# micro-starter-kit\n\nMicroservices starter kit for **Golang**, aims to be developer friendly.\n\n[![GoDoc](https://godoc.org/github.com/xmlking/micro-starter-kit?status.svg)](https://godoc.org/github.com/xmlking/micro-starter-kit)\n[![Go](https://img.shields.io/github/go-mod/go-version/xmlking/micro-starter-kit/develop)](https://golang.org/dl/)\n[![Renovate dependency Status](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)\n[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n\n### Build Status\n[![Build Status](https://github.com/xmlking/micro-starter-kit/workflows/Test%20on%20Push/badge.svg?branch=develop)](https://github.com/xmlking/micro-starter-kit/actions?query=branch%3Adevelop+event%3Apush+workflow%3A%22Test+on+Push%22)\n\n### Quality\n[![Go Report Card](https://goreportcard.com/badge/github.com/xmlking/micro-starter-kit)](https://goreportcard.com/report/github.com/xmlking/micro-starter-kit)\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/xmlking/micro-starter-kit.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/xmlking/micro-starter-kit/alerts/)\n[![codecov](https://codecov.io/gh/xmlking/micro-starter-kit/branch/develop/graph/badge.svg)](https://codecov.io/gh/xmlking/micro-starter-kit)\n[![Language grade: Go](https://img.shields.io/lgtm/grade/go/g/xmlking/micro-starter-kit.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/xmlking/micro-starter-kit/context:go)\n[![fuzzit](https://app.fuzzit.dev/badge?org_id=xmlkinggithub\u0026branch=develop)](https://app.fuzzit.dev/orgs/xmlkinggithub/dashboard)\n\n## Overview\n\n![Image of Deployment](docs/images/deployment.png)\n\n### What you get\n\n- [x] Monorepo - Sharing Code Between Microservices\n- [x] gRPC microservices with REST Gateway\n- [x] Input Validation with [protoc-gen-validate (PGV)](https://github.com/envoyproxy/protoc-gen-validate)\n- [x] Config - Pluggable Sources, Mergeable Config, Safe Recovery\n- [x] Customizable Logging\n- [x] CRUD Example using [GORM](https://gorm.io/), [benchmarks](https://github.com/kihamo/orm-benchmark), [XORM](https://xorm.io/) next?\n- [x] GORM code gen via [protoc-gen-gorm](https://github.com/infobloxopen/protoc-gen-gorm) or use [protoc-go-inject-tag](https://github.com/favadi/protoc-go-inject-tag)?\n- [x] Dependency injection [Container](https://github.com/sarulabs/di), Try [wire](https://itnext.io/mastering-wire-f1226717bbac) next?\n- [x] multi-stage-multi-target Dockerfile\n- [x] One Step _build/publish/deploy_ with [ko](https://github.com/google/ko)\n- [x] BuildInfo with [govvv](https://github.com/ahmetb/govvv)\n- [x] Linting with [GolangCI](https://github.com/golangci/golangci-lint) linters aggregator\n- [x] Linting Protos with [Buf](https://buf.build/docs/introduction)\n- [x] CICD Pipelines with [GitHub Actions](https://github.com/features/actions)\n- [x] Kubernetes _Matrix Deployment_ with [Kustomize](https://kustomize.io/)\n- [ ] Add k8s [healthchecks](https://github.com/heptiolabs/healthcheck) with [cmux](https://medium.com/@drgarcia1986/listen-grpc-and-http-requests-on-the-same-port-263c40cb45ff)\n- [x] Feature Flags (enable/disable with zero cost)\n- [ ] Observability\n- [ ] Service Mesh with [Istio](https://istio.io/)\n- [ ] GraphQL Gateway with [gqlgen](https://gqlgen.com/), [rejoiner](https://github.com/google/rejoiner),[gqlgen](https://github.com/Shpota/skmz)\n- [ ] Graph-Based ORM [ent](https://entgo.io/)\n- [ ] Switch to [Bazel Build](https://bazel.build/)\n\n## Getting Started\n\n### Prerequisite\n\nRefer [prerequisites](docs/introduction/prerequisites.md) docs\n\n### Initial Setup\n\nAlso Refer [scaffolding](docs/introduction/scaffolding.md) docs\n\n\u003e clone the repo\n\n```bash\ngit clone https://github.com/xmlking/micro-starter-kit ~/Developer/Work/go/micro-starter-kit\n# pull dependencies (when every time `go.mod` changed)\ngo mod download\n```\n\n### Run\n\n#### Database\n\nBy default this project use embedded `sqlite3` database. if you want to use **postgreSQL**,\n\n- start **postgres** via `docker-compose` command provided below\n- uncommend `postgres` import statement and comment `sqlite` in `plugin.go`\n- start micro server with `--configFile=config.dev.postgres.yaml` flag \u003cbr/\u003e\n  i.e., `go run srv/account/main.go srv/account/plugin.go --configFile=config.dev.postgres.yaml`\n\n```bash\n# to start postgres in foreground\ndocker-compose up postgres\n# to stop postgres\ndocker-compose down\n# if needed, remove `postgres_data` volume to recreate database next time, when you start.\ndocker system prune --volumes\n```\n\n#### Services\n\n\u003e Node: `--server_address=localhost:5501x --broker_address=localhost:5502x` required only when you are behind VPN a.k.a `Work From Home`\n\n```bash\n# dev mode\nmake run-account\n# or\nmake run-account ARGS=\"--server_address=localhost:55011 --broker_address=localhost:55021\"\n# or\ngo run srv/account/main.go srv/account/plugin.go \\\n--configDir deploy/bases/account-srv/config \\\n--server_address=localhost:55011 --broker_address=localhost:55021\n\nmake run-greeter\n# or\nmake run-emailer ARGS=\"--server_address=localhost:55012 --broker_address=localhost:55022\"\n\nmake run-emailer\n# or\nmake run-emailer ARGS=\"--server_address=localhost:55013 --broker_address=localhost:55023\"\n\n\n# integration tests for config module via CMD\nmake run TARGET=demo TYPE=cmd\ngo run cmd/demo/main.go --help\ngo run cmd/demo/main.go --database_host=1.1.1.1 --database_port=7777\n\nexport APP_ENV=production\ngo run cmd/demo/main.go\n```\n\n### Test\n\nRefer [testing](docs/testing/testing.md) docs\n\n## GitOps\n\n### Make\n\nRefer [makefile](docs/introduction/makefile.md) docs\n\n### Docker\n\nRefer [docker](docs/devops/docker.md) docs\n\n### Release\n\nRefer [releasing](docs/concepts/releasing.md) docs\n\n### Deploy\n\n```bash\nmake docker DOCKER_REGISTRY=docker.pkg.github.com DOCKER_CONTEXT_PATH=xmlking/micro-starter-kit\ndocker rmi $(docker images -f \"dangling=true\" -q)\n\n# make kustomize OVERLAY=e2e NS=default VERSION=v0.1.0-440-g6c7fb7a\nmake kustomize\nkubectl apply -f build/kubernetes.yaml\n\nPOD_NAME=$(kubectl get pods  -lapp.kubernetes.io/name=account-srv -o jsonpath='{.items[0].metadata.name}')\nkubectl logs -f -c srv $POD_NAME\n\nkubectl delete -f build/kubernetes.yaml\n```\n\n## Reference\n\n### Project Docs\n\n1. [prerequisites](docs/introduction/prerequisites.md)\n2. [scaffolding](docs/introduction/scaffolding.md)\n3. [makefile](docs/introduction/makefile.md)\n4. [testing](docs/testing/testing.md)\n5. [docker](docs/devops/docker.md)\n6. [gitops](docs/advanced/gitops.md)\n7. [Protobuf Style Guide](https://buf.build/docs/style-guide)\n8. [Google Protobuf Style Guide](https://github.com/uber-go/guide/blob/master/style.md)\n\n### External Docs\n\n1. [Go-Micro Getting Started](https://itnext.io/micro-in-action-getting-started-a79916ae3cac)\n2. [examples](https://github.com/micro/examples) - example usage code for micro\n3. [microhq](https://github.com/microhq) - a place for prebuilt microservices\n4. [explorer](https://micro.mu/explore/) - which aggregates micro based open source projects\n5. [micro-plugins](https://github.com/micro/go-plugins) extensible micro plugins\n6. [step-by-step-guide-micro](https://github.com/micro-in-cn/tutorials/tree/master/microservice-in-micro)\n7. [micro-in-cn](https://github.com/micro-in-cn/tutorials/tree/master/examples)\n8. [Platform Web](https://github.com/micro-in-cn/platform-web)\n9. [grpc template](https://github.com/vtolstov/micro-template-grpc)\n10. [Simple API backed by PostgresQL, Golang and gRPC](https://medium.com/@vptech/complexity-is-the-bane-of-every-software-engineer-e2878d0ad45a)\n","funding_links":["https://github.com/sponsors/xmlking","https://opencollective.com/xmlking"],"categories":["Projects","Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmlking%2Fmicro-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmlking%2Fmicro-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmlking%2Fmicro-starter-kit/lists"}