# vertu-metaself **Repository Path**: lzsk_admin/vertu-metaself ## Basic Information - **Project Name**: vertu-metaself - **Description**: vertu-metaself健康项目 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-15 - **Last Updated**: 2025-10-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## 项目特色 - H5适配聊天页面,支持文字、图片、文件对话 - 完整的健康数据分析和可视化 - 用户认证和授权系统 - 实时数据处理和图表展示 - 历史对话管理,可查看和管理过往对话 - 多层级列表样式支持(实心圆点、空心圆点、方块等) ## 环境配置 请创建 `.env.local` 文件并配置以下环境变量: ```bash # FastGPT配置 FASTGPT_BASE_URL=https://fastgpt2.vertu.cn/api/v1/chat/completions FASTGPT_API_KEY=fastgpt-jtu0gvLwjdc9DRnDvIUZ8SakESKkvG9rkplB0MsarrYMOubtMCU5e # 注意:历史对话相关接口地址 # 历史对话列表:https://fastgpt2.vertu.cn/api/core/chat/getHistories # 会话详情:https://fastgpt2.vertu.cn/api/core/chat/getPaginationRecords # 其他必要配置... ``` ## 环境变量配置 聊天功能需要配置以下环境变量: 1. **FASTGPT_BASE_URL**: FastGPT服务器地址 - 默认:`https://fastgpt2.vertu.cn/api/v1/chat/completions` - 聊天接口地址 2. **FASTGPT_API_KEY**: FastGPT API密钥 - 请使用你的有效API密钥 3. **历史对话接口**(无需配置,直接使用): - 历史对话列表:`https://fastgpt2.vertu.cn/api/core/chat/getHistories` - 会话详情:`https://fastgpt2.vertu.cn/api/core/chat/getPaginationRecords` 4. **其他必要配置**: 数据库、Supabase等 ## Markdown支持 聊天页面支持以下Markdown格式: ### 无序列表(多层级) - 一级项目1 - 二级项目1 - 三级项目1 - 三级项目2 - 二级项目2 - 一级项目2 - 二级项目3 ### 有序列表(多层级) 1. 一级项目1 1. 二级项目1 1. 三级项目1 2. 三级项目2 2. 二级项目2 2. 一级项目2 1. 二级项目3 ### 星号列表(* + 空格) - 项目1(减号格式) - 项目2(减号格式) - 项目3(减号格式) * 项目1(星号格式) * 项目2(星号格式) * 项目3(星号格式) * 项目1(星号+空格格式) * 项目2(星号+空格格式) * 项目3(星号+空格格式) + 项目1(加号格式) + 项目2(加号格式) + 项目3(加号格式) ### 粗体和斜体 **粗体文本** *斜体文本* ***粗斜体文本*** ### 代码 `行内代码` ```javascript // 代码块 function hello() { console.log("Hello, World!"); } ``` ### 引用 > 这是一个引用块 > > 可以有多行内容 ### 表格 | 列1 | 列2 | 列3 | |-----|-----|-----| | 数据1 | 数据2 | 数据3 | | 数据4 | 数据5 | 数据6 | ### 多层级列表样式说明 - **一级列表**:实心圆点(●)/ 数字(1, 2, 3) - **二级列表**:空心圆点(○)/ 小写字母(a, b, c) - **三级列表**:方块(■)/ 罗马数字(i, ii, iii) - **四级及以下**:继续使用方块/罗马数字 ## 历史对话功能 聊天页面支持查看和管理历史对话: ### 功能特性 - **新建会话**:点击右上角的"+"按钮创建新对话 - **历史对话**:点击右上角的时钟图标查看历史对话列表 - **会话切换**:在历史对话列表中点击任意对话可切换到该会话 - **自动加载**:切换会话时自动加载该会话的历史消息 ### 访问方式 访问:`/chat?userId=你的用户ID&chatId=对话ID` **示例**: - 新对话:`/chat?userId=123` - 继续对话:`/chat?userId=123&chatId=chat_xxx` ### 用户信息集成 聊天页面会自动: 1. 从URL参数获取userId 2. 调用用户详情API获取完整用户信息 3. 检测系统语言(中文=ZH,英文=EN) 4. 将用户信息和语言信息作为variables传递给FastGPT 用户信息格式(JSON对象): ```json { "name": "张三", "age": 25, "gender": "男", "height": "175cm", "weight": "70kg", "city": "北京" } ``` 健康信息格式(文本描述): ``` 📊 近14天健康数据摘要: 😴 睡眠数据 (7天有记录): 平均睡眠时长: 8小时 平均深度睡眠: 2小时 📅 今日睡眠详情: 总睡眠: 7小时30分钟 深度睡眠: 1小时30分钟 浅睡眠: 5小时 REM睡眠: 1小时 清醒时长: 30分钟 ❤️ 心脏健康 (7天有记录): 平均心率: 75 BPM 最高心率: 120 BPM 最低心率: 60 BPM 平均HRV: 45 ms 🚶 活动数据 (7天有记录): 平均步数: 8,500 步 🫁 呼吸健康 (7天有记录): 平均血氧饱和度: 98.5% 最低血氧饱和度: 96% 最高血氧饱和度: 99% ``` ## Getting Started First, run the development server: ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More To learn more about Next.js, take a look at the following resources: - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! ## Deploy on Vercel The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.