{"id":16098623,"url":"https://github.com/funnyzak/go-gin","last_synced_at":"2026-04-30T10:04:21.397Z","repository":{"id":221157282,"uuid":"753581446","full_name":"funnyzak/go-gin","owner":"funnyzak","description":"Go-Gin is a starter for Gin Gonic, featuring Zerolog, Viper, Gorm, JWT, Go-Cache, rate limiting, cron scheduling, notifications, utility packages, and more.","archived":false,"fork":false,"pushed_at":"2024-03-01T12:58:15.000Z","size":250,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T12:08:19.133Z","etag":null,"topics":["gin-gonic","go","go-gin","go-starter","gogin","golang","web-app","webapp"],"latest_commit_sha":null,"homepage":"https://yycc.dev","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/funnyzak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-02-06T12:07:41.000Z","updated_at":"2024-03-02T11:47:43.000Z","dependencies_parsed_at":"2024-10-31T13:22:25.053Z","dependency_job_id":"5c9f55df-5efb-48b5-b480-672bd6368345","html_url":"https://github.com/funnyzak/go-gin","commit_stats":null,"previous_names":["funnyzak/go-gin"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgo-gin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgo-gin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgo-gin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgo-gin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funnyzak","download_url":"https://codeload.github.com/funnyzak/go-gin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411194,"owners_count":20934650,"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":["gin-gonic","go","go-gin","go-starter","gogin","golang","web-app","webapp"],"created_at":"2024-10-09T18:24:10.703Z","updated_at":"2026-04-30T10:04:21.315Z","avatar_url":"https://github.com/funnyzak.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Go Gin\n\nGo-gin is a starter for Gin Gonic, featuring Zerolog, Viper, Gorm, JWT, Go-Cache, rate limiting, cron scheduling, notifications, utility packages, and more.\n\n[![Build Status][build-status-image]][build-status]\n[![Go Version][go-version-image]](https://github.com/funnyzak/go-gin/blob/main/go.mod)\n[![docker][docker-image]][docker-url]\n[![license][license-image]][repository-url]\n[![GitHub repo size][repo-size-image]][repository-url]\n[![release][rle-image]][rle-url]\n\n## Development\n\nIf you want to develop with this project, you can follow the steps below.\n\n1. Clone the repository and navigate to the project directory.\n\n   ```bash\n    git clone git@github.com:funnyzak/go-gin.git \u0026\u0026 cd go-gin\n   ```\n\n2. Run the application.\n\n   ```bash\n    go run cmd/main.go\n    # or \n    make dev\n    ```\n\n**Note:** The application will load the configuration from the `config.yaml` file in the root directory by default. If you want to use a different configuration file, you can copy `config.example.yaml` to `prod.yaml` and update the values. specify it using the `-c` parameter, for example: `go run cmd/main.go -c prod`, it will load the `prod.yaml` configuration file.\n\n### CI/CD\n\nYou can fork this repository and add Secrets Keys: `DOCKER_USERNAME` and `DOCKER_PASSWORD` in the repository settings. And when you push the code, it will automatically build binary and docker image and push to the Docker Hub.\n\n## Structure\n\n```plaintext\n├── Dockerfile              // Dockerfile defines how to build a Docker image for the project\n├── Makefile                // Contains commands for building, running, testing, etc. the project\n├── cmd\n│   ├── main.go             // The main entry point for the application\n│   └── srv                 // Server controller\n├── config.example.yaml     // An example configuration file for the project\n├── docker-compose.yml      // Defines services, networks and volumes for docker-compose\n├── internal\n│   ├── gconfig             // Internal package for configuration\n│   └── gogin               // Internal package for the gin framework\n├── mappers\n│   ├── auth.go             // Data mapper for authentication\n│   └── post.go             // Data mapper for posts\n├── model\n│   ├── auth.go             // Data model for authentication\n│   ├── common.go           // Common data models\n│   ├── post.go             // Data model for posts\n│   └── user.go             // Data model for users\n├── pkg\n│   ├── logger              // Package for logging\n│   ├── mygin               // Custom package for the gin framework\n│   └── utils               // Utility packages\n├── resource\n│   ├── resource.go         // Resource management\n│   ├── static              // Static files such as HTML, CSS, JavaScript, images\n│   └── template            // Templates for Gin framework\n├── script\n│   └── build.sh            // A script for building the project\n└── service\n    └── singleton           // Singleton services for the application\n```\n\n## Configuration\n\nService configuration via `yaml` format. The configuration file is located in the root directory of the project and is named `config.example.yaml`. You can copy this file to `config.yaml` and update the values. More details can be found in the [config.example.yaml](https://github.com/funnyzak/go-gin/blob/main/config.example.yaml) file.\n\n## Build\n\n```bash\n# Compile multiple platforms architecture (Linux, Windows, MacOS)\nmake build\n\n# Compile the specified platform architecture\nGOOS=linux GOARCH=amd64 go build -o go-gin-linux-amd64 cmd/main.go\n\n# Compile current platform architecture\ngo build -o go-gin cmd/main.go\n```\n\n## Deployment\n\nYou can deploy the application using the following ways.\n\n### Docker Deployment\n\nDocker deployment requires the installation of Docker first, and then execute the command.\n\n#### One-click Deployment\n\nStart the service with default configuration parameters, as follows:\n\n```bash\ndocker run -d \\\n  --name go-gin \\\n  --restart always \\\n  -p 8080:8080 \\\n  -v ./config.yaml:/app/config.yaml \\\n  funnyzak/go-gin:latest\n```\n\n#### Compose Startup\n\n```bash\n# Pull source code\ngit clone git@github.com:funnyzak/go-gin.git \u0026\u0026 cd go-gin\n# Compose startup, startup parameter configuration can be done by modifying the docker-compose.yml file\ndocker compose up -d\n```\n\nIf you need to update the container, you can re-pull the code and build the image in the source code folder, the command is as follows:\n\n```bash\ngit pull \u0026\u0026 docker compose up -d --build\n```\n\n### Binary Startup\n\nYou can pull the source code to compile the binary executable file yourself, or download the binary executable file of the corresponding system architecture from the repository, and then execute the following command to start (note that **go-gin** is the name of the binary executable file, please replace it according to the actual name):\n\n```bash\n# Quick start (The config.yaml file needs to be in the same directory as the binary executable file)\n./go-gin\n\n# Specify the configuration file. eg. prod, the configuration file is prod.yaml \n./go-gin -c prod\n\n# View help, see available parameters\n./go-gin -h\n```\n\n**Note:** Please make sure that executable permissions have been set before running. If there are no executable permissions, you can set them through the `chmod +x go-gin` command.\n\n### Run as Service\n\n#### Linux (systemd)\n\nIn Linux, services are managed through Systemd. You can use the following commands to install, start, stop, restart, log, and view the status of services, etc.\n\n```bash\nbash -c \"$(curl -fsSL https://raw.githubusercontent.com/funnyzak/go-gin/main/script/install.sh)\"\n```\n\nYou can also install it manually. The specific steps are as follows:\n\n\u003cdetails\u003e\n  \u003csummary\u003e Click to expand \u003c/summary\u003e\n\n1. Download the binary executable file of the corresponding system architecture from the [releases](https://github.com/funnyzak/go-gin/releases) page or [GitHub Actions](https://github.com/funnyzak/go-gin/actions) page, and copy it to the `/opt/go-gin` directory.\n2. Grant the executable permission to the file by running the following command:\n\n    ```bash\n    sudo chmod +x /opt/go-gin/go-gin\n    ```\n\n3. Download [go-gin.service](https://raw.githubusercontent.com/funnyzak/go-gin/main/script/go-gin.service) file to the `/etc/systemd/system` directory.\n4. Download [config.example.yaml](https://raw.githubusercontent.com/funnyzak/go-gin/main/config.example.yaml) file to the `/opt/go-gin` directory and rename it to `go-gin.yaml`, and update the values.\n\nFinally, run the following command to start the service:\n\n```bash\nsudo systemctl enable go-gin\nsystemctl start go-gin\n```\n\n\u003c/details\u003e\n\n#### MacOS (launchd)\n\nService on MacOS is based on launchd. You can use the following steps to install and start the service.\n\n1. Download the binary executable file of the corresponding system architecture from the [releases](https://github.com/funnyzak/go-gin/releases) page or [GitHub Actions](https://github.com/funnyzak/go-gin/actions) page, and copy it to the `/opt/go-gin` directory.\n2. Grant the executable permission to the file by running the following command:\n\n    ```bash\n    sudo chmod +x /opt/go-gin/go-gin\n    ```\n\n3. Download [com.go-gin.plist](https://raw.githubusercontent.com/funnyzak/go-gin/main/script/com.go-gin.plist) file to the `/Library/LaunchDaemons` directory.\n4. Download [config.example.yaml](https://raw.githubusercontent.com/funnyzak/go-gin/main/config.example.yaml) file to the `/opt/go-gin` directory and rename it to `config.yaml`, and update the values.\n\nFinally, run the following command to start the service:\n\n```bash\nsudo launchctl load /Library/LaunchDaemons/com.go-gin.plist\nsudo launchctl start /Library/LaunchDaemons/com.go-gin.plist\n```\n\n#### Windows\n\nService on Windows can be implemented using Task Scheduler. You can use the following steps to install and start the service.\n\n1. Dwnload the binary executable file of the corresponding system architecture from the [releases](https://github.com/funnyzak/go-gin/releases) page or [GitHub Actions](https://github.com/funnyzak/go-gin/actions) page, and unzip it to the `C:\\go-gin` directory.\n2. Download [install.ps1](https://raw.githubusercontent.com/funnyzak/go-gin/main/script/install.ps1) file to the `C:\\go-gin` directory and rename it to `go-gin.ps1`.\n3. Download [config.example.yaml](https://raw.githubusercontent.com/funnyzak/go-gin/main/config.example.yaml) file to the `C:\\go-gin` directory and rename it to `config.yaml`, and update the values.\n\nFinally, run the following command to start the service:\n\n```powershell\ncd C:\\go-gin\n.\\go-gin.ps1 enable\n```\n\nThe following are all the commands supported by the script:\n\n```powershell\n./go-gin.ps1 enable  # Enable and start the service\n./go-gin.ps1 disable # Disable and stop the service\n./go-gin.ps1 start   # Start the service\n./go-gin.ps1 stop    # Stop the service\n./go-gin.ps1 restart # Restart the service\n./go-gin.ps1 status  # View the service status\n```\n\n## FOSSA Scan\n\n[![FOSSA Status][fossa-image]][fossa-url]\n\n## LICENSE\n\n[MIT License](https://opensource.org/licenses/MIT)\n\n[repo-size-image]: https://img.shields.io/github/repo-size/funnyzak/go-gin?style=flat-square\u0026logo=github\u0026logoColor=white\u0026label=size\n[down-latest-image]: https://img.shields.io/github/downloads/funnyzak/go-gin/latest/total.svg\n[down-total-image]: https://img.shields.io/github/downloads/funnyzak/go-gin/total.svg\n[commit-activity-image]: https://img.shields.io/github/commit-activity/m/funnyzak/go-gin?style=flat-square\n[last-commit-image]: https://img.shields.io/github/last-commit/funnyzak/go-gin?style=flat-square\n[license-image]: https://img.shields.io/github/license/funnyzak/go-gin.svg?style=flat-square\n[repository-url]: https://github.com/funnyzak/go-gin\n[rle-url]: https://github.com/funnyzak/go-gin/releases/latest\n[rle-all-url]: https://github.com/funnyzak/go-gin/releases\n[ci-image]: https://img.shields.io/github/workflow/status/funnyzak/go-gin/react-native-android-build-apk\n[ci-url]: https://github.com/funnyzak/go-gin/actions\n[rle-image]: https://img.shields.io/github/release/funnyzak/go-gin.svg?style=smartthings\n[sg-image]: https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=flat-square\n[sg-url]: https://sourcegraph.com/github.com/funnyzak/go-gin\n[build-status-image]: https://github.com/funnyzak/go-gin/actions/workflows/build.yml/badge.svg\n[build-status]: https://github.com/funnyzak/go-gin/actions\n[tag-image]: https://img.shields.io/github/tag/funnyzak/go-gin.svg\n[docker-image]: https://img.shields.io/docker/pulls/funnyzak/go-gin\n[docker-url]: https://hub.docker.com/r/funnyzak/go-gin\n[fossa-image]: https://app.fossa.com/api/projects/git%2Bgithub.com%2Ffunnyzak%2Fgo-gin.svg?type=large\n[fossa-url]: https://app.fossa.com/projects/git%2Bgithub.com%2Ffunnyzak%2Fgo-gin?ref=badge_large\n[go-version-image]: https://img.shields.io/github/go-mod/go-version/funnyzak/go-gin?logo=go\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnyzak%2Fgo-gin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunnyzak%2Fgo-gin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnyzak%2Fgo-gin/lists"}