Skip to content

Irtiaz/LessonSync

Repository files navigation

HotspotChat App

A React Native chat application that works offline over a local Wi-Fi network using hotspot-based communication. This app allows two devices to chat directly with each other using TCP sockets when one device creates a Wi-Fi hotspot and the other connects to it.

Features

  • Server/Client mode selection
  • Direct device-to-device communication over TCP
  • Real-time messaging
  • Connection status indication
  • Message history with timestamps
  • Clean and intuitive UI

Prerequisites

  • React Native development environment set up
  • Android device with hotspot capability (for server mode)
  • Another device to connect as a client

Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. For iOS, install pods:
    cd ios && pod install && cd ..

Usage

Server Device (Hotspot Creator)

  1. Enable Wi-Fi hotspot on your Android device manually
  2. Launch the app
  3. Enter a device name
  4. Select "Server Mode"
  5. Press "Start Chat"
  6. The app will start listening for incoming connections

Client Device

  1. Connect to the server device's Wi-Fi hotspot
  2. Launch the app
  3. Enter a device name
  4. Select "Client Mode"
  5. Enter the server's IP address (typically 192.168.43.1 for Android hotspots)
  6. Press "Start Chat"
  7. The app will connect to the server

Technical Details

  • Uses react-native-tcp-socket for TCP communication
  • Server listens on port 8080
  • Messages are sent as JSON objects containing:
    • Text content
    • Sender name
    • Timestamp

Troubleshooting

  1. Make sure the client device is connected to the server's hotspot
  2. Verify the correct IP address is being used
  3. Check that both devices have the app running
  4. Ensure no firewall is blocking the connection

Security Note

This app uses direct TCP communication without encryption. Do not use it for sending sensitive information.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors