A golang framework helps gopher to build a data visualization and admin panel in ten minutes

go-admin

the missing golang data admin panel builder tool.

Documentation | 中文介绍 | DEMO | 中文DEMO | Twitter | Forum

Go Report Card Go Report Card golang telegram slack GoDoc license

Inspired by laravel-admin

Preface

GoAdmin is a toolkit to help you build a data visualization admin panel for your golang app.

Online demo: https://demo.go-admin.com

Quick follow up example: https://github.com/GoAdminGroup/example

GoAdmin+vue example: https://github.com/GoAdminGroup/goadmin-vue-example

interface

Features

  • 🚀 Fast: build a production admin panel app in ten minutes.
  • 🎨 Theming: beautiful ui themes supported(default adminlte, more themes are coming.)
  • 🔢 Plugins: many plugins to use(more useful and powerful plugins are coming.)
  • Rbac: out of box rbac auth system.
  • ⚙️ Frameworks: support most of the go web frameworks.

Translation

We need your help: https://github.com/GoAdminGroup/docs/issues/1

Who is using

Comment the issue to tell us.

How to

Following three steps to run it.

Note: now you can quickly start by doing like this.

$ mkdir new_project && cd new_project
$ go install github.com/GoAdminGroup/go-admin/adm
$ adm init

Or (use adm whose version higher or equal than v1.2.16)

$ mkdir new_project && cd new_project
$ go install github.com/GoAdminGroup/go-admin/adm
$ adm init web

Step 1: import sql

Step 2: create main.go

main.go

package main

import (
	"github.com/gin-gonic/gin"
	_ "github.com/GoAdminGroup/go-admin/adapter/gin"
	_ "github.com/GoAdminGroup/go-admin/modules/db/drivers/mysql"
	"github.com/GoAdminGroup/go-admin/engine"
	"github.com/GoAdminGroup/go-admin/plugins/admin"
	"github.com/GoAdminGroup/go-admin/modules/config"
	"github.com/GoAdminGroup/themes/adminlte"
	"github.com/GoAdminGroup/go-admin/template"
	"github.com/GoAdminGroup/go-admin/template/chartjs"
	"github.com/GoAdminGroup/go-admin/template/types"
	"github.com/GoAdminGroup/go-admin/examples/datamodel"
	"github.com/GoAdminGroup/go-admin/modules/language"
)

func main() {
	r := gin.Default()

	eng := engine.Default()

	// global config
	cfg := config.Config{
		Databases: config.DatabaseList{
			"default": {
				Host:         "127.0.0.1",
				Port:         "3306",
				User:         "root",
				Pwd:          "root",
				Name:         "goadmin",
				MaxIdleCon: 50,
				MaxOpenCon: 150,
				Driver:       "mysql",
			},
        	},
		UrlPrefix: "admin",
		// STORE is important. And the directory should has permission to write.
		Store: config.Store{
		    Path:   "./uploads", 
		    Prefix: "uploads",
		},
		Language: language.EN,
		// debug mode
		Debug: true,
		// log file absolute path
		InfoLogPath: "/var/logs/info.log",
		AccessLogPath: "/var/logs/access.log",
		ErrorLogPath: "/var/logs/error.log",
		ColorScheme: adminlte.ColorschemeSkinBlack,
	}

	// add component chartjs
	template.AddComp(chartjs.NewChart())

	_ = eng.AddConfig(cfg).
		AddGenerators(datamodel.Generators).
	        // add generator, first parameter is the url prefix of table when visit.
    	        // example:
    	        //
    	        // "user" => http://localhost:9033/admin/info/user
    	        //		
		AddGenerator("user", datamodel.GetUserTable).
		Use(r)
	
	// customize your pages
	eng.HTML("GET", "/admin", datamodel.GetContent)

	_ = r.Run(":9033")
}

More framework examples: https://github.com/GoAdminGroup/go-admin/tree/master/examples

Step 3: run

GO111MODULE=on go run main.go

visit: http://localhost:9033/admin

account: admin password: admin

A super simple example here

See the docs for more details.

Backers

Your support will help me do better! [Become a backer]

Contribution

here for contribution guide

here to join into the develop team

join telegram

