refactor: 标准化项目结构 frontend/ + backend/ + SQLite + run.sh
- 目录重构: app/ -> frontend/,与 backend/ 并列 - 数据库: 默认 SQLite(零配置),修复 DSN() bug - run.sh: 一键启动前后端,支持 start/stop/restart/status - Makefile: install/dev/build/lint/clean 快捷命令 - vite.config.ts: 配置 dev server 端口 5173 + API 代理到 8080 - config.yaml: SQLite 默认配置,开箱即用 - docs/: 完整开发文档(项目结构/API/数据库/规范/部署) - 修复: GORM foreign key 关联声明 - 修复: go get gorm.io/driver/sqlite 依赖
This commit is contained in:
1 parent
7d6674bddd
commit
97c4207ff8
132 files changed
+1572
-34
No files matched your search
@@ -0,0 +1,62 @@
|
||||
# EZOps AIOps - Makefile
|
||||
.PHONY: help install dev build clean status stop restart lint
|
||||
|
||||
help:
|
||||
@echo "EZOps AIOps - 可用命令:"
|
||||
@echo ""
|
||||
@echo " make install - 安装前后端依赖"
|
||||
@echo " make dev - 启动开发环境(前后端)"
|
||||
@echo " make build - 构建生产环境(前后端)"
|
||||
@echo " make build-ui - 仅构建前端"
|
||||
@echo " make build-api - 仅构建后端"
|
||||
@echo " make status - 查看服务状态"
|
||||
@echo " make stop - 停止所有服务"
|
||||
@echo " make restart - 重启所有服务"
|
||||
@echo " make logs - 查看实时日志"
|
||||
@echo " make lint - 代码检查"
|
||||
@echo " make clean - 清理构建产物"
|
||||
@echo ""
|
||||
|
||||
install:
|
||||
@echo "安装后端依赖..."
|
||||
cd backend && go mod download
|
||||
@echo "安装前端依赖..."
|
||||
cd frontend && npm install
|
||||
|
||||
dev:
|
||||
./run.sh start
|
||||
|
||||
build-ui:
|
||||
@echo "构建前端..."
|
||||
cd frontend && npm run build
|
||||
|
||||
build-api:
|
||||
@echo "构建后端..."
|
||||
cd backend && CGO_ENABLED=1 go build -o aiops-server cmd/main.go
|
||||
|
||||
build: build-api build-ui
|
||||
|
||||
status:
|
||||
./run.sh status
|
||||
|
||||
stop:
|
||||
./run.sh stop
|
||||
|
||||
restart:
|
||||
./run.sh restart
|
||||
|
||||
logs:
|
||||
@tail -f backend/logs/server.log frontend/logs/dev.log 2>/dev/null || echo "日志文件不存在"
|
||||
|
||||
lint:
|
||||
@echo "检查后端代码..."
|
||||
cd backend && go vet ./...
|
||||
@echo "检查前端代码..."
|
||||
cd frontend && npm run lint 2>/dev/null || echo "前端 lint 未配置,跳过"
|
||||
|
||||
clean:
|
||||
@echo "清理构建产物..."
|
||||
rm -f backend/aiops-server
|
||||
rm -rf frontend/dist
|
||||
rm -f backend/logs/*.log frontend/logs/*.log
|
||||
@echo "清理完成"
|
||||
Reference in new issue
Block a user