{"id":15096116,"url":"https://github.com/slowhigh/goilerplate","last_synced_at":"2025-12-25T00:01:06.237Z","repository":{"id":43896528,"uuid":"490636545","full_name":"slowhigh/goilerplate","owner":"slowhigh","description":"Go + Boilerplate 🔥🔥🔥","archived":false,"fork":false,"pushed_at":"2025-02-25T13:25:29.000Z","size":7665,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T22:13:41.347Z","etag":null,"topics":["boilerplate","cobra-cli","dependency-injection","docker","gin-gonic","go","go-redis","go-server","gorm","jwt","kubernetes","pgadmin4","postgresql","redis","viper-env","zap-logger"],"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/slowhigh.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,"zenodo":null}},"created_at":"2022-05-10T09:51:13.000Z","updated_at":"2025-02-25T13:25:32.000Z","dependencies_parsed_at":"2024-06-20T14:06:14.876Z","dependency_job_id":"55770405-8599-4dea-afd6-e23380bc81bb","html_url":"https://github.com/slowhigh/goilerplate","commit_stats":null,"previous_names":["oxyrinchus/goilerplate","someday-94/react-go-mongo-demo","someday-94/goilerplate"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/slowhigh/goilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowhigh%2Fgoilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowhigh%2Fgoilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowhigh%2Fgoilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowhigh%2Fgoilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slowhigh","download_url":"https://codeload.github.com/slowhigh/goilerplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowhigh%2Fgoilerplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260035854,"owners_count":22949255,"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":["boilerplate","cobra-cli","dependency-injection","docker","gin-gonic","go","go-redis","go-server","gorm","jwt","kubernetes","pgadmin4","postgresql","redis","viper-env","zap-logger"],"created_at":"2024-09-25T15:45:39.093Z","updated_at":"2025-12-25T00:01:06.002Z","avatar_url":"https://github.com/slowhigh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cb\u003eGoilerplate\u003c/b\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  For the perfect template. 🔥🔥🔥\n\u003c/p\u003e\n\n![image](https://github.com/user-attachments/assets/bcecce5a-e09c-4e76-96c9-6562acc4fe65)\n\n\n## Contents\n- [Features](#features)\n  - [Structure](#structure)\n  - [Infra](#infra)\n- [Kubernetes](#kubernetes)\n  - [Network](#network)\n  - [Load Balancer](#load-balancer)\n  - [Ingress](#ingress)\n  - [Auto Scaling](#auto-scaling)\n  - [API](#api)\n  - [PostgreSQL](#postgresql)\n  - [pgAdmin4](#pgadmin4)\n  - [Redis](#redis)\n- [Quick start](#quick-start)\n  - [Kubernetes in Docker Desktop (localhost)](#kubernetes-in-docker-desktop-localhost)\n  - [Kubernetes in Public Cloud (goilerplate.com)](#kubernetes-in-public-cloud-goilerplatecom)\n- [Makefile Macros](#makefile-macros)\n  - [Docker Control](#docker-control)\n  - [Kubectl Control](#kubectl-control)\n\n## Features\n\n#### Structure\n- [x] **Routing** - Gin Web Framework ---------------------------- [📚](https://gin-gonic.com/docs) [:octocat:](https://github.com/gin-gonic/gin)\n- [x] **CLI** - Cobra ------------------------------------------------- [📚](https://cobra.dev) [:octocat:](https://github.com/spf13/cobra)\n- [x] **DI pattern** - Fx --------------------------------------------- [📚](https://uber-go.github.io/fx/get-started) [:octocat:](https://github.com/uber-go/fx)\n- [x] **Environment** - Viper --------------------------------------- [:octocat:](https://github.com/spf13/viper)\n- [x] **Logging** - Zap ---------------------------------------------- [:octocat:](https://github.com/uber-go/zap)\n- [x] **PostgreSQL ORM** - GORM --------------------------------- [📚](https://gorm.io/docs) [:octocat:](https://github.com/go-gorm/gorm)\n- [x] **Redis ORM** - Go-Redis ------------------------------------- [📚](https://redis.uptrace.dev/guide) [:octocat:](https://github.com/go-redis/redis)\n- [x] **DB Viewer** - pgAdmin4 (Web) ----------------------------- [📚](https://www.pgadmin.org/docs/pgadmin4/latest/index.html) [🐳](https://hub.docker.com/r/dpage/pgadmin4) [:octocat:](https://github.com/pgadmin-org/pgadmin4)\n- [x] **Authentication** - JWT (Access + Refresh) ----------------- [📚](https://golang-jwt.github.io/jwt/) [:octocat:](https://github.com/golang-jwt/jwt)\n- [x] **Makefile** - make -------------------------------------------- [📚](https://www.gnu.org/savannah-checkouts/gnu/make/manual/make.html)\n- [x] **CI/CD** - GitHub-Actions ------------------------------------ [📚](https://docs.github.com/en/actions)\n\n#### Infra\n- [x] **CNI(Container Network Interface)**- flannel --------------- [:octocat:](https://github.com/flannel-io/flannel)\n- [x] **Load Balancer** - MetalLB ----------------------------------- [📚](https://metallb.universe.tf) [:octocat:](https://github.com/metallb/metallb)\n- [x] **Ingress** - NGINX -------------------------------------------- [📚](https://kubernetes.github.io/ingress-nginx/deploy)\n- [x] **AutoScaling** - k8s-HPA ------------------------------------- [📚](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/)\n\n## Kubernetes\n\n#### Network\n- [flannel](k8s/base/kube-flannel.yaml)\n\n#### Load Balancer\n- [MetalLB](k8s/base/metallb-native.yaml)\n- [IPAddressPool](k8s/ipaddress-pools.yaml)\n\n#### Ingress\n- [NGINX Ingress Controller](k8s/base/ingress-nginx.yaml)\n- [Ingress (Internal)](k8s/ingress-internal.yaml)\n- [Ingress (External)](k8s/ingress-external.yaml)\n- [Secret (TLS)](k8s/secret-tls.yaml)\n\n#### Auto Scaling\n- [Metrics Server](k8s/base/metrics-server.yaml)\n- [HPA (HorizontalPodAutoscaler)](k8s/api-hpa.yaml)\n\n#### API\n- [Deployment](k8s/api-deployment.yaml)\n- [Service](k8s/api-service.yaml)\n\n#### PostgreSQL\n- [Deployment](k8s/postgres-deployment.yaml)\n- [Service](k8s/postgres-service.yaml)\n- [Volume](k8s/postgres-volume.yaml)\n\n#### pgAdmin4\n- [Deployment](k8s/pgAdmin4-deployment.yaml)\n- [Service](k8s/pgAdmin4-service.yaml)\n\n#### Redis\n- [Deployment](k8s/redis-deployment.yaml)\n- [Service](k8s/redis-service.yaml)\n- [Volume](k8s/redis-volume.yaml)\n\n\n## Quick start\nMake sure you have `make` installed.\n```bash\n$ sudo apt install make\n```\n\n### Kubernetes in **Docker Desktop** (localhost)\n```bash\n$ make deploy-to-docker-desktop\n```\n\n##### API Server URL (api.localhost)\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://www.postman.com/goilerplate/workspace/goilerplate/documentation/9185268-4a71a5ff-e919-4fd4-b88c-2b7b972c7aef?entity=\u0026branch=\u0026version=)\n\n##### pgAdmin4 URL\n[https://pgadimin4.localhost](https://pgadimin4.localhost)\n\n### Kubernetes in **Public Cloud** (goilerplate.com)\n```bash\n# Check the IP of the Kubernetes control plane.\n$ kubectl cluster-info\nKubernetes control plane is running at https://10.0.0.8:6443\nCoreDNS is running at https://10.0.0.8:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy\n\nTo further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.\n\n# Edit the addresses of ipaddress-pools.yaml.\n$ vi k8s/ipaddress-pools.yaml\napiVersion: metallb.io/v1beta1\nkind: IPAddressPool\nmetadata:\n  name: first-pool\n  namespace: metallb-system\nspec:\n  addresses:\n  - 10.0.0.8-10.0.0.8             \u003c---- edit IP\n---\napiVersion: metallb.io/v1beta1\nkind: L2Advertisement\nmetadata:\n  name: l2-advert\n  namespace: metallb-system\n\n$ make deploy-to-cloud\n```\n\n##### API Server (api.goilerplate.com)\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://www.postman.com/goilerplate/workspace/goilerplate/documentation/9185268-4a71a5ff-e919-4fd4-b88c-2b7b972c7aef?entity=\u0026branch=\u0026version=)\n\n##### pgAdmin4\n[https://pgadimin4.localhost](https://pgadimin4.localhost)\n\n## Makefile Macros\n#### Docker Control\n```bash\n# Push the API Docker Image to the DockerHub.\n$ make push_api\n\n# Push the PostgreSQL Docker Image to the DockerHub.\n$ make push_postgres\n\n# Push the Redi Docker Image to the DockerHub.\n$ make push_redis\n\n# Push the pgAdmin4 Docker Image to the DockerHub.\n$ make push_pgadmin4\n\n# Push the All Docker Image to the DockerHub.\n$ make push_all\n```\n\n#### Kubectl Control\n```bash\n# Deploy to the Docker Desktop. (WSL + Docker Desktop)\n$ make deploy-to-docker-desktop\n\n# Undeploy to the Docker Desktop. (WSL + Docker Desktop)\n$ make delete-to-docker-desktop\n\n# Deploy to the Public Cloud.\n$ make deploy-to-cloud\n\n# Undeploy to the Public Cloud.\n$ make delete-to-cloud\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslowhigh%2Fgoilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslowhigh%2Fgoilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslowhigh%2Fgoilerplate/lists"}