README.zh-TW.md
基於 Gin + Vue + Element UI OR Arco Design OR Ant Design 的前後端分離權限管理系統。系統初始化極為簡單,只需在設定檔中修改資料庫連線資訊即可。系統支援多指令操作:遷移指令讓資料庫初始化變得更簡單,服務指令則能輕鬆啟動 API 服務。
Element Plus vue3 體驗:https://vue.go-admin.pro
⚠️⚠️⚠️ 帳號 / 密碼: admin / 123456
antd 體驗(go-admin-pro):https://antd.go-admin.pro
⚠️⚠️⚠️ 帳號 / 密碼: admin / 123456
遵循 RESTful API 設計規範
基於 GIN WEB API 框架,提供豐富的中介軟體支援(使用者認證、跨域、存取日誌、追蹤 ID 等)
基於 Casbin 的 RBAC 存取控制模型
JWT 認證
支援 Swagger 文件(基於 swaggo)
基於 GORM 的資料庫儲存,可擴充多種類型資料庫
設定檔簡單的模型映射,快速取得所需設定
程式碼產生工具
表單建構工具
多指令模式
多租戶的支援
TODO: 單元測試
你需要在本機安裝 [go] [gin] node 和 git
同時配套了系列教學(含影片與文件),說明如何從下載到熟練使用。強烈建議先看完這些教學再來實作本專案!!!
go-admin 選單的設定說明 [必看]
如何設定選單資訊以及介面資訊 [必看]
go-admin 權限設定使用說明 [必看]
go-admin 資料權限使用說明 [必看]
如有問題請先參閱上述文件與文章,若仍無法解決,歡迎提出 issue 與 pr。影片教學與文件持續更新中
go 1.26.5
node 版本: v22+(建議 v24 LTS)
套件管理器: pnpm v9+(UI 專案使用 pnpm)
# 建立開發目錄
mkdir goadmin
cd goadmin
重點注意:兩個專案必須放在同一資料夾下;
# 取得後端程式碼
git clone https://github.com/go-admin-team/go-admin.git
# 取得前端程式碼
git clone https://github.com/go-admin-team/go-admin-ui.git
# 進入 go-admin 後端專案
cd ./go-admin
# 更新整理相依套件
go mod tidy
# 編譯專案
go build
# 修改設定
# 檔案路徑 go-admin/config/settings.yml
vi ./config/settings.yml
# 1. 在設定檔中修改資料庫資訊
# 注意: settings.database 下對應的設定資料
# 2. 確認 log 路徑
⚠️注意 在 Windows 環境若未安裝 CGO,會出現這個問題;
E:\go-admin>go build
# github.com/mattn/go-sqlite3
cgo: exec /missing-cc: exec: "/missing-cc": file does not exist
or
D:\Code\go-admin>go build
# github.com/mattn/go-sqlite3
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%
# 首次設定需要初始化資料庫資源資訊
# macOS or linux 下使用
$ ./go-admin migrate -c config/settings.dev.yml
# ⚠️注意:windows 下使用
$ go-admin.exe migrate -c config/settings.dev.yml
# 啟動專案,也可以用 IDE 進行除錯
# macOS or linux 下使用
$ ./go-admin server -c config/settings.yml
# ⚠️注意:windows 下使用
$ go-admin.exe server -c config/settings.yml
在專案啟動時,使用 -a true 系統會自動新增缺少的介面資料
./go-admin server -c config/settings.yml -a true
# 編譯映像檔
docker build -t go-admin .
# 啟動容器,第一個 go-admin 是容器名稱,第二個 go-admin 是映像檔名稱
# -v 映射設定檔 本機路徑:容器路徑
docker run --name go-admin -p 8000:8000 -v /config/settings.yml:/config/settings.yml -d go-admin-server
go generate
# windows
env GOOS=windows GOARCH=amd64 go build main.go
# or
# linux
env GOOS=linux GOARCH=amd64 go build main.go
# 安裝 pnpm(若未安裝)
npm install -g pnpm
# 安裝相依套件
pnpm install
# 中國大陸網路可指定鏡像來源加速
pnpm install --registry=https://registry.npmmirror.com
# 啟動服務
pnpm dev
<span style="margin: 0 5px;" ><a href="https://github.com/wenjianzhang" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/G-Akiraka" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/lwnmengjing" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/bing127" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/chengxiao" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/NightFire0307" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/appleboy" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/ninstein" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/kikiyou" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/horizonzy" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/Cassuis" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/hqcchina" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/nodece" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/stephenzhang0713" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/zhouxixi-dev" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/Jalins" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/wkf928592" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/wxxiong6" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/Silicon-He" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/GizmoOAO" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/bestgopher" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/wxb1207" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/misakichan" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/zhuxuyang" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/mss-boot" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/AuroraV" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/Vingurzhou" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/haimait" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/zyd" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/infnan" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/d1y" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/qlijin" ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/logtous " ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/stepway " ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/NaturalGao " ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/DemoLiang " ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/jfcg " ></a></span> <span style="margin: 0 5px;" ><a href="https://github.com/Nicole0724 " ></a></span>
go-admin 專案一直以來都是在 JetBrains 公司旗下的 GoLand 整合開發環境中進行開發,基於 free JetBrains Open Source license(s) 正版免費授權,在此表達我的謝意。
<a href="https://www.jetbrains.com/?from=kubeadm-ha" target="_blank"></a>
如果你覺得這個專案幫助到了你,可以幫作者買一杯果汁表示鼓勵 :tropical_drink:
Copyright (c) 2026 wenjianzhang