All Projects → mojocn → Ginbro

mojocn / Ginbro

Licence: mit
Converting a MySQL database'schema to a RESTful golang APIs app in the fastest way

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Ginbro

Golang Gin Realworld Example App
Exemplary real world application built with Golang + Gin
Stars: ✭ 1,780 (+1735.05%)
Mutual labels:  gorm, gin, jwt, boilerplate
Snake
🐍 一款小巧的基于Go构建的开发框架,可以快速构建API服务或者Web网站进行业务开发,遵循SOLID设计原则
Stars: ✭ 615 (+534.02%)
Mutual labels:  gorm, gin, jwt
Ugin
UGin is an API boilerplate written in Go (Golang) with Gin Framework.
Stars: ✭ 110 (+13.4%)
Mutual labels:  gorm, gin, boilerplate
Go Gin Example
An example of gin
Stars: ✭ 4,992 (+5046.39%)
Mutual labels:  gorm, gin, jwt
Zendea
A free, open-source, self-hosted forum software written in Go 官方QQ群:656868
Stars: ✭ 116 (+19.59%)
Mutual labels:  gorm, gin, jwt
Go Admin
基于Gin + Vue + Element UI的前后端分离权限管理系统脚手架(包含了:多租户的支持,基础用户管理功能,jwt鉴权,代码生成器,RBAC资源控制,表单构建,定时任务等)3分钟构建自己的中后台项目;文档:https://doc.go-admin.dev Demo: https://www.go-admin.dev Antd beta版本:https://preview.go-admin.dev
Stars: ✭ 5,439 (+5507.22%)
Mutual labels:  gin, jwt, gorm
golang api
This is a source code of my golang restful api series on youtube.
Stars: ✭ 36 (-62.89%)
Mutual labels:  jwt, gin, gorm
Duckygo
一个同时支持Session以及JWT的高性能高可用 Golang Restful API 脚手架 !
Stars: ✭ 57 (-41.24%)
Mutual labels:  gorm, gin, jwt
Beauty Vuejs Boilerplate
❤️ Real world base Vue.js app. Access/refresh tokens auth, api services, http client, vuex modules
Stars: ✭ 583 (+501.03%)
Mutual labels:  jwt, boilerplate
Open Source Saas Boilerpate
Free SaaS boilerplate (Python/PostgreSQL/ReactJS/Webpack)
Stars: ✭ 582 (+500%)
Mutual labels:  jwt, boilerplate
Learning tools
Go 学习、Go 进阶、Go 实用工具类、Go-kit ,Go-Micro 微服务实践、Go 推送
Stars: ✭ 605 (+523.71%)
Mutual labels:  gin, jwt
Fastapi React
🚀 Cookiecutter Template for FastAPI + React Projects. Using PostgreSQL, SQLAlchemy, and Docker
Stars: ✭ 501 (+416.49%)
Mutual labels:  jwt, boilerplate
Laravel Vue Boilerplate
🐘 A Laravel 6 SPA boilerplate with a users CRUD using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass, and Pug.
Stars: ✭ 472 (+386.6%)
Mutual labels:  jwt, boilerplate
Go Book Store Api
Go Sample project to understand Mysql CRUD operation with best practises Includes logging, JWT, Swagger and Transactions
Stars: ✭ 18 (-81.44%)
Mutual labels:  swagger-ui, jwt
Express Rest Api Boilerplate
Express REST API with JWT Authentication and support for sqlite, mysql, and postgresql
Stars: ✭ 384 (+295.88%)
Mutual labels:  jwt, boilerplate
Go Gin Api
基于 Gin 进行模块化设计的 API 框架,封装了常用功能,使用简单,致力于进行快速的业务研发。比如,支持 cors 跨域、jwt 签名验证、zap 日志收集、panic 异常捕获、trace 链路追踪、prometheus 监控指标、swagger 文档生成、viper 配置文件解析、gorm 数据库组件、gormgen 代码生成工具、graphql 查询语言、errno 统一定义错误码、gRPC 的使用 等等。
Stars: ✭ 730 (+652.58%)
Mutual labels:  gorm, gin
Goforum
Let's go a forum
Stars: ✭ 23 (-76.29%)
Mutual labels:  gorm, gin
Wblog
基于gin+gorm开发的个人博客项目
Stars: ✭ 763 (+686.6%)
Mutual labels:  gorm, gin
Go Restful Api
An idiomatic Go REST API starter kit (boilerplate) following SOLID principles and Clean Architecture
Stars: ✭ 1,043 (+975.26%)
Mutual labels:  jwt, boilerplate
Quickjam
Starter template for Nuxt apps bundled with an API
Stars: ✭ 42 (-56.7%)
Mutual labels:  jwt, boilerplate

