FeathersReactNativeChat

repository·master·Indexed 41 days ago

https://github.com/feathersjs-ecosystem/feathers-react-native-chat

A React Native reference implementation of a chat application designed to integrate with a FeathersJS backend, specifically the feathers-chat server. It provides pre-built screen components for Launch, Login, Signup, Chat, and Settings flows.

Tokens
831
Snippets
3
Records
4
Agent score
2%

What's inside FeathersReactNativeChat

  1. Getting Started with feathers-react-native-chat

    master

    Follow these steps to set up and run the example chat application locally.

    Prerequisites

    Setup Steps

    1. Clone the repository to your local machine.
    2. Install the React Native CLI globally:
      npm install -g react-native-cli
    3. Navigate to the project directory:
      cd path/to/feathers-react-native-chat
    4. Install dependencies using npm or yarn:
      # Using npm
      npm install
      
      # Or using yarn
      yarn install
    5. Ensure you have a feathers-chat server running.

    Running the Application

    To launch the app on a simulator or device, use the following commands:

    For iOS:

    react-native run-ios

    For Android:

    react-native run-android

    If you encounter issues starting the apps, verify your environment configuration by referring to the React Native docs.

    # Install CLI
    npm install -g react-native-cli
    
    # Install dependencies
    npm install
    
    # Run iOS
    react-native run-ios
    
    # Run Android
    react-native run-android
  2. Use the exported screen components from feathers-react-native-chat

    master

    The src/screens/index.js file serves as the public entrypoint for the pre-built screen components in the library. You can import these components to integrate standard chat application flows (Launch, Login, Signup, Chat, and Settings) into your React Native application. Each component is exported as a getter that lazily requires the underlying module.

    const {
      Launch,
      Login,
      Signup,
      Chat,
      Settings
    } = require('feathers-react-native-chat/src/screens');
    
    // Example usage in a React Native Navigator:
    // <Stack.Screen name="Chat" component={Chat} />
  3. Copy local hosts configuration to an Android device via ADB

    master

    This utility automates the process of synchronizing your local machine's /etc/hosts file to an Android device's system hosts file. This is typically used for redirecting network traffic on the device to a local development server.

    Prerequisites:

    • An Android device connected via USB.
    • adb (Android Debug Bridge) installed and configured.
    • The device must be rooted and support adb root and adb remount.
    • A Unix-like environment (macOS/Linux) with ifconfig, grep, tail, cut, and sed available.
    # Run the script directly if it has execution permissions
    ./bin/copy-hosts-to-android