Files
ai-video-fullstack/Makefile
Xin Wang 90e3e8a0c0 Refactor backend to support interface-definition driven model resources
- Introduce a new model structure for managing interface definitions and model resources, enhancing the backend's capability to handle various service integrations.
- Update the Makefile to reflect changes in database seeding and resource management commands.
- Remove the deprecated credentials management routes and replace them with a unified model registry API.
- Modify existing routes and schemas to align with the new model structure, ensuring seamless integration with the frontend.
- Enhance database seeding scripts to populate new model resources and their configurations.
- Update README documentation to reflect the new architecture and usage instructions for model resources and interface definitions.
2026-06-14 19:36:12 +08:00

52 lines
1.9 KiB
Makefile

# AI Video Assistant 平台 —— 开发常用命令
#
# 用法:make <目标>,例如 make up / make db-seed。
# 多数目标是对 docker compose 的薄封装,集中沉淀平时手敲的开发脚本。
# 容器内执行 psql 的固定前缀(postgres/postgres/postgres,见 docker-compose.yaml)
PSQL = docker compose exec -T postgres psql -U postgres -d postgres
.DEFAULT_GOAL := help
.PHONY: help up down restart logs api-logs db db-list db-seed db-seed-model-resources db-seed-assistants db-clear db-reset
help: ## 列出所有可用目标
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
# ---- 服务编排 ----
up: ## 起 postgres + api + ui
docker compose up -d
down: ## 停掉所有服务(保留数据卷)
docker compose down
restart: ## 重建 api 容器(改了 env/CORS 后用)
docker compose up -d --force-recreate api
logs: ## 跟随全部服务日志
docker compose logs -f
api-logs: ## 只看后端日志
docker compose logs -f api
# ---- 数据库 ----
db: ## 进入交互式 psql
docker compose exec postgres psql -U postgres -d postgres
db-list: ## 列出模型资源与助手
@$(PSQL) -c "SELECT id, name, capability, interface_type, is_default FROM model_resources ORDER BY id;"
@$(PSQL) -c "SELECT id, name, type FROM assistants ORDER BY id;"
db-seed-model-resources: ## 灌入 12 条模型资源种子(幂等)
$(PSQL) < backend/db/seed_model_resources.sql
db-seed-assistants: ## 灌入 知识库 + 助手 种子(幂等;依赖模型资源已就绪)
$(PSQL) < backend/db/seed_assistants.sql
db-seed: db-seed-model-resources db-seed-assistants ## 全量灌种子(模型资源→知识库→助手,幂等,可重复执行)
db-clear: ## 清空 助手/知识库/模型资源(按依赖顺序)
$(PSQL) -c "TRUNCATE assistant_model_bindings, assistants, knowledge_bases, model_resources CASCADE;"
db-reset: db-clear db-seed ## 清空后重新灌全部种子