Comments
  • [Question] Using admin CLI

    [Question] Using admin CLI

    I am wondering how to use the admin cli. Got myself a database locally (tried sqlite and postgres), with a table and some data. It seems that I am always getting the error of no table in the database.

    go-admin cli error: no tables, you should build a table of your own business first.

    The database clearly consists of a table. Anything I could do to try to fix this?

  • [BUG] 筛选form.Select 不生效 以及 时间字段为bigint筛选问题

    [BUG] 筛选form.Select 不生效 以及 时间字段为bigint筛选问题

    bug 描述

    1. 按照例子

    // 设置为单选类型
    info.AddField("Gender", "gender", db.Tinyint).
        FieldFilterable(types.FilterType{FormType: form.SelectSingle}).
        FieldFilterOptions([]map[string]string{
            {"value": "0", "field": "men"},
            {"value": "1", "field": "women"},
        }).FieldFilterOptionExt(map[string]interface{}{"allowClear": true})
    

    form.SelectSingle 改为 form.Select 无法实现筛选,单个筛选也不行

    2. 时间筛选

    数据库时间字段为 bigint 无法用时间筛选,请问怎么实现

    复现步骤 [清晰描述复现步骤,让别人也能看到问题]

    期望结果 [描述你原本期望看到的结果]

    复现代码 [提供可复现的代码,仓库,或线上示例]

    版本信息:

    • GoAdmin 版本: [e.g. 1.0.0]
    • golang 版本
    • 浏览器环境
    • 开发环境 [e.g. mac OS]

    其他信息 [如截图等其他信息可以贴在这里]

  • [Question] 图片字段,用的类型是文件,当我编辑这条记录以后图片就没了

    [Question] 图片字段,用的类型是文件,当我编辑这条记录以后图片就没了

    问题描述 [详细地描述问题,让大家都能理解]

    比如新建的时候上传图片和保存数据是好的,但是我这边编辑这个数据,比如标题,图片显示的是udid的一串字符串.png。但是我点击保存列表里面的文件数据就没了。

    示例代码 [如果有必要,展示代码,线上示例,或仓库]

    其他信息 [如截图等其他信息可以贴在这里]

  • [BUG]error:wrong id,No __goadmin_detail_pk parameter

    [BUG]error:wrong id,No __goadmin_detail_pk parameter

    bug 描述

    image

    authRoute.GET("/info/:__prefix", controller.ShowInfo) controller.ShowInfo方法生成 edit、detail的url中没有__goadmin_detail_pk参数

    版本信息:

    • GoAdmin 版本: [e.g. 1.0.0] 1.1.6
  • Feat : adapter for Buffalo Go framework

    Feat : adapter for Buffalo Go framework

    Buffalo is a popular framework for GO with over 4 700 stars and 120+ contributors. It would be super cool, if you would suport it aswell. https://github.com/gobuffalo/buffalo

    Let me know if you have an adapter to test for Buffalo.

    Thanks for this amazing work, looking forward to test it ;)

  • [BUG] 1.2.18 => 1.2.19 critical regression : `FieldJoin` are giving error when filtered by

    [BUG] 1.2.18 => 1.2.19 critical regression : `FieldJoin` are giving error when filtered by

    Bug Description [describe the bug in detail]

    I just upgraded from 1.2.18 to 1.2.19 and all FieldJoin are giving error when filtering.

    How to reproduce

    See code example below

    Expect

    Filtering on an AddField of a table join made by FieldJoin

    Reproduction code

    This gives an error when filtering : "Error 1054: Unknown column 'user.username' in 'where clause'

    Please mind, that I left the db type as of the Field parameter of the FieldJoin (user_id in the example) and not of the type of the field which was joined (username in the example). This worked fine in v1.2.18

    	info.AddField("User", "username", db.Int).
    		FieldJoin(types.Join{
    			Table:     "user",
    			JoinField: "id",
    			Field:     "user_id",
    		}).
    		FieldFilterable(types.FilterType{Operator: types.FilterOperatorLike})
    

    Also the one below which on v1.2.18 didn't give error but also failed to filter correctly - empty result set.

            info.AddField("Customer", "name", db.Int).
    		FieldJoin(types.Join{
    			Table:     "customer",
    			JoinField: "id",
    			Field:     "customer_id",
    		}).
    		FieldFilterable(types.FilterType{FormType: form.SelectSingle}).
    		FieldFilterOptionsFromTable("customer", "name", "id")
    

    Versions

    • GoAdmin version: 1.2.19
    • golang version: 1.15.7
    • Browser: chrome
    • OS mac OS
  • [BUG]form.Multifile无法编辑

    [BUG]form.Multifile无法编辑

    bug 描述 [详细地描述 bug,让大家都能理解]

    上传多文件后无法正常编辑

    复现步骤 [清晰描述复现步骤,让别人也能看到问题]

    期望结果 [描述你原本期望看到的结果]

    上传多文件后正常编辑

    复现代码 [提供可复现的代码,仓库,或线上示例]

    formList.AddField("Images", "images", db.Varchar, form.Multifile).FieldOptionExt(map[string]interface{}{
    		"maxFileCount": 3,
    	})
    

    版本信息:

    • GoAdmin 版本:github.com/GoAdminGroup/go-admin v1.2.13
    • golang 版本:go version go1.14.2 windows/amd64
    • 浏览器环境:chrome
    • 开发环境:windows
  • [Question]关于count(1)、count(*)的问题

    [Question]关于count(1)、count(*)的问题

    问题描述

    plugins/admin/modules/table/default.go:526 这里会报错interface conversion: interface {} is nil, not int64,输出了下total[0],发现key是count(1),而不是count(*)

    不确定什么时候会用到count(*)、什么时候会用到count(1)

  • [BUG] form.File 当没进行更新时,会自动把原数据覆盖为空字符串

    [BUG] form.File 当没进行更新时,会自动把原数据覆盖为空字符串

    bug 描述 [详细地描述 bug,让大家都能理解]

    form.File 在进行编辑的更新的时候, 如果没有进行选择文件, 那么提交后, 会提交个空字符串, 并且还会更新到数据库, 把原数据覆盖为空.

    复现步骤 [清晰描述复现步骤,让别人也能看到问题]

    期望结果 [描述你原本期望看到的结果]

    复现代码 [提供可复现的代码,仓库,或线上示例]

    版本信息:

    • GoAdmin 版本: [e.g. 1.1.6]
    • golang 版本
    • 浏览器环境
    • 开发环境 [e.g. mac OS]

    其他信息 [如截图等其他信息可以贴在这里]

  • [Proposal] form select support filter in db

    [Proposal] form select support filter in db

    Description [describe your advice]

    go admin is great and i love it, but when i use it, i got some problems:

    • the docs about form is empty: https://www.go-admin.com/docs/#/admin/form/components?id=selectbox

    • i want to filter select list in db which is now happened in front end. when the select list is very long, it will perform poorly

    Solution [if any solutions, describe here]

    • add support for filter in server rather than front-end for form.Select

    Others [screenshots and other info]

  • [BUG] info box 无法使用 font-awesome 图标

    [BUG] info box 无法使用 font-awesome 图标

    bug 描述 [详细地描述 bug,让大家都能理解]

    设置 info-box 的 Icon 为 font-awesome 图标时不生效。

    复现步骤 [清晰描述复现步骤,让别人也能看到问题]

    infobox1 := infobox.New().
    		SetText("CPU TRAFFIC").
    		SetColor("#3583af").
    		SetNumber("100").
    		SetIcon(`<i class="fa fa-tint" aria-hidden="true"></i>`).
    		GetContent()
    
    

    期望结果 [描述你原本期望看到的结果] infobox 使用 fa 的图标 实际上最终图标没有,

    image

    同时,发现 fa-tint 直接从 class 里面消失了: image 只剩下了 fa 这个 class

    也尝试了类似 smallbox 的 SetIcon("fa-tint"). 同样无法生效

    复现代码 [提供可复现的代码,仓库,或线上示例]

    版本信息:

    • GoAdmin 版本: 1.0.6
    • golang 版本: go1.13 darwin/amd64
    • 浏览器环境: Chrome 最新稳定版
    • 开发环境: Mac OS

    其他信息 [如截图等其他信息可以贴在这里]

  • [Proposal] support custom db connection interface inheritance

    [Proposal] support custom db connection interface inheritance

    Description [describe your advice]

    • 目前有快速实现后台数据的简单管理的需求
    • go-admin 项目各方面都符合需求,但我这面要使用的 mysql 数据库连接基于内部的 ”服务发现“ 进行初始化,现使用数据库有问题
    • 希望可以支持自定义实现 db Connection 接口,然后可以以类似插件的方式插入项目,进行使用(更为灵活)

    Solution [if any solutions, describe here]

    • db/connection/GetConnectionByDriver 逻辑重构,定义全局私有变量或自定义结构,支持 connection 种类的扩容(可以有一个 public method 追加)
    • 这是现在项目中的
    // GetConnectionByDriver return the Connection by given driver name.
    func GetConnectionByDriver(driver string) Connection {
    	switch driver {
    	case "mysql":
    		return GetMysqlDB()
    	case "mssql":
    		return GetMssqlDB()
    	case "sqlite":
    		return GetSqliteDB()
    	case "postgresql":
    		return GetPostgresqlDB()
    	default:
    		panic("driver not found!")
    	}
    }
    
    • 建议可以类似这样去增加可以扩容的机制(这里简单写个例子)
    var driverFuncMap map[string]func() Connection = map[string]func() Connection{
    	"mysql": GetMysqlDB,
    	"mssql": GetMssqlDB,
    	"sqlite": GetSqliteDB,
    	"postgresql": GetPostgresqlDB
    }
    
    func DriverFuncMapExtend(driver string, f func() Connection) {
    	driverFuncMap[driver]  = f
    }
    
    func GetConnectionByDriver(driver string) Connection {
    	if f, ok := driverFuncMap[driver]; ok {
    		return f()
    	}
    	panic("driver not found!")
    }
    

    Others [screenshots and other info]

  • Does this work with mongodb [Question]

    Does this work with mongodb [Question]

    i like to know how to work with my existing application..

    why cannot I create my own admin function.. because I do to know how can I integrate with my own ..

    can you please give me any direction how to work my app.

  • [Question] any way to use _ILIKE_ operator?

    [Question] any way to use _ILIKE_ operator?

    Description

    I need to use the ILIKE operator on my FilterType so that the filter result becomes case-insensitive. Any other way to support a case-insensitive search on the table?

    Thanks in advance

    Example code

    info.AddField("Name", "name", db.Varchar).
    		FieldFilterable(types.FilterType{Operator: types.FilterOperatorLike}).FieldSortable() // use Ilike operator instead
    
  • [Question]

    [Question]

    Description [describe your questions]

    When I log in with different browser, all other sessions in goadmin_session are deleted. This happens on real production database. Running the same code but with my local database doesn't act this way.

    Example code [If you have any code info]

    Others [screenshots or other info]

    First I log in with admin account on browser 1, then I log in with admin account on browser 2. Reload browser 1 and it alerts following error image

    I checked my postgresDB, and the newest log in somehow deleted all entries before being inserted

  • [BUG]权限模块bug

    [BUG]权限模块bug

    bug 描述 [详细地描述 bug,让大家都能理解]

    线上demo,用户修改密码,权限控制居然是在权限列表里添加?id=2实现的,这样的话每建一个用户,就要单独设置一个权限? 如果不设置权限表中的?id=2,在用户密码修改时,把浏览器地址的id改为1,就能更改admin的密码

    复现步骤 [清晰描述复现步骤,让别人也能看到问题]

    线上demo,用户修改密码,权限控制居然是在权限列表里添加?id=2实现的,这样的话每建一个用户,就要单独设置一个权限? 如果不设置权限表中的?id=2,在用户密码修改时,把浏览器地址的id改为1,就能更改admin的密码

    期望结果 [描述你原本期望看到的结果]

    tables模块的formlist,应该允许对数据进行筛选。数据列表实现了where,表单不支持

    复现代码 [提供可复现的代码,仓库,或线上示例]

    https://demo.go-admin.cn/admin/login

    版本信息:

    • GoAdmin 版本:
    • golang 版本:
    • 浏览器环境:
    • 开发环境:

    其他信息 [如截图等其他信息可以贴在这里]

