// the find
LyricTian/gin-admin
A lightweight, flexible, elegant and full-featured RBAC scaffolding based on GIN + GORM 2.0 + Casbin 2.0 + Wire DI.基于 Golang + Gin + GORM 2.0 + Casbin 2.0 + Wire DI 的轻量级、灵活、优雅且功能齐全的 RBAC 脚手架。
gin-admin is a Go scaffolding project for building RBAC-controlled admin backends using Gin, GORM, Casbin, and Wire for dependency injection. It generates the boilerplate you'd otherwise write yourself: layered architecture (api/biz/dal/schema), JWT auth, audit logging, and a companion CLI to scaffold new CRUD modules from a YAML spec. Aimed at Go developers who need an internal tool or admin panel without designing the auth layer from scratch.
The code generation CLI (gin-admin-cli) is the real value here — defining a model in YAML and getting a full CRUD module with routes, business logic, and data access is a meaningful time save. Wire-based dependency injection is done properly, not bolted on; the wire_gen.go is committed so you don't need the tool just to build. The layered api/biz/dal split is consistent across every module, which makes the codebase predictable once you know the pattern. Casbin integration with Redis-backed permission caching means you can update roles without restarting the service.
The README is almost entirely in Chinese with only a stub English translation, which is a genuine adoption barrier for non-Chinese teams despite the English toggle. The test directory covers only happy-path CRUD operations and requires a live server to run, so there's no fast unit test loop. There's no migration tooling — GORM AutoMigrate is fine for prototyping but will burn you in production when you need to track schema changes. The frontend projects (React and Vue) are separate repos with their own release cadences and no guarantee they stay in sync with the backend.