feat: 完成智能健康管家网站搭建

实现了 AI 对话、图片识别与营养分析、健康数据管理三大核心功能:

- AI 对话:集成豆包大语言模型,支持流式输出和多轮对话
- 图片识别:使用视觉模型识别食物,自动分析卡路里和营养成分
- 健康档案:支持饮食记录、运动记录和数据统计,数据持久化存储
- UI 优化:使用 shadcn/ui 组件库,现代化响应式设计

所有功能已完成开发并通过类型检查。
This commit is contained in:
jaystar
2026-01-22 09:40:07 +08:00
commit afd1531959
87 changed files with 19648 additions and 0 deletions

14
scripts/build.sh Normal file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
set -Eeuo pipefail
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
cd "${COZE_WORKSPACE_PATH}"
echo "Installing dependencies..."
pnpm install --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
echo "Building the project..."
npx next build
echo "Build completed successfully!"

33
scripts/dev.sh Normal file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
set -Eeuo pipefail
PORT=5000
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
NODE_ENV=development
DEPLOY_RUN_PORT=5000
cd "${COZE_WORKSPACE_PATH}"
kill_port_if_listening() {
local pids
pids=$(ss -H -lntp 2>/dev/null | awk -v port="${DEPLOY_RUN_PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
if [[ -z "${pids}" ]]; then
echo "Port ${DEPLOY_RUN_PORT} is free."
return
fi
echo "Port ${DEPLOY_RUN_PORT} in use by PIDs: ${pids} (SIGKILL)"
echo "${pids}" | xargs -I {} kill -9 {}
sleep 1
pids=$(ss -H -lntp 2>/dev/null | awk -v port="${DEPLOY_RUN_PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
if [[ -n "${pids}" ]]; then
echo "Warning: port ${DEPLOY_RUN_PORT} still busy after SIGKILL, PIDs: ${pids}"
else
echo "Port ${DEPLOY_RUN_PORT} cleared."
fi
}
echo "Clearing port ${PORT} before start."
kill_port_if_listening
echo "Starting HTTP service on port ${PORT} for dev..."
npx next dev --webpack --port $PORT

9
scripts/prepare.sh Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -Eeuo pipefail
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
cd "${COZE_WORKSPACE_PATH}"
echo "Installing dependencies..."
pnpm install --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only

15
scripts/start.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -Eeuo pipefail
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
PORT=5000
DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-$PORT}"
start_service() {
cd "${COZE_WORKSPACE_PATH}"
echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
npx next start --port ${DEPLOY_RUN_PORT}
}
echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
start_service