GoAdmin is a toolkit to help you build a data visualization admin panel for your golang app.
GoAdmin is a toolkit to help you build a data visualization admin panel for your golang app.

the missing golang data admin panel builder tool. Documentation | 中文文档 | 中文介绍 | DEMO | 中文DEMO | Twitter | Forum Inspired by laravel-admin Preface GoAd

Nov 25, 2021
go-admin项目地址已经转移https://github.com/go-admin-team/go-admin
go-admin项目地址已经转移https://github.com/go-admin-team/go-admin

English | 简体中文 基于Gin + Vue + Element UI的前后端分离权限管理系统 系统初始化极度简单,只需要配置文件中,修改数据库连接,系统启动后会自动初始化数据库信息以及必须的基础数据 在线文档国际 在线文档国内 前端项目 视频教程 ✨ 特性 遵循 RESTful API 设

Dec 31, 2022
Simple control panel for Golang based on Gin framework and MongoDB
Simple control panel for Golang based on Gin framework and MongoDB

Summer panel Simple control panel for Golang based on Gin framework and MongoDB How To Install go install github.com/night-codes/summer/summerGen@late

Dec 16, 2022
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.

GraphJin gives you a high performance GraphQL API without you having to write any code. GraphQL is automagically compiled into an efficient SQL query. Use it either as a library or a standalone service.

