P2P chat app built with Expo + React Native.
Supports two uplink modes:
- Online chat: peer discovery/signaling over WebSocket + P2P data channel
- Local chat: Bluetooth Low Energy (BLE) chat using
react-native-ble-plx
npm installCreate .env in project root:
EXPO_PUBLIC_SIGNALING_URL=ws://<your-ip>:8080
# or
# EXPO_PUBLIC_SIGNALING_WS_URL=ws://<your-ip>:8080The app reads either variable from services/env.ts.
npx expo startExpo Go not supported as BLE and WebRTC use native modules make a custom dev build. Use
expo-prebuildoreas-clito build.
Build and run on device/emulator:
npx expo run:android
# or
npx expo run:iosRun lint:
npm run lintCheck out secure-chat-signaling
- BLE requires Bluetooth enabled and runtime permissions.
- For best reliability, test on two physical devices nearby.
- Current BLE service uses UART-like UUIDs inside
services/chatSessionBluetooth.ts. - If your peer peripheral uses different service/characteristic UUIDs, update:
CHAT_SERVICE_UUIDCHAT_TX_CHAR_UUIDCHAT_RX_CHAR_UUID
npm run android- build + run Androidnpm run ios- build + run iOSnpm run web- web preview (limited for native features)npm run lint- lint project
app/- routes/screens (onboarding,user,chat)services/chatSession.ts- internet/WebRTC session logicservices/chatSessionBluetooth.ts- BLE session logicstore/- Zustand stores for user/chat/session state