feat: 更新 CLAUDE.md 文件及多个组件以优化用户体验和功能
- 更新 CLAUDE.md 文件,重构架构部分,增加认证和数据层的描述 - 在 GoalsScreen 中新增目标模板选择功能,支持用户选择和创建目标 - 在 CreateGoalModal 中添加初始数据支持,优化目标创建体验 - 新增 GoalTemplateModal 组件,提供目标模板选择界面 - 更新 NotificationHelpers,支持构建深度链接以便于导航 - 在 CoachScreen 中处理路由参数,增强用户交互体验 - 更新多个组件的样式和逻辑,提升整体用户体验 - 删除不再使用的中文回复规则文档
This commit is contained in:
63
CLAUDE.md
63
CLAUDE.md
@@ -11,35 +11,38 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
- **Reset project**: `npm run reset-project`
|
||||
|
||||
## Architecture
|
||||
- **Framework**: React Native (Expo) with TypeScript.
|
||||
- **Navigation**: Expo Router for file-based routing (`app/` directory).
|
||||
- **State Management**: Redux Toolkit with slices for different domains (user, training plans, workouts, challenges, etc.).
|
||||
- **UI**: Themed components (`ThemedText`, `ThemedView`) and reusable UI elements (`Collapsible`, `ParallaxScrollView`).
|
||||
- **API Layer**: Service files for communicating with backend APIs (`services/` directory).
|
||||
- **Data Persistence**: AsyncStorage for local data storage.
|
||||
- **Platform-Specific**: Android (`android/`) and iOS (`ios/`) configurations with native modules.
|
||||
- **Hooks**: Custom hooks for color scheme (`useColorScheme`), theme management (`useThemeColor`), and Redux integration (`useRedux`).
|
||||
- **Dependencies**: React Navigation for tab-based navigation, Expo modules for native features (haptics, blur, image picking, etc.), and third-party libraries for specific functionality.
|
||||
- **Framework**: React Native (Expo) with TypeScript using Expo Router for file-based navigation
|
||||
- **State Management**: Redux Toolkit with domain-specific slices (`store/`) and typed hooks (`hooks/redux.ts`)
|
||||
- **Authentication**: Custom auth guard system with `useAuthGuard` hook for protected navigation
|
||||
- **Navigation**:
|
||||
- File-based routing in `app/` directory with nested layouts
|
||||
- Tab-based navigation with custom styling and haptic feedback
|
||||
- Route constants defined in `constants/Routes.ts`
|
||||
- **UI System**:
|
||||
- Themed components (`ThemedText`, `ThemedView`) with color scheme support
|
||||
- Custom icon system with `IconSymbol` component for iOS symbols
|
||||
- Reusable UI components in `components/ui/`
|
||||
- **Data Layer**:
|
||||
- API services in `services/` directory with centralized API client
|
||||
- AsyncStorage for local persistence
|
||||
- Background task management for sync operations
|
||||
- **Native Integration**:
|
||||
- Health data integration with HealthKit
|
||||
- Apple Authentication
|
||||
- Camera and photo library access for posture assessment
|
||||
- Push notifications with background task support
|
||||
- Haptic feedback integration
|
||||
|
||||
## Key Features
|
||||
- **Authentication**: Login flow with Apple authentication support.
|
||||
- **Training Plans**: Creation and management of personalized pilates training plans.
|
||||
- **Workouts**: Daily workout tracking and session management.
|
||||
- **AI Features**: AI coach chat and posture assessment capabilities.
|
||||
- **Health Integration**: Integration with health data tracking.
|
||||
- **Content Management**: Article reading and educational content.
|
||||
- **Challenge System**: Challenge participation and progress tracking.
|
||||
- **User Profiles**: Personal information management and goal setting.
|
||||
## Key Architecture Patterns
|
||||
- **Redux Auto-sync**: Listener middleware automatically syncs checkin data changes to backend
|
||||
- **Type-safe Navigation**: Uses Expo Router with TypeScript for route type safety
|
||||
- **Authentication Flow**: `pushIfAuthedElseLogin` function handles auth-protected navigation
|
||||
- **Theme System**: Dynamic theming with light/dark mode support and color tokens
|
||||
- **Service Layer**: Centralized API client with interceptors and error handling
|
||||
|
||||
## Directory Structure
|
||||
- `app/`: Main application screens and routing
|
||||
- `components/`: Reusable UI components
|
||||
- `constants/`: Application constants and configuration
|
||||
- `hooks/`: Custom React hooks
|
||||
- `services/`: API service layer
|
||||
- `store/`: Redux store and slices
|
||||
- `types/`: TypeScript type definitions
|
||||
|
||||
|
||||
## rules
|
||||
- 路由跳转使用 pushIfAuthedElseLogin
|
||||
## Development Conventions
|
||||
- Use absolute imports with `@/` prefix for all internal imports
|
||||
- Follow existing Redux slice patterns for state management
|
||||
- Implement auth guards using `useAuthGuard` hook for protected features
|
||||
- Use themed components for consistent styling
|
||||
- Follow established navigation patterns with typed routes
|
||||
Reference in New Issue
Block a user