A microservice governance interface operation console serving joylive-agent. 一个服务于joylive-agent的微服务治理界面操作控制台。
本项目采用前后端一体化架构:
- 前端:Vue 3 + Vite + Ant Design Vue
- 后端:Go + Gin + GORM
- 部署:Docker多阶段构建,单一镜像包含前后端
joylive-dashboard/
├── frontend/ # 前端Vue项目
├── internal/ # 后端Go代码
├── configs/ # 配置文件
├── cmd/ # CLI命令
├── main.go # 程序入口
├── Makefile # 构建脚本
├── Dockerfile # Docker构建配置
└── docker-compose.yml # Docker Compose配置
确保你已经安装了以下软件:
- Go 1.19+
- Node.js 18+
- MySQL 5.7+
- Redis 6.0+
创建数据库 joylive_dashboard:
CREATE DATABASE joylive_dashboard CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;# 构建前端和后端
make build-all
# 启动服务
make serve打开浏览器访问 http://localhost:8040,默认管理员账号:
- 用户名:
admin - 密码:
admin
# 方式一:使用Makefile
make docker-build
# 方式二:使用脚本
./scripts/deploy.sh v1.0.0# 方式一:使用Docker Compose(推荐)
docker-compose up -d
# 方式二:手动运行
docker run -d -p 8040:8040 --name joylive joylivedashboard:latest打开浏览器访问 http://localhost:8040
# 构建前端
make build-frontend
# 构建后端
make build
# 构建前端和后端
make build-all
# 构建Docker镜像
make docker-build
# 构建并推送镜像
make docker-push
# 清理构建产物
make cleanfrontend/.env.dev- 开发环境frontend/.env.prod- 生产环境
配置文件位于 configs/ 目录:
dev/- 开发环境配置prod/- 生产环境配置
┌─────────────────────────────────────┐
│ Docker Container │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Frontend │ │ Backend │ │
│ │ (Vue + Vite)│ │ (Go + Gin)│ │
│ └─────────────┘ └─────────────┘ │
│ │ │ │
│ └────────┬───────┘ │
│ │ │
│ Static Files │
│ Serving │
└─────────────────────────────────────┘
│
▼
Port 8040
修改 frontend/.env.prod 中的 VITE_API_HTTP 配置,然后重新构建。
使用Docker Compose时,数据会自动挂载到 ./data 目录。
# Docker Compose
docker-compose logs -f joylive
# Docker
docker logs -f joylivecd frontend
npm install
npm run devmake start# 生成代码
make gen-code-config
# 生成Swagger文档
make swagger
# 生成Wire依赖注入
make wire本项目采用 MIT 许可证,详情请查看 LICENSE 文件。