|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is an **Expo React Native** application targeting iOS, Android, and Web platforms. The app appears to be a purchase/payment template with a circular time selection interface, bottom navigation, and animated components. |
| 8 | + |
| 9 | +## Quick Start |
| 10 | + |
| 11 | +### Development Server |
| 12 | +```bash |
| 13 | +# Start Expo development server (default) |
| 14 | +npm start |
| 15 | + |
| 16 | +# Platform-specific commands |
| 17 | +npm run ios # iOS simulator/device |
| 18 | +npm run android # Android emulator/device |
| 19 | +npm run web # Web browser |
| 20 | +``` |
| 21 | + |
| 22 | +### Code Quality |
| 23 | +```bash |
| 24 | +npm run lint # Run ESLint with Expo configuration |
| 25 | +``` |
| 26 | + |
| 27 | +### Project Reset |
| 28 | +```bash |
| 29 | +npm run reset-project # Reset project to blank state |
| 30 | +``` |
| 31 | + |
| 32 | +## Architecture |
| 33 | + |
| 34 | +### Entry Points |
| 35 | +- **Main App**: `App.tsx` - Root component with gesture handler, safe area provider, and font loading |
| 36 | +- **Router App**: `app/index.tsx` - Sample Expo Router page (file-based routing structure) |
| 37 | + |
| 38 | +### Component Structure |
| 39 | +``` |
| 40 | +/src/components/ |
| 41 | +├── bottom-tab/ # Bottom navigation with 5 tabs (home, payments, project, messages, team) |
| 42 | +├── circle-time/ # Circular draggable time slider with Reanimated |
| 43 | +├── footer/ # Footer component |
| 44 | +├── header/ # Header with avatar and settings |
| 45 | +├── queued/ # Queued items component |
| 46 | +└── time-range/ # Time range selection component |
| 47 | +``` |
| 48 | + |
| 49 | +### Directory Layout |
| 50 | +``` |
| 51 | +/constants/ |
| 52 | +└── theme.ts # Color palette (light/dark mode) and font definitions |
| 53 | +
|
| 54 | +/hooks/ |
| 55 | +├── use-color-scheme.ts # Theme hook |
| 56 | +└── use-color-scheme.web.ts # Web-specific theme hook |
| 57 | +
|
| 58 | +/assets/ |
| 59 | +├── fonts/ # Custom fonts (SF-Pro-Rounded-Bold.otf) |
| 60 | +└── images/ # App images (avatars, icons) |
| 61 | +
|
| 62 | +/scripts/ |
| 63 | +└── reset-project.js # Project reset utility |
| 64 | +``` |
| 65 | + |
| 66 | +### Key Technologies |
| 67 | +- **Expo SDK 54** with React Native 0.81.5 |
| 68 | +- **Expo Router** (file-based routing in `/app`) |
| 69 | +- **React Native Reanimated** for animations (FadeInUp, shared values) |
| 70 | +- **Expo Linear Gradient** for visual effects |
| 71 | +- **React Native Gesture Handler** for touch interactions |
| 72 | +- **@gorhom/bottom-sheet** for bottom sheet components |
| 73 | +- **@shopify/react-native-skia** for high-performance drawing |
| 74 | +- **Expo Haptics** for tactile feedback |
| 75 | + |
| 76 | +## Development Configuration |
| 77 | + |
| 78 | +### TypeScript |
| 79 | +- Strict mode enabled in `tsconfig.json` |
| 80 | +- Path mapping: `@/*` maps to `./*` (e.g., `@/components` → `./components`) |
| 81 | +- Extends Expo's base TypeScript configuration |
| 82 | + |
| 83 | +### Code Style |
| 84 | +- **ESLint**: Expo config with flat config format (`eslint.config.js`) |
| 85 | +- **VSCode Settings**: Auto-fix, organize imports, and sort members on save |
| 86 | +- **Recommended Extension**: Expo VSCode Tools (`expo.vscode-expo-tools`) |
| 87 | + |
| 88 | +### Expo Configuration |
| 89 | +- **App Name**: PurchaseTemplate |
| 90 | +- **Bundle Identifier**: purchasetemplate |
| 91 | +- **New Architecture**: Enabled |
| 92 | +- **React Compiler**: Enabled (experimental) |
| 93 | +- **Edge-to-Edge**: Enabled on Android |
| 94 | +- **Supports Tablet**: iOS |
| 95 | + |
| 96 | +## Key Implementation Patterns |
| 97 | + |
| 98 | +### 1. Font Loading |
| 99 | +Custom fonts loaded via `useFonts` hook: |
| 100 | +```typescript |
| 101 | +const [fontsLoaded] = useFonts({ |
| 102 | + 'SF-Pro-Rounded-Bold': require('./assets/fonts/SF-Pro-Rounded-Bold.otf'), |
| 103 | +}); |
| 104 | +``` |
| 105 | + |
| 106 | +### 2. Animated Components |
| 107 | +Components use React Native Reanimated with shared values: |
| 108 | +```typescript |
| 109 | +const selectedDuration = useSharedValue(5); |
| 110 | +// Animated.View entering={FadeInUp.duration(600)} |
| 111 | +``` |
| 112 | + |
| 113 | +### 3. Safe Areas |
| 114 | +All screen edges handled with `useSafeAreaInsets`: |
| 115 | +```typescript |
| 116 | +const { top, bottom } = useSafeAreaInsets(); |
| 117 | +``` |
| 118 | + |
| 119 | +### 4. Icons |
| 120 | +Using `@expo/vector-icons`: |
| 121 | +- FontAwesome for header icons |
| 122 | +- AntDesign for bottom tab icons |
| 123 | + |
| 124 | +### 5. Color Scheme |
| 125 | +Theme colors defined in `/constants/theme.ts` with light/dark mode support. |
| 126 | + |
| 127 | +## Development Tips |
| 128 | + |
| 129 | +### Running Tests |
| 130 | +- No test runner configured (no Jest, Detox, or testing library found) |
| 131 | +- Consider adding testing setup if needed |
| 132 | + |
| 133 | +### Debugging |
| 134 | +- Use `npx expo start --clear` to clear Metro cache if needed |
| 135 | +- Shake device/emulator to open Expo DevTools |
| 136 | +- Check Metro bundler logs for build errors |
| 137 | + |
| 138 | +### Platform-Specific Code |
| 139 | +- Platform-specific hooks: `use-color-scheme.ts` vs `use-color-scheme.web.ts` |
| 140 | +- Platform.select() used for font definitions in theme.ts |
| 141 | + |
| 142 | +## Common Tasks |
| 143 | + |
| 144 | +### Adding a New Component |
| 145 | +1. Create directory in `/src/components/{ComponentName}/` |
| 146 | +2. Export component in `index.tsx` |
| 147 | +3. Import and use in relevant parent component |
| 148 | + |
| 149 | +### Adding a New Route |
| 150 | +1. Create file in `/app/` directory for Expo Router |
| 151 | +2. Use `expo-router` navigation (`useRouter`, `usePathname`) |
| 152 | + |
| 153 | +### Modifying Theme |
| 154 | +1. Update colors/fonts in `/constants/theme.ts` |
| 155 | +2. Colors use standard React Native color values |
| 156 | +3. Fonts use Platform.select for OS-specific defaults |
| 157 | + |
| 158 | +### Resetting Project |
| 159 | +Run `npm run reset-project` - This will either move or delete existing app structure and create a blank template. |
| 160 | + |
| 161 | +## Dependencies |
| 162 | + |
| 163 | +### Major Dependencies |
| 164 | +- `react`: 19.1.0 |
| 165 | +- `react-native`: 0.81.5 |
| 166 | +- `expo`: ~54.0.20 |
| 167 | +- `@react-navigation/native`: ^7.1.8 |
| 168 | +- `react-native-reanimated`: ~4.1.1 |
| 169 | + |
| 170 | +### Development Dependencies |
| 171 | +- `typescript`: ~5.9.2 |
| 172 | +- `eslint`: ^9.25.0 |
| 173 | +- `eslint-config-expo`: ~10.0.0 |
| 174 | + |
| 175 | +## Known Quirks |
| 176 | + |
| 177 | +1. **Dual Structure**: The repo has both traditional `App.tsx` structure and Expo Router structure in `/app/`. Main app uses `App.tsx`. |
| 178 | + |
| 179 | +2. **Custom Fonts**: SF-Pro-Rounded-Bold font is loaded manually - ensure font file exists in `/assets/fonts/`. |
| 180 | + |
| 181 | +3. **Animation Heavy**: Components use React Native Reanimated extensively - ensure proper understanding of shared values and animated styles. |
| 182 | + |
| 183 | +4. **Platform Paths**: TypeScript path mapping `@/*` → `./*` means imports can use `@/` prefix from anywhere. |
0 commit comments