A full-stack real-time private chat application built with React Native and Node.js.
- Authentication — Register and login with JWT-based access and refresh token flow
- Session rehydration — Secure token storage with auto session restore on app launch
- User search — Find other users by email address
- Private messaging — One-to-one chat with persistent history stored in MongoDB
- Real-time messaging — Instant message delivery powered by Socket.IO
- Typing indicator — Live typing status in chat rooms
- Room-based sockets — Efficient socket architecture with join/leave room events
| Library |
Purpose |
| React Native 0.83 (CLI) |
Mobile framework |
| TypeScript |
Type safety |
| Redux Toolkit + Redux-Saga |
State management & async side effects |
| Axios |
HTTP client with JWT interceptor |
| Socket.IO Client |
Real-time communication |
| React Navigation |
Screen navigation |
| react-native-gifted-chat |
Chat UI |
| AsyncStorage |
Secure local token storage |
| Technology |
Purpose |
| Node.js + Express |
REST API server |
| MongoDB + Mongoose |
Database & ODM |
| Socket.IO |
WebSocket server |
| JWT |
Access & refresh token authentication |
Register / Login
↓
Home Screen
↓
Search User by Email
↓
Open Chat
↓
Load Chat History ←→ Send / Receive Messages (real-time)
↓
Back / Logout
- Node.js >= 20
- Android Studio (for Android) or Xcode (for iOS)
- A running instance of the TextRiz backend (update link if needed)
npm install
npx react-native start # start Metro bundler
npx react-native run-android # run on Android
# or
npx react-native run-ios # run on iOS
# Debug APK
npm run build-debug-apk
# Release APK
npm run build-release-apk
- Axios interceptor — Automatically attaches the access token and handles refresh token rotation on 401 responses
- Redux-Saga — Manages all async flows (auth, message fetching, socket events) cleanly outside of components
- Socket rooms — Each conversation is a dedicated socket room; users join on chat open and leave on exit
- Layered separation — API, state, and socket logic live in separate layers with no cross-contamination
- Persistent chat history — All messages are stored in MongoDB and fetched on room entry