Overview
The mobile app enables users to:- Control AI coding sessions from mobile devices
- Monitor real-time session activity and logs
- Approve or deny tool execution requests
- Participate in voice conversations with AI agents
- Manage multiple machines and sessions
Technology Stack
React Native
Built on React Native 0.81.4 with Expo SDK 54 for cross-platform development
Real-time Sync
Socket.IO WebSocket connection with end-to-end encryption using libsodium
Voice Communication
LiveKit integration for real-time voice conversations with AI agents
Responsive Design
Unistyles for theme-aware, responsive styling across all screen sizes
Architecture
Project Structure
Core Technology Choices
Navigation: Expo Router v6 (file-based routing) Styling: Unistyles with theme support and breakpoints State Management: React Context + custom reducers Encryption: libsodium via@more-tech/react-native-libsodium
Storage: MMKV for fast key-value storage
Networking: Socket.IO + Axios
Key Features
Authentication Flow
QR code-based authentication using challenge-response:- CLI displays QR code with auth challenge
- Mobile app scans QR with expo-camera
- App signs challenge with stored secret key
- Server validates signature and issues token
All authentication uses TweetNaCl cryptographic signatures. No passwords are ever transmitted.
Real-time Synchronization
TheSync class in sources/sync/sync.ts handles:
- WebSocket connection: Persistent Socket.IO connection with auto-reconnect
- Message encryption: All sensitive data encrypted with libsodium
- State updates: Real-time session, message, and machine state changes
- Optimistic updates: Local changes applied immediately, synced in background
- Conflict resolution: Version-based concurrency control
Sync Architecture
Sync Architecture
Voice Communication
LiveKit integration for voice sessions:- Real-time voice input/output
- ElevenLabs integration for text-to-speech
- Audio API for voice processing
- Background audio support
Core Dependencies
Platform Support
Mobile
- iOS: Full native support via Expo
- Android: Full native support via Expo
Web
- Web version shares same codebase (React Native Web)
- Deployed at
app.happy.engineering - Secondary platform with some limitations
Desktop
- macOS: Tauri-based desktop app
yarn tauri:dev- Development with hot reloadyarn tauri:build:production- Production build
Scripts
Development
Development
yarn start- Start Expo development serveryarn ios- Run on iOS simulatoryarn android- Run on Android emulatoryarn web- Run in web browseryarn typecheck- TypeScript validation (run after all changes)
Environment Variants
Environment Variants
yarn ios:dev- iOS with development envyarn ios:preview- iOS with preview envyarn ios:production- iOS with production env- Same variants for
android:*andstart:*
Over-the-Air Updates
Over-the-Air Updates
yarn ota- Deploy OTA update to previewyarn ota:production- Deploy OTA update to production- Uses Expo EAS Update
Builds
Builds
yarn prebuild- Generate native iOS/Android directoriesyarn release:build:appstore- Build for App Store submissionyarn release:build:developer- Build development variants
Styling with Unistyles
All styling uses Unistyles for theme-aware, responsive design:For Expo Image components,
width, height, and tintColor must be set outside of Unistyles as inline props.Internationalization
Full i18n support using thet() function:
- Languages: English, Russian, Polish, Spanish, Catalan, Italian, Portuguese, Japanese, Chinese (Simplified)
- Centralized: Language metadata in
sources/text/_all.ts - Translation files:
sources/text/translations/[code].ts
Data Flow
Design Principles
- Always use translation function: All user-visible strings via
t() - Never show loading errors: Always retry, never block user
- Invalidate sync for main data: Use
InvalidateSyncpattern - No backward compatibility: Move fast, clean migrations
- Always use
useHappyAction: Consistent async operation handling - Layout width constraints: Responsive design via
@/components/layout - Run typecheck after changes: Ensure type safety with
yarn typecheck
Configuration
App configuration viasources/sync/appConfig.ts:
- Environment variants (development, preview, production)
- Server URLs
- Feature flags
- Platform-specific settings