Skip to content

Repository files navigation

TextRiz

A full-stack real-time private chat application built with React Native and Node.js.

React Native TypeScript Redux Toolkit Socket.IO Node.js


Features

  • 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

Tech Stack

Frontend

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

Backend

Technology Purpose
Node.js + Express REST API server
MongoDB + Mongoose Database & ODM
Socket.IO WebSocket server
JWT Access & refresh token authentication

App Flow

Register / Login
      ↓
  Home Screen
      ↓
  Search User by Email
      ↓
  Open Chat
      ↓
  Load Chat History  ←→  Send / Receive Messages (real-time)
      ↓
  Back / Logout

Getting Started

Prerequisites

  • Node.js >= 20
  • Android Studio (for Android) or Xcode (for iOS)
  • A running instance of the TextRiz backend (update link if needed)

Backend

npm install
npm run dev

Frontend

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

Build APK

# Debug APK
npm run build-debug-apk

# Release APK
npm run build-release-apk

Architecture Highlights

  • 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

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages