3.3 KiB
3.3 KiB
项目文件整理说明
📁 目录结构重组
/scripts - 生产脚本
保留的核心脚本:
demo.py- 系统演示脚本port_manager.sh- 统一的端口管理工具(新建)start_service.sh- 后端服务启动脚本start_web_dev.sh- Web开发服务器启动脚本stop_service.sh- 后端服务停止脚本
/tests - 测试文件
保留的核心测试:
tests/unit/- 单元测试test_memory.pytest_retrieval.pytest_sse.py
tests/integration/- 集成测试test_api.py- API接口测试test_e2e_tool_ui.py- 端到端工具UI测试test_full_workflow.py- 完整工作流测试test_mocked_streaming.py- 模拟流式响应测试test_streaming_integration.py- 流式集成测试
/tmp - 临时文件(已移动)
移动到此目录的冗余/临时文件:
重复的端口管理脚本:
clear_dev_ports.shkill_port.shkill_port_auto.shport_functions.sh
临时调试测试脚本:
debug_tool_events.pyintegration_test.pyquick_tool_test.pytest_ai_sdk_endpoint.pytest_frontend_api.pytest_markdown_response.pytest_markdown_simple.pytest_real_streaming.pytest_setup.pytest_streaming_with_debug.pytest_tool_ui.pytest_ui_simple.py
🔧 新建工具
Makefile - 统一命令接口
提供简化的开发命令:
安装与设置:
make install # 安装所有依赖
make check-install # 检查安装状态
服务管理:
make start # 启动后端服务
make stop # 停止后端服务
make restart # 重启后端服务
make status # 检查服务状态
开发:
make dev-web # 启动前端开发服务器
make dev-backend # 启动后端开发模式
make dev # 同时启动前后端
测试:
make test # 运行所有测试
make test-unit # 运行单元测试
make test-integration # 运行集成测试
make test-e2e # 运行端到端测试
工具:
make logs # 查看服务日志
make health # 检查服务健康状态
make port-check # 检查端口状态
make port-kill # 清理端口进程
make clean # 清理临时文件
scripts/port_manager.sh - 统一端口管理
替代了多个重复的端口管理脚本:
./scripts/port_manager.sh kill [port] # 杀死指定端口进程
./scripts/port_manager.sh clear # 清理所有常用开发端口
./scripts/port_manager.sh check [port] # 检查端口状态
./scripts/port_manager.sh help # 显示帮助
📊 整理效果
前:
- 根目录散落大量临时测试脚本
/scripts目录有多个功能重复的端口管理脚本- 缺乏统一的开发命令接口
后:
- 清理了根目录,移除临时文件
- 统一了端口管理功能
- 提供了简洁的Makefile命令接口
- 测试文件按功能分类整理
🚀 使用建议
- 日常开发 - 使用
make dev启动开发环境 - 测试 - 使用
make test运行测试 - 端口管理 - 使用
make port-check和make port-kill - 服务管理 - 使用
make start/stop/restart - 清理 - 使用
make clean清理临时文件
这样的整理使得项目结构更清晰,开发流程更简化。