{"id":16919222,"url":"https://github.com/lvisei/gin-admin-template","last_synced_at":"2025-04-11T16:38:29.101Z","repository":{"id":103096023,"uuid":"286265493","full_name":"lvisei/gin-admin-template","owner":"lvisei","description":"Gin admin template based on gin admin","archived":false,"fork":false,"pushed_at":"2022-07-03T05:59:10.000Z","size":277,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T12:41:20.059Z","etag":null,"topics":["casbin","gin","gin-gonic","go","go-admin","golang","gorm"],"latest_commit_sha":null,"homepage":"https://vue-iview-admin-template.lvisei.icu","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/lvisei.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-09T15:37:04.000Z","updated_at":"2024-01-20T01:31:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e96eb52-b1f2-4757-adcd-f4e7a2f716ce","html_url":"https://github.com/lvisei/gin-admin-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvisei%2Fgin-admin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvisei%2Fgin-admin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvisei%2Fgin-admin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvisei%2Fgin-admin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lvisei","download_url":"https://codeload.github.com/lvisei/gin-admin-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441806,"owners_count":21104077,"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":["casbin","gin","gin-gonic","go","go-admin","golang","gorm"],"created_at":"2024-10-13T19:43:34.008Z","updated_at":"2025-04-11T16:38:29.093Z","avatar_url":"https://github.com/lvisei.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# gin-admin-template\n\n基于 GIN + GORM/MONGO + CASBIN + WIRE 实现的 RBAC 权限管理系统模块\n\n[![License](https://img.shields.io/npm/l/express.svg)](http://opensource.org/licenses/MIT)\n\n\u003c/div\u003e\n\n**Live demo:** [https://vue-iview-admin-template.lvisei.icu](https://vue-iview-admin-template.lvisei.icu)\n\n**Swagger documentation:** [https://admin.lvisei.icu/swagger/index.html](https://admin.lvisei.icu/swagger/index.html)\n\n## 特性\n\n- 遵循 `RESTful API` 设计规范 \u0026 基于接口的编程规范\n- 基于 `GIN` 框架，提供了丰富的中间件支持（JWTAuth、CORS、RequestLogger、RequestRateLimiter、TraceID、CasbinEnforce、Recover、GZIP）\n- 基于 `Casbin` 的 RBAC 访问控制模型 -- **权限控制可以细粒度到按钮 \u0026 接口**\n- 基于 `Gorm/Mongo` 的数据库存储 -- 存储层抽象了标准的外部业务层调用接口，内部采用封闭式实现（为后续切换数据存储提供了较大的便利）\n- 基于 `WIRE` 的依赖注入 -- 依赖注入本身的作用是解决了各个模块间层级依赖繁琐的初始化过程\n- 基于 `Logrus \u0026 Context` 实现了日志输出，通过结合 Context 实现了统一的 TraceID/UserID 等关键字段的输出(同时支持日志钩子写入到`Gorm/Mongo`)\n- 基于 `JWT` 的用户认证 -- 基于 JWT 的黑名单验证机制\n- 基于 `Swaggo` 自动生成 `Swagger` 文档 -- 独立于接口的 mock 实现\n- 基于 `net/http/httptest` 标准包实现了 API 的单元测试\n- 基于 `go mod` 的依赖管理\n\n## 依赖工具\n\n```bash\ngo get -u github.com/cosmtrek/air\ngo get -u github.com/google/wire/cmd/wire\ngo get -u github.com/swaggo/swag/cmd/swag\n```\n\n- [air](https://github.com/cosmtrek/air) -- Live reload for Go apps\n- [wire](https://github.com/google/wire) -- Compile-time Dependency Injection for Go\n- [swag](https://github.com/swaggo/swag) -- Automatically generate RESTful API documentation with Swagger 2.0 for Go.\n\n## 依赖框架\n\n- [Gin](https://gin-gonic.com/) -- The fastest full-featured web framework for Go.\n- [GORM](http://gorm.io/) -- The fantastic ORM library for Golang\n- [Mongo](https://github.com/mongodb/mongo-go-driver) -- The Go driver for MongoDB\n- [Casbin](https://casbin.org/) -- An authorization library that supports access control models like ACL, RBAC, ABAC in Golang\n- [Wire](https://github.com/google/wire) -- Compile-time Dependency Injection for Go\n\n## 快速开始\n\n```bash\n# clone project\ngit clone -b master https://github.com/lvisei/gin-admin-template\n# switch to the project directory\ncd gin-admin-template\n# use air to run\nair\n# or use Makefile to run\nmake start\n# or use the go command to run\ngo run cmd/gin-admin/main.go web -c ./configs/config.toml\n```\n\n启动成功之后，可在浏览器中输入地址进行访问：`http://localhost:10088/swagger/index.html`\n\n## 生成 `swagger` 文档\n\n```bash\n# 基于 Makefile\nmake swagger\n# 或者使用 swag 命令\nswag init --parseDependency --generalInfo ./internal/app/swagger.go --output ./internal/app/swagger\n```\n\n## 重新生成依赖注入文件\n\n```bash\n# 基于 Makefile\nmake wire\n# 或者使用 wire 命令\nwire gen ./internal/app\n```\n\n## 前端工程\n\n[vue-iview-admin-template](https://github.com/lvisei/vue-iview-admin-template) - 基于 View UI 组件库参考 Ant Design Pro 的 vue 2.0 后台管理系统模板\n\n## 工具\n\n- Swagger 文档在线导出[工具](https://www.docs4dev.com/tools/zh/swagger2markup/)\n\n[comment]: \u003c\u003e (- [gin-admin-cli]\u0026#40;https://github.com/gin-admin/gin-admin-cli\u0026#41; - [GinAdmin]\u0026#40;https://github.com/LyricTian/gin-admin\u0026#41; 辅助工具，提供创建项目、快速生成功能模块的功能)\n\n## License\n\n[MIT](https://github.com/lvisei/gin-admin-template/blob/master/LICENSE)\n\nCopyright (c) 2020 lvisei\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvisei%2Fgin-admin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flvisei%2Fgin-admin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvisei%2Fgin-admin-template/lists"}