Dec 29, 2022
Automated penetration and auxiliary systems, providing XSS, XXE, DNS log, SSRF, RCE, web netcat and other Servers,gin-vue-admin
Automated penetration and auxiliary systems, providing XSS, XXE, DNS log, SSRF, RCE, web netcat and other Servers,gin-vue-admin

Simple DNS log Server,easy to ACME DNS challenge log easy send to elasticsearch https://github.com/hktalent/DNS_Server go4Hacker Automated penetration

Dec 30, 2022
Ares-admin - Kratos Project Template For Golang

Kratos Project Template Install Kratos go get -u github.com/go-kratos/kratos/cmd

Feb 15, 2022
快速crud开发框架,甚至于一行代码不用敲;自动根据数据库表结构自动生成crud代码;低代码开发框架;至少减少百分90%工作量;可快速把现有系统转成GfEasy版本;后端使用GoFrame开发;后台前端使用 cool-admin-vue;后台使用自适应布局,手机、PC完美使用。
快速crud开发框架,甚至于一行代码不用敲;自动根据数据库表结构自动生成crud代码;低代码开发框架;至少减少百分90%工作量;可快速把现有系统转成GfEasy版本;后端使用GoFrame开发;后台前端使用 cool-admin-vue;后台使用自适应布局,手机、PC完美使用。

