基于 Echo + Gorm + Casbin + Uber-FX 实现的 RBAC 权限管理脚手架,致力于提供一套尽可能轻量且优雅的中后台解决方案。

Overview

Echo-Admin

基于 Echo + Gorm + Casbin + Uber-FX 实现的 RBAC 权限管理脚手架,致力于提供一套尽可能轻量且优雅的中后台解决方案。


English | 简体中文

特性

  • 遵循 RESTful API 设计规范
  • 基于 Echo API 框架,提供了丰富的中间件支持 (JWT 认证、鉴权、请求级事务、访问日志、跨域等)
  • 基于 CasbinRBAC 访问控制模型
  • 基于 Gorm V2 的数据库存储,可扩展多种类型数据库
  • 基于 uber/fx 实现依赖注入
  • 支持 Swagger 文档 (基于 swaggo)
  • 配置化、模块化

简介

echo-admin 是基于 vue 和 go 整合了优秀的开源框架和工具实现的中后台管理系统,集成了用户认证、角色管理、动态菜单和权限控制,让任何可能的使用者把时间专注在业务开发上。

在线预览

# 只读账号
用户名: test
密码: 123123

Swagger 文档

前端项目源码

使用说明

欢迎 PR 和 Issue,理想情况下,我都会尽快处理和回复,感谢你关注甚至使用 echo-admin

开发语言推荐版本

node >= 12.22.1
golang >= 1.12 

下载代码

git clone https://github.com/RealLiuSha/echo-admin

生成文档

当你完善了项目中的 swagger 文档需要重新生成,执行以下指令

make swagger

项目初始化

echo-admin 通过 makefile 预设了一些指令,详情可自行查阅

首次启动本项目前需要相对应的修改配置文件 config/config.yaml, 你至少需要保证 mysqlredis 的相关配置正确,随后你可以通过以下指令完成表的新建和数据的初始化

make migrate # 创建表
make setup # 初始化菜单数据

启动

make

计划任务

  • 实现日志审计
  • 全配置化的工作流
  • 个人中心
  • 系统状态展示
  • 生产级的项目质量

互动交流

微信
You might also like...
ACL, RBAC, ABAC authorization middleware for KubeSphere

casbin-kubesphere-auth Casbin-kubesphere-auth is a plugin which apply several security authentication check on kubesphere via casbin. This plugin supp

Incomplete CRUD/RBAC service meant to be a practice for Go

Incomplete CRUD / RBAC Service in Go The repository name means nothing. But your task is to complete this repository on your own to be a functional CR

A practical RBAC implementation

RBAC This project contains a practical RBAC implementation by Golang. It's actually a demo now. With in-memory storage, no database or file storage ye

Open source RBAC library. Associate users with roles and permissions.
Open source RBAC library. Associate users with roles and permissions.

ℹ️ This package is completely open source and works independently from Permify. Associate users with roles and permissions This package allows you to

Golang Mongodb Jwt Auth Example Using Echo
Golang Mongodb Jwt Auth Example Using Echo

Golang Mongodb Jwt Auth Example Using Echo Golang Mongodb Rest Api Example Using Echo Prerequisites Golang 1.16.x Docker 19.03+ Docker Compose 1.25+ I

Golang based User creation and Management application. GORM, Fiber, JWT

