{"id":15178888,"url":"https://github.com/mojocn/ginbro","last_synced_at":"2025-10-01T20:32:00.639Z","repository":{"id":57482878,"uuid":"159590629","full_name":"mojocn/ginbro","owner":"mojocn","description":"Converting a MySQL database'schema to a RESTful golang APIs app in the fastest way","archived":true,"fork":false,"pushed_at":"2019-05-10T11:31:55.000Z","size":5444,"stargazers_count":114,"open_issues_count":1,"forks_count":38,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-01-16T08:16:30.942Z","etag":null,"topics":["boilerplate","gin","gorm","gorm-model","jwt","mysql-database","swagger-ui"],"latest_commit_sha":null,"homepage":"http://ginbro.mojotv.cn/swagger","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/mojocn.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}},"created_at":"2018-11-29T01:42:52.000Z","updated_at":"2024-09-23T06:31:26.000Z","dependencies_parsed_at":"2022-09-13T03:11:57.950Z","dependency_job_id":null,"html_url":"https://github.com/mojocn/ginbro","commit_stats":null,"previous_names":["libragen/ginbro","dejavuzhou/ginbro"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojocn%2Fginbro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojocn%2Fginbro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojocn%2Fginbro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojocn%2Fginbro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mojocn","download_url":"https://codeload.github.com/mojocn/ginbro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234897368,"owners_count":18903646,"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","gin","gorm","gorm-model","jwt","mysql-database","swagger-ui"],"created_at":"2024-09-27T15:41:11.204Z","updated_at":"2025-10-01T20:31:54.307Z","avatar_url":"https://github.com/mojocn.png","language":"Go","readme":"# [Converting a MySQL database'schema to a RESTful golang APIs app in the fastest way](https://github.com/dejavuzhou/ginbro)\n[![Build Status](https://travis-ci.org/dejavuzhou/ginbro.svg?branch=master)](https://travis-ci.org/dejavuzhou/ginbro) \n[![GoDoc](http://godoc.org/github.com/dejavuzhou/ginbro?status.svg)](http://godoc.org/github.com/dejavuzhou/ginbro) \n[![Go Report Card](https://goreportcard.com/badge/github.com/dejavuzhou/ginbro)](https://goreportcard.com/report/github.com/dejavuzhou/ginbro)\n![stability-stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)\n[![codebeat badge](https://codebeat.co/badges/650029a5-fcea-4416-925e-277e2f178e96)](https://codebeat.co/projects/github-com-dejavuzhou-ginbro-master)\n[![codecov](https://codecov.io/gh/dejavuzhou/ginbro/branch/master/graph/badge.svg)](https://codecov.io/gh/dejavuzhou/ginbro)\n\nGinbro is a scaffold tool for Gin-Gorm-MySQL which you just need to input one command to create a mighty RESTful APIs App.\n## Warning\n### - this Repo's code has transfered to [Felix/ginbro](https://github.com/dejavuzhou/felix), please visit[dejavuzhou/felix](https://github.com/dejavuzhou/felix/ginbro)\n### - 代码已经转移到[dejavuzhou/felix/ginbro](https://github.com/dejavuzhou/felix/ginbro),请移步至[dejavuzhou/felix/ginbro](https://github.com/dejavuzhou/felix)\n\n## Demo and Translated Document\n- [中文文档](readme_zh.md)            \n- [Video-Demo-Youtube](https://www.youtube.com/watch?v=TvWQhNKfmCo\u0026feature=youtu.be)\n- [Video-Demo-Bilibili](https://www.bilibili.com/video/av36804258/)\n\n## Feature\n- [fastest way to generate a RESTful APIs application with MySQL in Go](/boilerplate)\n- support [JWT Authorization Bearer](boilerplate/handlers/middleware_jwt.go) [Auth](boilerplate/handlers/handler_auth.go) and [JWT middleware](boilerplate/models/jwt.go)\n- [support brute-force-login firewall](boilerplate/models/model_users.go)\n- [build in swift golang-memory cache](https://github.com/dejavuzhou/ginbro/blob/master/boilerplate/models/db_memory.go)\n- [generate GORM model from MySQL database schema](boilerplate/models)\n- [powered with Swagger document and SwaggerUI](boilerplate/swagger)\n- [capable of serve VueJs app's static files](boilerplate/static)\n- [configurable CORS middleware](boilerplate/handlers/gin_helper.go)\n- [user friendly configuration](tpl/config.toml)\n- [golang GUI app](gui)\n- [fully build-in cron task support](boilerplate/tasks)\n- [travis CI/CD](https://travis-ci.org/dejavuzhou/ginbro)\n    \n## Ginbro Installation\nyou can install it by `go get` command：\n```shell\ngo get github.com/dejavuzhou/ginbro\n```\nthe Ginbro executable binary will locate in $GOPATH/bin\n[check GOBIN is in your environment PATH](https://stackoverflow.com/questions/25216765/gobin-not-set-cannot-run-go-install)\n\n## Usage\n\n### 1. `ginbro gen` generate a new Gin+Gorm+MySQL RESTful APIs Application with JWT middleware and auth\nexample \n\n`ginbro gen -u root -p Password -a \"127.0.0.1:3306\" -d databasename -o \"github.com/user/awesome\" -c utf8 --authTable=users --authPassword=password`\n```bash\n\n$ ginbro gen -h\ngenerate a RESTful APIs app with gin and gorm for gophers\n\nUsage:\n  ginbro gen [flags]\n\nExamples:\nginbro gen -u root -p password -a \"127.0.0.1:38306\" -d dbname -c utf8 --authTable=users --authPassword=pw_column -o=github.com/dejavuzhou/ginbro/out\"\n\nFlags:\n  -l, --appListen string      app listen Address eg:mojotv.cn, using domain will support gin-TLS (default \"127.0.0.1:5555\")\n      --authPassword string   password bycrpt column (default \"password\")\n      --authTable string      the MySQL login table (default \"users\")\n  -h, --help                  help for gen\n  -o, --outPackage string     output package relative to $GOPATH/src\n\nGlobal Flags:\n      --config string          config file (default is $HOME/ginbro.yaml)\n  -a, --mysqlAddr string       MySQL host:port (default \"127.0.0.1:3306\")\n  -c, --mysqlCharset string    MySQL charset (default \"utf8\")\n  -d, --mysqlDatabase string   MySQL database name\n  -p, --mysqlPassword string   MySQL password (default \"password\")\n  -u, --mysqlUser string       MySQL user name (default \"root\")\n```\n#### the generated project directory [ginbro DEMO-code-repository](https://github.com/dejavuzhou/ginbro-son)\n\n### 2. `ginbro bare` generate a bare project with one resource which you have to edit the `config.toml` which is easy for you to customize\n```bash\n$ ginbro bare -h\ncreate a bare project which its mysql flags are not necessary\n\nUsage:\n  ginbro bare [flags]\n\nExamples:\nginbro bare -o=github.com/dejavuzhou/ginbro/out5\"\n\nFlags:\n  -h, --help                help for bare\n  -o, --outPackage string   output package relative to $GOPATH/src\n```\n### 3. `ginbro model` generate GORM models of tables in a MySQL database\n```bash\n$ genbro model -h\ngenerate GORM models of MySQL tables.\n\nUsage:\n  ginbro model [flags]\n\nExamples:\nginbro model -u root -p password -a 127.0.0.1:3306 -d venom -c utf8  -o=github.com/dejavuzhou/ginbro/out_model\n\nFlags:\n  -h, --help                help for model\n  -o, --outPackage string   eg: models,the models will be created at $GOPATH/src/models\n\nGlobal Flags:\n      --config string          config file (default is $HOME/ginbro.yaml)\n  -a, --mysqlAddr string       MySQL host:port (default \"127.0.0.1:3306\")\n  -c, --mysqlCharset string    MySQL charset (default \"utf8\")\n  -d, --mysqlDatabase string   MySQL database name\n  -p, --mysqlPassword string   MySQL password (default \"password\")\n  -u, --mysqlUser string       MySQL user name (default \"root\")\n```\n## [GUI](/gui)\n\n## [Boilerplate Project](/boilerplate)\n\n## environment\n- my development environment\n    - Windows 10 pro 64\n    - go version go1.11.1 windows/amd64\n    - mysql version \u003c= 5.7\n\n## go packages\n```shell\ngo get github.com/gin-contrib/cors\ngo get github.com/gin-contrib/static\ngo get github.com/gin-gonic/autotls\ngo get github.com/gin-gonic/gin\ngo get github.com/sirupsen/logrus\ngo get github.com/spf13/viper\ngo get github.com/spf13/cobra\ngo get github.com/go-redis/redis\ngo get github.com/go-sql-driver/mysql\ngo get github.com/jinzhu/gorm\ngo get github.com/dgrijalva/jwt-go\n```\n## How to fix `go get golang.org/x/crypto/bcrypt` and `go get golang.org/x/crypto/text` error\n```bash\nmkdir -p $GOPATH/src/golang.org/x\ncd $GOPATH/src/golang.org/x\ngit clone https://github.com/golang/crypto\ngit clone https://github.com/golang/text\n```\nretry the command`go get github.com/dejavuzhou/ginbro`\n\n## Info\n- resource table'schema which has no \"ID\",\"id\",\"Id'\" or \"iD\" will not generate model or route.\n- the column which type is json value must be a string which is able to decode into a JSON, when resource is called POST or PATCH from the swaggerUI.\n## Thanks\n- [swagger Specification](https://swagger.io/specification/)\n- [gin-gonic/gin](https://github.com/gin-gonic/gin)\n- [GORM](http://gorm.io/)\n- [viper](https://github.com/spf13/viper)\n- [cobra](https://github.com/spf13/cobra#getting-started)\n- [dgrijalva/jwt-go](https://github.com/dgrijalva/jwt-go)\n- [base64captcha](https://github.com/mojocn/base64Captcha)\n## Please feedback your [`issue`](https://github.com/dejavuzhou/ginbro/issues) with database schema file\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojocn%2Fginbro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmojocn%2Fginbro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojocn%2Fginbro/lists"}