All Projects → LyricTian → Gin Admin

LyricTian / Gin Admin

Licence: mit
RBAC scaffolding based on Gin + Gorm 2.0 + Casbin + Wire

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Gin Admin

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 (+196.4%)
Mutual labels:  gorm, gin-admin
Go-Gin-Api
基于golang开源框架 gin封装的api框架
Stars: ✭ 42 (-97.71%)
Mutual labels:  rbac, gorm
ginadmin
基于Gin开发的后台管理系统,集成了、数据库操作、日志管理、权限分配管理、多模板页面、自动分页器、数据库迁移和填充、Docker集成部署等功能、静态资源打包
Stars: ✭ 149 (-91.88%)
Mutual labels:  gorm, gin-admin
Gorm Adapter
Gorm adapter for Casbin
Stars: ✭ 373 (-79.67%)
Mutual labels:  gorm, rbac
Phalgo
phalgo 已经更换为 https://github.com/sunmi-OS/gocore phalgo不在维护
Stars: ✭ 110 (-94.01%)
Mutual labels:  gorm
Kitsvc
⚙ 一個基於 Golang、Consul、Prometheus、EventStore、Gin、Gorm、NSQ 的微服務起始結構。
Stars: ✭ 101 (-94.5%)
Mutual labels:  gorm
Hapi Rbac
RBAC (Rule Based Access Control) for hapijs
Stars: ✭ 98 (-94.66%)
Mutual labels:  rbac
Jcasbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Java
Stars: ✭ 1,335 (-27.25%)
Mutual labels:  rbac
Zendea
A free, open-source, self-hosted forum software written in Go 官方QQ群:656868
Stars: ✭ 116 (-93.68%)
Mutual labels:  gorm
Node Casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Node.js and Browser
Stars: ✭ 1,757 (-4.25%)
Mutual labels:  rbac
Totoval
An out-of-the-box artisan API web-framework written in go.
Stars: ✭ 110 (-94.01%)
Mutual labels:  rbac
Borm
【🔥今日热门】🏎️ 更好的ORM库 (Better ORM library that is simple, fast and self-mockable for Go)
Stars: ✭ 102 (-94.44%)
Mutual labels:  gorm
Gorm.io
GORM official site
Stars: ✭ 111 (-93.95%)
Mutual labels:  gorm
Teleport
Certificate authority and access plane for SSH, Kubernetes, web apps, databases and desktops
Stars: ✭ 10,602 (+477.77%)
Mutual labels:  rbac
Golang Gin Realworld Example App
Exemplary real world application built with Golang + Gin
Stars: ✭ 1,780 (-3%)
Mutual labels:  gorm
Ginbro
Converting a MySQL database'schema to a RESTful golang APIs app in the fastest way
Stars: ✭ 97 (-94.71%)
Mutual labels:  gorm
Ugin
UGin is an API boilerplate written in Go (Golang) with Gin Framework.
Stars: ✭ 110 (-94.01%)
Mutual labels:  gorm
Casbin Cpp
An authorization library that supports access control models like ACL, RBAC, ABAC in C/C++
Stars: ✭ 113 (-93.84%)
Mutual labels:  rbac
Rageframe2
一个基于Yii2高级框架的快速开发应用引擎
Stars: ✭ 1,553 (-15.37%)
Mutual labels:  rbac
Gin Web
由gin + gorm + jwt + casbin组合实现的RBAC权限管理脚手架Golang版, 搭建完成即可快速、高效投入业务开发
Stars: ✭ 107 (-94.17%)
Mutual labels:  rbac

gin-admin

RBAC scaffolding based on GIN + Gorm 2.0 + CASBIN + WIRE (DI).

English | 中文

ReportCard GoDoc License

Features

  • Follow the RESTful API design specification
  • Use Casbin to implement fine-grained access to the interface design
  • Use Wire to resolve dependencies between modules
  • Provides rich Gin middlewares (JWTAuth,CORS,RequestLogger,RequestRateLimiter,TraceID,CasbinEnforce,Recover,GZIP)
  • Support Swagger

Dependent Tools

go get -u github.com/cosmtrek/air
go get -u github.com/google/wire/cmd/wire
go get -u github.com/swaggo/swag/cmd/swag
  • air -- Live reload for Go apps
  • wire -- Compile-time Dependency Injection for Go
  • swag -- Automatically generate RESTful API documentation with Swagger 2.0 for Go.

Dependent Library

  • Gin -- The fastest full-featured web framework for Go.
  • GORM -- The fantastic ORM library for Golang
  • Casbin -- An authorization library that supports access control models like ACL, RBAC, ABAC in Golang
  • Wire -- Compile-time Dependency Injection for Go

Getting Started

git clone https://github.com/LyricTian/gin-admin

cd gin-admin

go run cmd/gin-admin/main.go web -c ./configs/config.toml -m ./configs/model.conf --menu ./configs/menu.yaml

# Or use Makefile: make start

The database and table structure will be automatically created during the startup process. After the startup is successful, you can access the swagger address through the browser: http://127.0.0.1:10088/swagger/index.html

Generate swagger documentation

swag init --parseDependency --generalInfo ./cmd/${APP}/main.go --output ./internal/app/swagger

# Or use Makefile: make swagger

Use wire to generate dependency injection

wire gen ./internal/app

# Or use Makefile: make wire

Use the gin-admin-cli tool to quickly generate modules

Create template file: task.yaml

name: Task
comment: TaskManage
fields:
  - name: Code
    type: string
    required: true
    binding_options: ""
    gorm_options: "size:50;index;"
  - name: Name
    type: string
    required: true
    binding_options: ""
    gorm_options: "size:50;index;"
  - name: Memo
    type: string
    required: false
    binding_options: ""
    gorm_options: "size:1024;"

Execute generate command

gin-admin-cli g -d . -p github.com/LyricTian/gin-admin/v8 -f ./task.yaml

make swagger

make wire

make start

Project Layout

├── cmd
│   └── gin-admin
│       └── main.go       
├── configs
│   ├── config.toml       
│   ├── menu.yaml         
│   └── model.conf        
├── docs                  
├── internal
│   └── app
│       ├── api           
│       ├── config        
│       ├── contextx      
│       ├── dao           
│       ├── ginx          
│       ├── middleware    
│       ├── module        
│       ├── router        
│       ├── schema        
│       ├── service       
│       ├── swagger       
│       ├── test          
├── pkg
│   ├── auth              
│   │   └── jwtauth       
│   ├── errors            
│   ├── gormx             
│   ├── logger            
│   │   ├── hook
│   └── util              
│       ├── conv         
│       ├── hash         
│       ├── json
│       ├── snowflake
│       ├── structure
│       ├── trace
│       ├── uuid
│       └── yaml
└── scripts               

Contact

wechat qqgroup

MIT License

Copyright (c) 2021 Lyric
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].