A React Native mobile wrapper for the ConnectX chat application. This app provides a native mobile interface to connect to your ConnectX server.
- π± Native iOS app interface
- π User authentication (login/register)
- π¬ Real-time chat with Socket.IO
- π Push notifications for new messages
- βοΈ Server configuration settings
- π Automatic reconnection
- π¨ Message history and conversations
- π Notification settings and preferences
- π¨ Clean, modern UI
Before running this app, make sure you have:
- Node.js (v16 or newer)
- npm or yarn
- Expo CLI (
npm install -g @expo/cli) - ConnectX Server running (the main application this wrapper connects to)
- iOS Simulator (for iOS development) or Expo Go app on your device
-
Clone and navigate to the project:
cd ConnectX-Mobile/ConnectXMobile -
Install dependencies:
npm install
-
Set up push notifications (Server):
# Install Expo server SDK in your ConnectX server cd /path/to/ConnectX npm install expo-server-sdk
Then follow the instructions in
server-integration/INTEGRATION.mdto integrate push notifications with your ConnectX server. -
Start the development server:
npm start # or npx expo start -
Run on iOS:
npm run ios # or npx expo start --ios
When you first open the app, you'll need to configure the server connection:
- The app will open to the Settings screen
- Enter your ConnectX server URL (e.g.,
localhost:3000oryour-server.com) - Toggle Use HTTPS if your server uses SSL/TLS
- Tap Save & Test Connection
- If successful, tap Continue to proceed to login
For local development, ensure your ConnectX server is running:
cd /path/to/ConnectX
npm run devThe server should be accessible at http://localhost:3000 by default.
- Configure Server: Set your ConnectX server URL in Settings
- Create Account: Register a new account or login with existing credentials
- Start Chatting: Select conversations and send messages
- Settings Button: Access server configuration (available in chat screen)
- Back Button: Return to previous screen
- Logout Button: Sign out and return to login screen
- Login: Enter email and password
- Register: Create new account with name, email, and password
- Auto-login: Remembers your session between app launches
- Conversations List: View all your conversations with unread counts
- Real-time Messages: Instant message delivery via WebSocket
- Message History: Browse previous messages
- Send Messages: Type and send messages to conversations
- Message Notifications: Get notified when you receive new messages
- Permission Management: Easy setup and permission handling
- Notification Settings: Control which notifications you receive
- Sound & Vibration: Customizable notification behavior
- Test Notifications: Verify your notification setup works
- Server URL Configuration: Change the ConnectX server endpoint
- HTTPS Toggle: Enable secure connections
- Connection Testing: Verify server connectivity
- Connection Status: View current connection state
- Notification Preferences: Manage all notification settings
The app connects to these ConnectX server endpoints:
POST /api/auth/login- User authenticationPOST /api/auth/register- User registrationGET /api/auth/me- Get current user infoGET /api/conversations- List conversationsGET /api/conversations/:id/messages- Get conversation messagesPOST /api/messages- Send new messageWebSocket- Real-time communication
src/
βββ contexts/
β βββ AuthContext.tsx # Authentication state management
βββ screens/
β βββ LoginScreen.tsx # Login/register interface
β βββ ChatScreen.tsx # Main chat interface
β βββ SettingsScreen.tsx # Server configuration
βββ services/
β βββ api.ts # HTTP API client
β βββ socket.ts # WebSocket client
App.tsx # Main app with navigation
app.json # Expo configuration
- AuthContext: Manages user authentication state
- API Service: Handles HTTP requests to ConnectX server
- Socket Service: Manages WebSocket connections for real-time features
- Navigation: Stack-based navigation between screens
To extend the app:
- New API Endpoints: Add methods to
src/services/api.ts - New Screens: Create in
src/screens/and add to navigation - Real-time Events: Add socket listeners in
src/services/socket.ts - UI Components: Follow existing styling patterns
-
Configure Expo:
npx expo install expo-dev-client
-
Build for iOS:
npx expo build:ios
-
Or use EAS Build:
npm install -g @expo/eas-cli eas build --platform ios
-
Can't connect to server:
- Verify server URL is correct
- Check if ConnectX server is running
- Try toggling HTTPS setting
- Check network connectivity
-
Login fails:
- Verify credentials are correct
- Check server logs for authentication errors
- Ensure user account exists on server
-
Messages not loading:
- Check WebSocket connection status
- Verify user has access to conversations
- Check server logs for API errors
-
App won't start:
- Run
npm installto ensure dependencies are installed - Clear Expo cache:
npx expo start -c - Check Node.js version compatibility
- Run
-
iOS Simulator not working:
- Ensure Xcode is installed and updated
- Try resetting iOS Simulator
- Check Expo CLI version
- The app allows HTTP connections for local development (configured in
app.json) - For production, always use HTTPS connections
- Authentication tokens are stored securely in AsyncStorage
- Network security exceptions are configured for localhost development
For issues related to:
- ConnectX Server: Check the main ConnectX application documentation
- React Native/Expo: Refer to official Expo documentation
- Mobile App: Check this README or create an issue
This mobile wrapper follows the same license as the main ConnectX application.