- Deleted `useBackgroundTasks.ts` hook and its associated logic for managing background tasks. - Removed `backgroundTaskManager.ts` service and all related task definitions and registrations. - Cleaned up `Podfile.lock` and `package.json` to remove unused dependencies related to background tasks. - Updated iOS project files to eliminate references to removed background task components. - Added new background fetch identifier in `Info.plist` for future use.
44 lines
2.2 KiB
Markdown
44 lines
2.2 KiB
Markdown
# CLAUDE.md
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
## Commands
|
|
- **Run on iOS**: `npm run ios`
|
|
|
|
## Architecture
|
|
- **Framework**: React Native (Expo Prebuild/Ejected) 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`, every page should use Routes define and jump
|
|
- **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/`
|
|
- UI Colors in `constants/Colors.ts`
|
|
- **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 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
|
|
|
|
## 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 |