A React Native mobile app that connects to your AI agent server for intelligent assistance.
- Node.js 18+ installed on your MacBook
- Expo CLI:
npm install -g @expo/cli - Expo Go app on your iPhone (from App Store)
- Agent server running on your PC
-
Create the project directory
mkdir agent-app cd agent-app -
Initialize with Expo
npx create-expo-app@latest . --template blank-typescript -
Install dependencies
npm install @expo/vector-icons @react-navigation/native @react-navigation/bottom-tabs @react-navigation/native-stack expo-linear-gradient react-native-safe-area-context react-native-screens expo-constants expo-device expo-network @react-native-async-storage/async-storage expo-file-system expo-sqlite
-
Add the source files
- Copy all the provided source files into the project
- Replace the default App.tsx with our custom one
-
Start the development server
npx expo start
-
Connect your iPhone
- Open Expo Go app on your iPhone
- Scan the QR code from the terminal
- Or connect via the same WiFi network
agent-app/
├── App.tsx # Main app component
├── index.js # Entry point
├── src/
│ ├── context/
│ │ └── ApiContext.tsx # API connection management
│ └── screens/
│ ├── HomeScreen.tsx # Dashboard with server status
│ ├── ChatScreen.tsx # AI chat interface
│ └── SettingsScreen.tsx # Server configuration
└── package.json
-
Find your PC's IP address
# On Windows PC (where your server runs) ipconfig # Look for IPv4 Address (e.g., 192.168.1.100)
-
Configure in the app
- Open the app on your iPhone
- Go to Settings tab
- Enter your server URL:
http://YOUR_PC_IP:3001 - Tap "Save URL" and then "Test" to verify connection
The app defaults to http://192.168.1.100:3001 - update this in Settings for your network.
- Chat Interface: Direct communication with AI agent
- Server Status: Real-time connection monitoring
- Settings: Configure server URL and test connection
- Cross-Platform: Works on iOS and Android via Expo
The app is designed with Apple App Store and Google Play Store requirements in mind:
- Uses only approved APIs and libraries
- No sensitive permissions required
- Self-contained with proper error handling
- Clean, native-style interface design
# Start development server
npm start
# Run on iOS simulator
npm run ios
# Run on Android emulator
npm run android
# Run in web browser (for testing)
npm run web- Server runs on your PC
- Mobile app connects via local IP
- Perfect for personal use and testing
- Server: Deploy to cloud service (AWS, Digital Ocean)
- Domain: Point domain to server
- HTTPS: Add SSL certificate
- Mobile: Update server URL in app
For app store deployment, update app.json:
{
"expo": {
"name": "AI Agent",
"slug": "agent-app",
"platforms": ["ios", "android"],
"version": "1.0.0",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png"
},
"ios": {
"bundleIdentifier": "com.yourcompany.agentapp",
"buildNumber": "1"
},
"android": {
"package": "com.yourcompany.agentapp",
"versionCode": 1
}
}
}- Styles are separated from logic in dedicated style files
- Uses React Native's built-in styling system
- Color scheme and themes easily configurable
- Responsive design for different screen sizes
The app is structured for easy expansion:
- Add new screens in
src/screens/ - Create services in
src/services/ - Extend context in
src/context/ - Keep UX and logic cleanly separated
Can't connect to server:
- Verify both devices on same WiFi network
- Check server is running on PC
- Confirm Windows Firewall allows Node.js
- Test server URL in phone's browser
App crashes or won't start:
- Clear Expo cache:
npx expo start --clear - Reinstall dependencies:
rm -rf node_modules && npm install - Check React Native version compatibility
Chat not working:
- Check server logs for errors
- Verify API endpoints are responding
- Test with simple HTTP client first
- Use
npx expo start --tunnelfor remote testing - Enable debugging with
npx expo start --dev-client - Monitor network requests in Chrome DevTools
- Use console logs for troubleshooting API calls
- Configure app.json with proper identifiers
- Add required assets (icons, splash screens)
- Build with EAS Build or Expo Build
- Submit to stores via Expo Application Services
- App Icons: Add app icons in all required sizes
- Launch Screen: Create proper launch screen
- Privacy Policy: Add privacy policy URL
- App Store Description: Prepare app description and screenshots
Need help? Check the troubleshooting section or ensure your agent-server is running properly.