MCPcopy Index your code
hub / github.com/GoAdminGroup/go-admin

github.com/GoAdminGroup/go-admin @v1.2.26

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2.26 ↗ · + Follow
4,588 symbols 13,928 edges 298 files 969 documented · 21% updated 12mo agov1.2.26 · 2024-04-25★ 8,989221 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

go-admin

the missing golang data admin panel builder tool.







<a href="https://book.go-admin.cn/en">Documentation</a> | 
<a href="http://doc.go-admin.cn/zh/">中文文档</a> | 
<a href="https://github.com/GoAdminGroup/go-admin/raw/v1.2.26/README_CN.md">中文介绍</a> |
<a href="https://demo.go-admin.com">DEMO</a> |
<a href="https://demo.go-admin.cn">中文DEMO</a> |
<a href="https://twitter.com/cg3365688034">Twitter</a> |
<a href="http://discuss.go-admin.com">Forum</a>

Build Status Go Report Card golang telegram slack GoDoc license

Inspired by <a href="https://github.com/z-song/laravel-admin" target="_blank">laravel-admin</a>

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.

$ mkdir new_project && cd new_project
$ go install github.com/GoAdminGroup/adm@latest
$ 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",
                MaxIdleConns: 50,
                MaxOpenConns: 150,
                ConnMaxLifetime: time.Hour,
                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

Extension points exported contracts — how you extend this code

Service (Interface)
(no doc) [29 implementers]
modules/service/service.go
PersistenceDriver (Interface)
PersistenceDriver is a driver of storing and getting the session info. [1 implementers]
modules/auth/session.go
Uploader (Interface)
Uploader is a file uploader which contains the method Upload. [1 implementers]
modules/file/file.go
Dialect (Interface)
Dialect is methods set of different driver. [1 implementers]
modules/db/dialect/dialect.go
Component (Interface)
Component is the interface which stand for a ui component. [1 implementers]
template/template.go
Action (Interface)
(no doc) [3 implementers]
template/types/info.go
Plugin (Interface)
Plugin as one of the key components of goAdmin has three methods. GetRequest return all the path registered in the plugi [1 …
plugins/plugins.go
Handler (FuncType)
Handler defines the handler used by the middleware as return value.
context/context.go

Core symbols most depended-on inside this repo

GetContent
called by 282
template/types/page.go
HTML
called by 271
template/types/display.go
AddField
called by 213
template/types/form.go
Get
called by 194
template/types/display.go
AddField
called by 188
plugins/admin/modules/parameter/parameter.go
SetContent
called by 158
template/types/components.go
New
called by 146
plugins/admin/models/menu.go
a
called by 122
template/login/assets/src/js/combine/3_particles.js

Shape

Method 2,764
Function 1,345
Struct 254
Class 76
TypeAlias 62
FuncType 55
Interface 32

Languages

Go76%
TypeScript24%

Modules by API surface

template/chartjs/assets/chart.min.js911 symbols
template/types/info.go227 symbols
template/types/components.go184 symbols
template/types/form.go169 symbols
modules/config/config.go109 symbols
template/chartjs/chart.go88 symbols
template/chartjs/line.go87 symbols
context/context.go87 symbols
template/template.go82 symbols
template/installation/assets/src/js/jquery.min.js75 symbols
engine/engine.go70 symbols
plugins/plugins.go67 symbols

Dependencies from manifests, versioned

filippo.io/edwards25519v1.1.0 · 1×
github.com/360EntSecGroup-Skylar/excelizev1.4.1 · 1×
github.com/CloudyKit/fastprinterv0.0.0-2020010918263 · 1×
github.com/CloudyKit/jet/v6v6.2.0 · 1×
github.com/GoAdminGroup/htmlv0.0.1 · 1×
github.com/GoAdminGroup/themesv0.0.45 · 1×
github.com/Joker/jadev1.1.3 · 1×
github.com/NebulousLabs/fastrandv0.0.0-2018120315594 · 1×
github.com/Shopify/goreferrerv0.0.0-2022072916590 · 1×
github.com/agiledragon/gomonkeyv2.0.2+incompatible · 1×
github.com/ajg/formv1.5.1 · 1×

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add go-admin \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact