移动客户端工程治理
项目结构概述
使用React Native和TypeScript构建的移动应用,专为知识库RAG系统设计。整体结构如下:
RagMobile/
├── .easignore
├── .gitignore
├── App.tsx # 应用程序主入口文件
├── BUILD_GUIDE.md # 构建指南
├── README.md
├── app.config.js # Expo应用配置
├── assets/ # 静态资源文件
│ └── ... (6 items)
├── eas.json # Expo Application Service配置
├── index.ts # 入口索引文件
├── package-lock.json
├── package.json # 项目依赖配置
├── patches/ # 补丁文件
│ └── react-native+0.76.9.patch
├── src/ # 源代码目录
│ ├── components/ # 可复用UI组件
│ │ ├── MessageBubble.tsx # 消息气泡组件
│ │ └── VoiceButton.tsx # 语音按钮组件
│ ├── constants/ # 常量定义
│ │ └── theme.ts # 主题配置
│ ├── navigation/ # 导航配置
│ │ └── Navigation.tsx # 应用导航结构
│ ├── screens/ # 页面组件
│ │ ├── AgentScreen.tsx # 智能代理页面
│ │ ├── ChatScreen.tsx # 聊天页面
│ │ ├── KnowledgeBaseScreen.tsx # 知识库主页
│ │ ├── KnowledgeDetailScreen.tsx # 知识详情页
│ │ ├── LoginScreen.tsx # 登录页面
│ │ ├── SettingsScreen.tsx # 设置页面
│ │ └── SquareScreen.tsx # 广场页面
│ ├── store/ # 状态管理 (Zustand)
│ │ ├── useAuthStore.ts # 认证状态管理
│ │ ├── useChatStore.ts # 聊天状态管理
│ │ └── useKbStore.ts # 知识库状态管理
│ └── utils/ # 工具函数
│ └── api.ts # API请求工具
└── tsconfig.json # TypeScript配置主要功能模块说明 UI组件层 (components):
MessageBubble.tsx:用于显示消息对话的气泡组件 VoiceButton.tsx:语音输入按钮组件 页面层 (screens):
AgentScreen.tsx:智能代理交互页面 ChatScreen.tsx:聊天功能页面 KnowledgeBaseScreen.tsx:知识库主页 KnowledgeDetailScreen.tsx:知识详情展示页面 LoginScreen.tsx:用户登录页面 SettingsScreen.tsx:应用设置页面 SquareScreen.tsx:共享知识广场页面 状态管理 (store):
useAuthStore.ts:管理用户认证状态 useChatStore.ts:管理聊天会话状态 useKbStore.ts:管理知识库相关状态 工具类 (utils):
api.ts:封装与后端API的通信逻辑 配置文件:
app.config.js:Expo应用配置文件 Navigation.tsx:应用导航结构配置 这个移动客户端项目采用React Native框架开发,具有跨平台特性,可以同时部署到iOS和Android设备上。应用提供了完整的知识库RAG系统功能,包括聊天、知识库管理、智能代理、设置等功能,使用Zustand进行状态管理,确保了良好的用户体验和性能表现。
TODO:这里工程治理方面的内容待补充