Converting a MySQL database'schema to a RESTful golang APIs app in the fastest way

Build Status GoDoc Go Report Card stability-stable codebeat badge codecov

Ginbro is a scaffold tool for Gin-Gorm-MySQL which you just need to input one command to create a mighty RESTful APIs App.

Warning

- this Repo's code has transfered to Felix/ginbro, please visitdejavuzhou/felix

- 代码已经转移到dejavuzhou/felix/ginbro,请移步至dejavuzhou/felix/ginbro

Demo and Translated Document

Feature

Ginbro Installation

you can install it by go get command:

go get github.com/dejavuzhou/ginbro

the Ginbro executable binary will locate in $GOPATH/bin check GOBIN is in your environment PATH

Usage

1. ginbro gen generate a new Gin+Gorm+MySQL RESTful APIs Application with JWT middleware and auth

example

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

$ ginbro gen -h
generate a RESTful APIs app with gin and gorm for gophers

Usage:
  ginbro gen [flags]

Examples:
ginbro 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"

Flags:
  -l, --appListen string      app listen Address eg:mojotv.cn, using domain will support gin-TLS (default "127.0.0.1:5555")
      --authPassword string   password bycrpt column (default "password")
      --authTable string      the MySQL login table (default "users")
  -h, --help                  help for gen
  -o, --outPackage string     output package relative to $GOPATH/src

Global Flags:
      --config string          config file (default is $HOME/ginbro.yaml)
  -a, --mysqlAddr string       MySQL host:port (default "127.0.0.1:3306")
  -c, --mysqlCharset string    MySQL charset (default "utf8")
  -d, --mysqlDatabase string   MySQL database name
  -p, --mysqlPassword string   MySQL password (default "password")
  -u, --mysqlUser string       MySQL user name (default "root")

the generated project directory ginbro DEMO-code-repository

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

$ ginbro bare -h
create a bare project which its mysql flags are not necessary

Usage:
  ginbro bare [flags]

Examples:
ginbro bare -o=github.com/dejavuzhou/ginbro/out5"

Flags:
  -h, --help                help for bare
  -o, --outPackage string   output package relative to $GOPATH/src

3. ginbro model generate GORM models of tables in a MySQL database

$ genbro model -h
generate GORM models of MySQL tables.

Usage:
  ginbro model [flags]

Examples:
ginbro model -u root -p password -a 127.0.0.1:3306 -d venom -c utf8  -o=github.com/dejavuzhou/ginbro/out_model

Flags:
  -h, --help                help for model
  -o, --outPackage string   eg: models,the models will be created at $GOPATH/src/models

Global Flags:
      --config string          config file (default is $HOME/ginbro.yaml)
  -a, --mysqlAddr string       MySQL host:port (default "127.0.0.1:3306")
  -c, --mysqlCharset string    MySQL charset (default "utf8")
  -d, --mysqlDatabase string   MySQL database name
  -p, --mysqlPassword string   MySQL password (default "password")
  -u, --mysqlUser string       MySQL user name (default "root")

GUI

Boilerplate Project

environment

  • my development environment
    • Windows 10 pro 64
    • go version go1.11.1 windows/amd64
    • mysql version <= 5.7

go packages

go get github.com/gin-contrib/cors
go get github.com/gin-contrib/static
go get github.com/gin-gonic/autotls
go get github.com/gin-gonic/gin
go get github.com/sirupsen/logrus
go get github.com/spf13/viper
go get github.com/spf13/cobra
go get github.com/go-redis/redis
go get github.com/go-sql-driver/mysql
go get github.com/jinzhu/gorm
go get github.com/dgrijalva/jwt-go

How to fix go get golang.org/x/crypto/bcrypt and go get golang.org/x/crypto/text error

mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/crypto
git clone https://github.com/golang/text

retry the commandgo get github.com/dejavuzhou/ginbro

Info

  • resource table'schema which has no "ID","id","Id'" or "iD" will not generate model or route.
  • 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.

Thanks

Please feedback your issue with database schema file

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].