- Build:
yarn ios/yarn android - Test:
yarn test(single test:yarn test -- path/to/test.js) - Lint:
yarn lint - Start:
yarn start
- Naming: Snake_case for MobX properties (is_loading), camelCase for methods/functions
- Imports: React/* → RN components → local imports (stores, components, utils)
- Components: Class components with
@observerdecorator - Async: Use async/await with MobX flows for state mutations
- Formatting: No semicolons, 2-space indentation
- Error handling: Try/catch with console.log for debugging, return error constants
- File extension: .js (not .jsx)
- State: MobX State Tree stores in
src/stores/ - Navigation: React Navigation v6 with stack/bottom tabs
- API: Axios-based services in
src/api/ - Components: Feature-organized in
src/screens/, reusable insrc/components/
- Use
buncommands instead ofyarnwhen available - Follow snake_case convention for state properties
- Use @observer decorators for reactive components
- Prefer async/await over promises for API calls
yarnornpm install- Install dependencies (Yarn preferred for lockfile consistency)npx pod-install iosoryarn pods- Install iOS CocoaPods dependenciesyarn adb- Set up Android reverse proxy for Metro bundler (run after starting emulator)
yarn start- Start Metro bundleryarn ios- Run on iOS simulatoryarn android- Run on Android emulatoryarn lint- Run ESLintyarn test- Run Jest tests
yarn check-dependencies- Check dependency alignmentyarn fix-dependencies- Fix dependency alignment with --write flagyarn postinstall- Apply patches via patch-package
- MobX State Tree (MST) for global state management with stores in
src/stores/ - Main app store in
src/stores/App.jshandles navigation, theming, modals, and global UI state - Authentication managed in
src/stores/Auth.js - User-specific state organized under selected user models
- React Navigation v6 with native stack and bottom tab navigators
- Main tab navigator: Timeline, Mentions, Bookmarks, Discover
- Modal screens for posting, editing, settings, etc.
- Deep linking support for micro.blog URLs and app-specific schemes
- Three API services:
MicroBlogApi.js(main),MicroPubApi.js,XMLRPCApi.js - Axios-based HTTP client with base URL
https://micro.blog - Token-based authentication with auto-refresh handling
- React Native with custom theming supporting light/dark modes
- Extensive use of WebViews for timeline display with hybrid native/web interaction
- Action sheets via
react-native-actions-sheetfor modal interactions - Custom header components and navigation buttons
src/screens/- Screen components organized by featuresrc/components/- Reusable UI components (cells, headers, sheets, etc.)src/stores/- MobX State Tree stores and modelssrc/api/- API service classessrc/utils/- Utility functions
- iOS: Share extension, push notifications, custom text highlighting
- Android: Share menu integration, Firebase notifications
- Native modules for enhanced text editing and image handling
- Observer pattern with
@observerdecorators for MobX reactivity - Snake_case naming convention (author's preference over camelCase)
- Async/await with MobX flows for state mutations
- WebView/native hybrid approach for timeline rendering
- Jest configured with React Native preset
- Test files should follow standard Jest patterns
- Push notifications require
google-services.jsonfor Android (excluded from git) - iOS requires proper signing for push notification capabilities
- Metro bundler runs on port 8081 (use
yarn adbif Android can't connect) - Patch-package used for React Native dependency modifications
- Email-based login with token verification
- App token support as alternative login method
- Multi-account support with user switching
- Deep link handling for signin URLs
- Don't add a semicolon at the end of a line