Thank you for contributing to the ChainForge mobile application. This guide covers the development setup, workflow, and conventions for the mobile module.
pnpm install
cp .env.example .env
# Edit .env with your configuration
pnpm startpnpm testRuns the Jest test suite covering all screens, services, and utility functions.
pnpm lintESLint with Expo configuration. Fix all warnings before opening a pull request.
pnpm start- Metro server starts on
http://localhost:8081by default - Scan the QR code with Expo Go on a physical device
- Press
afor Android emulator,ifor iOS simulator - Use
--clearto clear Metro cache:expo start --clear
- Android:
pnpm android - iOS:
pnpm ios - Web:
pnpm web
cp .env.example .envEXPO_PUBLIC_API_URL=http://localhost:3000
EXPO_PUBLIC_NETWORK=testnetWindows:
ipconfig
# Look for IPv4 Address under your active adaptermacOS/Linux:
ifconfig | grep "inet "
# Look for 192.168.x.x or 10.x.x.x- Create feature branches from
main - Use descriptive kebab-case names:
feature/mobile-auth,fix/scanner-crash - Keep branches focused on a single feature or fix
Follow conventional commits:
feat(mobile): ...— New featuresfix(mobile): ...— Bug fixesdocs(mobile): ...— Documentationtest(mobile): ...— Test additions or changesrefactor(mobile): ...— Code restructuringchore(mobile): ...— Tooling, dependencies, config
- TypeScript — All source files must use TypeScript. No plain
.js. - Functional components — Use hooks and functional patterns. No class components.
- Named exports — Prefer named exports over default exports.
- Accessibility — Every interactive element must have an
accessibilityLabelandaccessibilityHint. - Minimum tap target — 44x44 pt per WCAG 2.5.5.
- Dark mode — Every screen must support both light and dark themes via
useTheme().
- Use
StyleSheet.create()for component styles — no inline styles for layout. - Import theme colors from
useTheme()hook:const { colors } = useTheme(). - Follow existing naming conventions and file organization.
src/
├── screens/ # Screen-level components (one per route)
├── components/ # Reusable UI components
├── services/ # API clients, cache, sync, wallet
├── contexts/ # React Context providers
├── theme/ # Brand colors, typography, navigation themes
├── navigation/ # Stack navigator configuration
├── hooks/ # Custom React hooks
├── types/ # TypeScript interfaces and definitions
├── config/ # Environment configuration and validation
└── __tests__/ # Test files co-located by feature
expo start --clear # Clear Metro cache
rm -rf node_modules && pnpm install # Full reinstall- Physical device: Update
EXPO_PUBLIC_API_URLto your machine's LAN IP - Android Emulator: Use
http://10.0.2.2:3000 - iOS Simulator: Use
http://localhost:3000 - Ensure device and development machine are on the same network
| Issue | Solution |
|---|---|
| Hot reloading not working | Shake device |
| App crashes on startup | Check Metro logs, verify env variables, reinstall deps |
| Bundle errors | Check import paths, restart Metro with --clear |
Before submitting a PR:
- Branch is up to date with
main - All tests pass:
pnpm test - Linting passes:
pnpm lint - New features include tests
- No hardcoded API endpoints (use
.env) - Environment variables documented in
.env.example - Screenshots included for UI changes
- Code follows existing style patterns
- Accessibility labels added for new interactive elements
- Check existing GitHub Issues
- Review the Root README for project context
- Open a new issue with detailed reproduction steps