User Creation and Management app (BACK-END) Auth Features: Create Clients (regular password + 6 one-time passwords + (optional) QR code and Secret for

Account-jwt-go - Simple JWT api with go, gorm, gin
Account-jwt-go - Simple JWT api with go, gorm, gin

Account JWT on Go Go, gorm, Gin web framework 를 활용하여 만든 간단한 JWT API 입니다. Dajngo의

RBAC scaffolding based on Gin + Gorm+ Casbin + Wire
RBAC scaffolding based on Gin + Gorm+ Casbin + Wire

Gin Admin 基于 GIN + GORM + CASBIN + WIRE 实现的RBAC权限管理脚手架,目的是提供一套轻量的中后台开发框架,方便、快速的完成业务需求的开发。 特性 遵循 RESTful API 设计规范 & 基于接口的编程规范 基于 GIN 框架,提供了丰富的中间件支持(JWT

Casbin-forum is the official forum for Casbin developers and users.

Casbin-forum is the official forum for Casbin developers and users. Link https://forum.casbin.com/ Architecture Casbin-forum contains 2 p

微服务架构-micro-基于go-zero zrpc etcd 单独集成orm-gorm 日志-uber/zap

micro目录结构 pkg ├── api 业务接口逻辑层 所有的业务逻辑存放目录。 │ ├── model 数据模型 数据管理层,仅用于操作管理数据,如数据库操作 ├── assets

Go + Vue开发的管理系统脚手架, 前后端分离, 仅包含项目开发的必需部分, 基于角色的访问控制(RBAC), 分包合理, 精简易于扩展。 后端Go包含了gin、 gorm、 jwt和casbin等的使用, 前端Vue基于vue-element-admin开发
Go + Vue开发的管理系统脚手架, 前后端分离, 仅包含项目开发的必需部分, 基于角色的访问控制(RBAC), 分包合理, 精简易于扩展。 后端Go包含了gin、 gorm、 jwt和casbin等的使用, 前端Vue基于vue-element-admin开发

go-web-mini Go + Vue开发的管理系统脚手架, 前后端分离, 仅包含项目开发的必需部分, 基于角色的访问控制(RBAC), 分包合理, 精简易于扩展。 后端Go包含了gin、 gorm、 jwt和casbin等的使用, 前端Vue基于vue-element-admin开发: http

echo-http - Echo http service

echo-http - Echo http service Responds with json-formatted echo of the incoming request and with a predefined message. Can be install directly (go get

Echo-server - An HTTP echo server designed for testing applications and proxies

echo-server An HTTP echo server designed for testing applications and proxies. R

Golang-echo-sample - Make an out-of-the-box backend based on golang-echo

Golang-echo-sample - Make an out-of-the-box backend based on golang-echo

Echo-mongo-api - Simple Golang REST application with Echo Framework & MongoDB

Echo-mongo-api - Simple Golang REST application with Echo Framework & MongoDB

CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger
CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger

CRUD API Server of Clean Architecture Go(echo) gorm mysql docker swagger build docker-compose up -d --build API Postman and Fiddler is recommended to

CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger
CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger

CRUD API Server of Clean Architecture Go(echo) gorm mysql docker swagger build docker-compose up -d --build API Postman and Fiddler is recommended to

Simple REST-API implementation using Golang with several packages (Echo, GORM) and Docker

Simple REST-API Boilerplate This is a simple implementation of REST-API using Golang and several packages (Echo and GORM). By default, I use PostgreSQ

GORM SQLChaos manipulates DML at program runtime based on gorm

GORM SQLChaos GORM SQLChaos manipulates DML at program runtime based on gorm callbacks Motivation In Financial Business distributed system, account im

Comments
  • 项目无法启动

    项目无法启动

    你好,我将项目拉下来。运行:

    make migrate
    make setup
    make swagger
    make start
    

    然后请求任何接口都会出现

    github.com/RealLiuSha/echo-admin/api/middlewares.CoreMiddleware.core.func1.1.1(0xc001e757a0, 0xc00016c630, 0x1025c88, 0xc000372320)
            /home/admin/Documents/projects/echo-admin/api/middlewares/core_middleware.go:59 +0xf0
    panic(0xdd5260, 0x20dd6b0)
            /usr/lib/go-1.16/src/runtime/panic.go:965 +0x1b9
    github.com/RealLiuSha/echo-admin/api/middlewares.CasbinMiddleware.core.func1.1(0x1025c88, 0xc000372320, 0x0, 0x0)
            /home/admin/Documents/projects/echo-admin/api/middlewares/casbin_middleware.go:53 +0x182
    github.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1(0x1025c88, 0xc000372320, 0x20f8a80, 0xc00076b900)
            /home/admin/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/cors.go:118 +0x15a5
    github.com/RealLiuSha/echo-admin/api/middlewares.ZapMiddleware.core.func1.1(0x1025c88, 0xc000372320, 0x6, 0xeca340)
            /home/admin/Documents/projects/echo-admin/api/middlewares/zap_middleware.go:34 +0x8f
    github.com/RealLiuSha/echo-admin/api/middlewares.CoreMiddleware.core.func1.1(0x1025c88, 0xc000372320, 0x0, 0x0)
            /home/admin/Documents/projects/echo-admin/api/middlewares/core_middleware.go:72 +0x165
    github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc001e60c00, 0x1013888, 0xc000798460, 0xc0002b6300)
            /home/admin/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:646 +0x2bc
    net/http.serverHandler.ServeHTTP(0xc000446540, 0x1013888, 0xc000798460, 0xc0002b6300)
            /usr/lib/go-1.16/src/net/http/server.go:2887 +0xa3
    net/http.(*conn).serve(0xc0001ec280, 0x1015d80, 0xc000476140)
            /usr/lib/go-1.16/src/net/http/server.go:1952 +0x8cd
    created by net/http.(*Server).Serve
            /usr/lib/go-1.16/src/net/http/server.go:3013 +0x39b
    
            {"module": "core-mw"}
    runtime.gopanic
            /usr/lib/go-1.16/src/runtime/panic.go:965
    runtime.panicmem
            /usr/lib/go-1.16/src/runtime/panic.go:212
    runtime.sigpanic
            /usr/lib/go-1.16/src/runtime/signal_unix.go:734
    github.com/RealLiuSha/echo-admin/api/middlewares.CasbinMiddleware.core.func1.1
            /home/admin/Documents/projects/echo-admin/api/middlewares/casbin_middleware.go:53
    github.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1
            /home/admin/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/cors.go:118
    github.com/RealLiuSha/echo-admin/api/middlewares.ZapMiddleware.core.func1.1
            /home/admin/Documents/projects/echo-admin/api/middlewares/zap_middleware.go:34
    github.com/RealLiuSha/echo-admin/api/middlewares.CoreMiddleware.core.func1.1
            /home/admin/Documents/projects/echo-admin/api/middlewares/core_middleware.go:72
    github.com/labstack/echo/v4.(*Echo).ServeHTTP
            /home/admin/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:646
    net/http.serverHandler.ServeHTTP
            /usr/lib/go-1.16/src/net/http/server.go:2887
    net/http.(*conn).serve
            /usr/lib/go-1.16/src/net/http/server.go:1952
    2021-05-18 22:02:22     INFO    runtime/panic.go:965    rolling back transaction due to panic   {"module": "core-mw"}
    2021-05-18 22:02:22     INFO    [email protected]/echo.go:646   beginning database transaction  {"module": "core-mw"}
    2021-05-18 22:02:22     ERROR   runtime/panic.go:965    [PANIC RECOVER] runtime error: invalid memory address or nil pointer dereference goroutine 54 [running]:
    github.com/RealLiuSha/echo-admin/api/middlewares.CoreMiddleware.core.func1.1.1(0xc001e757a0, 0xc000d5ad80, 0x1025c88, 0xc0003720a0)
            /home/admin/Documents/projects/echo-admin/api/middlewares/core_middleware.go:59 +0xf0
    panic(0xdd5260, 0x20dd6b0)
            /usr/lib/go-1.16/src/runtime/panic.go:965 +0x1b9
    github.com/RealLiuSha/echo-admin/api/middlewares.CasbinMiddleware.core.func1.1(0x1025c88, 0xc0003720a0, 0x0, 0x0)
            /home/admin/Documents/projects/echo-admin/api/middlewares/casbin_middleware.go:53 +0x182
    github.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1(0x1025c88, 0xc0003720a0, 0x20f8a80, 0xc00076ac80)
            /home/admin/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/cors.go:118 +0x15a5
    github.com/RealLiuSha/echo-admin/api/middlewares.ZapMiddleware.core.func1.1(0x1025c88, 0xc0003720a0, 0x6, 0xeca340)
            /home/admin/Documents/projects/echo-admin/api/middlewares/zap_middleware.go:34 +0x8f
    github.com/RealLiuSha/echo-admin/api/middlewares.CoreMiddleware.core.func1.1(0x1025c88, 0xc0003720a0, 0x0, 0x0)
            /home/admin/Documents/projects/echo-admin/api/middlewares/core_middleware.go:72 +0x165
    github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc001e60c00, 0x1013888, 0xc000818700, 0xc0007ca500)
            /home/admin/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:646 +0x2bc
    net/http.serverHandler.ServeHTTP(0xc000446540, 0x1013888, 0xc000818700, 0xc0007ca500)
            /usr/lib/go-1.16/src/net/http/server.go:2887 +0xa3
    net/http.(*conn).serve(0xc0001ec280, 0x1015d80, 0xc000476140)
            /usr/lib/go-1.16/src/net/http/server.go:1952 +0x8cd
    created by net/http.(*Server).Serve
            /usr/lib/go-1.16/src/net/http/server.go:3013 +0x39b
    
            {"module": "core-mw"}
    runtime.gopanic
            /usr/lib/go-1.16/src/runtime/panic.go:965
    runtime.panicmem
            /usr/lib/go-1.16/src/runtime/panic.go:212
    runtime.sigpanic
            /usr/lib/go-1.16/src/runtime/signal_unix.go:734
    github.com/RealLiuSha/echo-admin/api/middlewares.CasbinMiddleware.core.func1.1
            /home/admin/Documents/projects/echo-admin/api/middlewares/casbin_middleware.go:53
    github.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1
            /home/admin/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/cors.go:118
    github.com/RealLiuSha/echo-admin/api/middlewares.ZapMiddleware.core.func1.1
            /home/admin/Documents/projects/echo-admin/api/middlewares/zap_middleware.go:34
    github.com/RealLiuSha/echo-admin/api/middlewares.CoreMiddleware.core.func1.1
            /home/admin/Documents/projects/echo-admin/api/middlewares/core_middleware.go:72
    github.com/labstack/echo/v4.(*Echo).ServeHTTP
            /home/admin/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:646
    net/http.serverHandler.ServeHTTP
            /usr/lib/go-1.16/src/net/http/server.go:2887
    net/http.(*conn).serve
            /usr/lib/go-1.16/src/net/http/server.go:1952
    2021-05-18 22:02:22     INFO    runtime/panic.go:965    rolling back transaction due to panic   {"module": "core-mw"}
    ^C2021-05-18 22:02:34   INFO    lifecycle/lifecycle.go:86       Stopping Application
    2021-05-18 22:02:34     DEBUG   runtime/asm_amd64.s:1371        Shutting down the Application
    make: *** [Makefile:16: start] Error 1
    

    运行环境:

    • Ubuntu 21.04
    • Go 1.16.2
    • MariaDB 10(Docker)
    • Redis 6(Docker)
    question 
    opened by ghost 3
Owner
LiuSha
@WeLabCo
LiuSha
Go + Vue开发的管理系统脚手架, 前后端分离, 仅包含项目开发的必需部分, 基于角色的访问控制(RBAC), 分包合理, 精简易于扩展。 后端Go包含了gin、 gorm、 jwt和casbin等的使用, 前端Vue基于vue-element-admin开发

go-web-mini Go + Vue开发的管理系统脚手架, 前后端分离, 仅包含项目开发的必需部分, 基于角色的访问控制(RBAC), 分包合理, 精简易于扩展。 后端Go包含了gin、 gorm、 jwt和casbin等的使用, 前端Vue基于vue-element-admin开发: http

gnimli 119 Dec 25, 2022
Another casbin implementation in golang

casbin Another casbin implementation in golang. Diffrent with the official casbin implementation Use google Common Expression Language as the matcher

null 1 Jan 25, 2022
uber's ssh certificate pam module

Uber's SSH certificate pam module. This is a pam module that will authenticate a user based on them having an ssh certificate in their ssh-agent signe

Uber Open Source 786 Jan 2, 2023
An authorization library that supports access control models like ACL, RBAC, ABAC in Golang

Casbin News: still worry about how to write the correct Casbin policy? Casbin online editor is coming to help! Try it at: https://casbin.org/editor/ C

Casbin 13.5k Jan 2, 2023
goRBAC provides a lightweight role-based access control (RBAC) implementation in Golang.

goRBAC goRBAC provides a lightweight role-based access control implementation in Golang. For the purposes of this package: * an identity has one or mo

Xing 1.4k Dec 29, 2022
Minimalistic RBAC package for Go applications

RBAC Overview RBAC is a package that makes it easy to implement Role Based Access Control (RBAC) models in Go applications. Download To download this

Zack Patrick 104 Oct 25, 2022
YSHOP-GO基于当前流行技术组合的前后端RBAC管理系统:Go1.15.x+Beego2.x+Jwt+Redis+Mysql8+Vue 的前后端分离系统,权限控制采用 RBAC,支持数据字典与数据权限管理,支持动态路由等

YSHOP-GO 后台管理系统 项目简介 YSHOP-GO基于当前流行技术组合的前后端RBAC管理系统:Go1.15.x+Beego2.x+Jwt+Redis+Mysql8+Vue 的前后端分离系统,权限控制采用 RBAC,支持数据字典与数据权限管理,支持动态路由等 体验地址: https://go

null 131 Dec 30, 2022
An authorization library that supports access control models like ACL, RBAC, ABAC in Golang

Casbin News: still worry about how to write the correct Casbin policy? Casbin online editor is coming to help! Try it at: https://casbin.org/editor/ C

Casbin 13.5k Jan 4, 2023
Role Based Access Control (RBAC) with database persistence

Authority Role Based Access Control (RBAC) Go package with database persistence Install First get authority go get github.com/harranali/authority Next

null 240 Dec 8, 2022
Generate K8s RBAC policies based on e2e test runs

rbac-audit Have you ever wondered whether your controller actually needs all the permissions it has granted to it? Wonder no more! This repo contains

Jason Hall 28 Aug 2, 2021