|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Development Commands |
| 6 | + |
| 7 | +### Essential Commands |
| 8 | +- `npm install` - Install dependencies |
| 9 | +- `npm start` - Start web development server (localhost:7474) |
| 10 | +- `npm run mobile-start` - Start React Native Metro bundler |
| 11 | +- `npm run android` - Run on Android (after metro is running) |
| 12 | +- `npm run ios` - Run on iOS (requires `cd ios && pod install && cd ..` first) |
| 13 | +- `npm run build` - Build for production web |
| 14 | +- `npm run lint` - Run ESLint and TypeScript type checking |
| 15 | +- `npm test` - Run Jest tests |
| 16 | +- `npm run clean` - Clean React Native project |
| 17 | + |
| 18 | +## Architecture Overview |
| 19 | + |
| 20 | +### Cross-Platform React Native App |
| 21 | +This is a React Native app with React Native Web support, enabling deployment to mobile (iOS/Android) and web from a single codebase. |
| 22 | + |
| 23 | +### Key Technologies |
| 24 | +- **React Native 0.77.2** with React Native Web |
| 25 | +- **TypeScript** with strict configuration and path aliases |
| 26 | +- **React Router** (react-router-dom for web, react-router-native for mobile) |
| 27 | +- **Styled Components** for styling |
| 28 | +- **i18next** for internationalization |
| 29 | +- **Webpack** for web bundling |
| 30 | + |
| 31 | +### Path Aliases (tsconfig.json) |
| 32 | +``` |
| 33 | +@components → src/components |
| 34 | +@screens → src/screens |
| 35 | +@config → src/config |
| 36 | +@hooks → src/hooks |
| 37 | +@utils → src/utils |
| 38 | +@assets → src/assets |
| 39 | +@types → src/types |
| 40 | +``` |
| 41 | + |
| 42 | +### App Structure |
| 43 | +- **Root.tsx** - Nested context providers (Theme, Modal, Hardware wallet contexts) |
| 44 | +- **App.tsx** - Main routing with React Router, error boundaries |
| 45 | +- **src/screens/** - Main app screens (Pos, Settings, Wallet, History, etc.) |
| 46 | +- **src/components/** - Reusable UI components with platform-specific variants |
| 47 | +- **src/config/** - Configuration (currencies, API URLs, Bitcoin settings) |
| 48 | + |
| 49 | +### Platform-Specific Files |
| 50 | +Components support platform-specific implementations: |
| 51 | +- `.tsx` - Shared |
| 52 | +- `.native.tsx` - Mobile only |
| 53 | +- `.ios.tsx` - iOS only |
| 54 | +- `.android.tsx` - Android only |
| 55 | +- `.web.tsx` - Web only |
| 56 | + |
| 57 | +### Bitcoin Payment App Features |
| 58 | +This is a Bitcoin point-of-sale application with: |
| 59 | +- Hardware wallet integration (Ledger, Trezor, Bitbox via context providers) |
| 60 | +- Bitcoin address validation and wallet derivation (BIP39/BIP84) |
| 61 | +- Lightning Network support |
| 62 | +- NFC/BoltCard payments |
| 63 | +- QR code scanning/generation |
| 64 | +- Non-custodial with auto-withdraw features |
| 65 | + |
| 66 | +### Error Handling & Security |
| 67 | +- Error boundaries with Sentry integration |
| 68 | +- SSL public key pinning |
| 69 | +- Biometric authentication |
| 70 | +- Encrypted storage |
| 71 | +- Screen recording prevention |
| 72 | + |
| 73 | +## Development Notes |
| 74 | + |
| 75 | +### Linting & Type Checking |
| 76 | +Always run `npm run lint` which includes both ESLint and TypeScript checking (`tsc --noemit`). |
| 77 | + |
| 78 | +### Mobile Development |
| 79 | +For mobile development, start Metro bundler first with `npm run mobile-start`, then run platform commands in separate terminals. |
| 80 | + |
| 81 | +### Hardware Wallet Development |
| 82 | +Context providers for hardware wallets are pre-configured in Root.tsx. Use these existing contexts when adding hardware wallet features. |
0 commit comments