GoFrame: GfEasy GfEasy So Easy 快速crud开发框架,甚至于一行代码不用敲 自动根据数据库表结构自动生成crud代码 低代码开发框架 至少减少百分90%工作量 可快速把现有系统转成GfEasy版本 后端使用GoFrame开发;后台前端使用 cool-admin-vue

Dec 28, 2022
📔 Journal helps you manage multiple journals with ease from the comfort of your terminal, web browser or API client.
📔 Journal helps you manage multiple journals with ease from the comfort of your terminal, web browser or API client.

Journal helps you manage multiple journals with ease from the comfort of your terminal, web browser or API client. You can import/export journals as horcruxes and set simple customizations for layout, theme, and keybindings.

Sep 14, 2022
A Go Application helps you save your contacts on cloud safely

Contact Saver This Application helps you save your contacts on cloud safely. The backend is built with Go programming language and the front end with

Nov 10, 2021
GoCondor is a golang web framework with an MVC like architecture, it's based on Gin framework
GoCondor is a golang web framework with an MVC like architecture, it's based on Gin framework

GoCondor is a golang web framework with an MVC like architecture, it's based on Gin framework, it features a simple organized directory structure for your next project with a pleasant development experience, made for developing modern APIs and microservices.

Dec 29, 2022
Build a TodoList with Go Design and implement a backend RESTful service in golang with CRUD

May we ask Igor to do a little project in leu of sample code? If there is a hire, the hours spent should be invoiced, so please keep track of that. Th

May 5, 2022
DCreater - Build your own blog system with golang

DCreater - Build your own blog system with golang

Aug 18, 2022
REST server to build and install multicloud environments based on shared.configV2

builder A REST server to build and install multicloud environments based on shared.configV2 json For configuration, please see the Documentation Below

Nov 2, 2021
Community system build using GoFrame.
Community system build using GoFrame.

Focus聚焦社区是GoFrame社区项目,采用了简洁强大的GoFrame作为后端WEB框架, 由于前台系统需要SEO因此使用了GF自带template模板引擎,数据库用MySQL,前端使用jQuery/bootstrap框架。

Dec 7, 2022
🔥 Hugo website builder, Hugo themes & Hugo CMS. No code, build with widgets!
🔥 Hugo website builder, Hugo themes & Hugo CMS. No code, build with widgets!

Wowchemy: the website builder for Hugo Join 750,000+ Sites. No Code. Easily Create Future-Proof Websites ✏️ ?? ?? ?? 1. Create any kind of website

Jan 9, 2023
Soong is the replacement for the old Android make-based build system

Soong Soong is the replacement for the old Android make-based build system. It replaces Android.mk files with Android.bp files, which are JSON-like si

Oct 10, 2021
REST-API specifically build to support online store system of Zahir
REST-API specifically build to support online store system of Zahir

Rest Test. • From Above ERD please create Rest full API. Create register API(Include Generate password). • Acceptance o Phone number and email is uniq

Nov 15, 2021
Go (Golang) API REST with Gin FrameworkGo (Golang) API REST with Gin Framework

go-rest-api-aml-service Go (Golang) API REST with Gin Framework 1. Project Description Build REST APIs to support AML service with the support of exte

Nov 21, 2021
[爬虫框架 (golang)] An awesome Go concurrent Crawler(spider) framework. The crawler is flexible and modular. It can be expanded to an Individualized crawler easily or you can use the default crawl components only.

go_spider A crawler of vertical communities achieved by GOLANG. Latest stable Release: Version 1.2 (Sep 23, 2014). QQ群号:337344607 Features Concurrent

Dec 30, 2022