How to Build a Chat Messaging App

Short answer

A chat app needs realtime delivery, optimistic sends that never lose a message, history that paginates without gaps, and push notifications when the app is closed. Build it with React Native and Expo on a realtime backend: Supabase Realtime, Firebase Firestore, or a hosted chat API such as Stream. DeveloperMill's free Expo Chat Starter implements 1:1 and group chat with swappable Firebase, Supabase, Appwrite and offline SQLite backends.

Chat looks simple and isn't. Messages arrive out of order, phones go offline mid-send, and an inverted list with pagination is easy to get subtly wrong.

This guide covers the features and the reliability details that separate a demo from an app people trust.

Last updated November 19, 2026

Features for the first version

Conversations list

Latest message, unread counts, sorted by activity, updating live.

1:1 and group threads

Inverted message list with timestamps and sender grouping.

Optimistic sends

Message appears instantly, reconciled by a client ID, with retry on failure.

History pagination

Load older messages on scroll without skips or duplicates.

Push notifications

New messages when the app is closed, opening the right thread.

People search

Find users to start a conversation.

Leave for version two

  • Read receipts and typing indicators
  • Images, voice notes and files
  • Reactions and replies
  • End-to-end encryption
  • Voice and video calls

Screens you'll need

  • Conversations list
  • Chat thread
  • New chat and people search
  • Group details
  • Profile and settings

Recommended tech stack

LayerChoiceWhy
AppExpo + React Native + TypeScriptNative keyboard handling and lists on both platforms.
RealtimeSupabase Realtime, Firestore or StreamPush new messages to open clients without polling.
CacheTanStack QueryRealtime events update the cached thread so screens stay in sync.
Keyboardreact-native-keyboard-controllerSmooth composer movement with the keyboard.
Pushexpo-notificationsServer-triggered pushes for offline recipients.
StarterExpo Chat Starter (MIT)Working chat with four backend adapters to start from.

How to build it, step by step

  1. 01

    Choose build versus buy

    A hosted chat API saves months if you need calls, moderation and scale. Your own backend gives control and lower cost.

  2. 02

    Model conversations and members

    Conversations, members and messages, with access rules so users only read their own threads.

  3. 03

    Build sending with client IDs

    Generate an ID on the device, show the message immediately, and reconcile when the server confirms.

  4. 04

    Build the thread list

    Inverted list, cursor pagination by timestamp and ID, realtime inserts merged into the cache.

  5. 05

    Add push

    Send a push from the server to members who aren't currently in the thread.

  6. 06

    Test bad networks

    Airplane mode mid-send, two devices on one account, and long threads.

Common problems and how to avoid them

Lost or duplicated messages

Client-generated IDs and idempotent inserts solve both.

Pagination gaps

Paginate on a stable cursor (created_at plus ID), never on offsets.

Keyboard and safe areas

The composer must track the keyboard on both platforms; test on small phones.

Abuse

Chat with strangers needs reporting and blocking to pass review.

Store rules, privacy and regulation

  • If strangers can message each other, provide reporting and blocking (App Store guideline 1.2).
  • End-to-end encryption may require export compliance answers in App Store Connect.
  • Message content is personal data; set retention rules and support account deletion.

This is general guidance, not legal advice. Check the current store guidelines and local law for your market.

What drives cost and timeline

Cost depends far more on scope than on the category. These are the decisions that move a chat & messaging app from a small build to a large one:

  • Media messages and storage
  • Encryption
  • Voice and video calling
  • Group size and moderation

For sourced figures, see what it costs to hire a React Native developer versus an AI app builder and the yearly cost of maintaining an app. Starting from a template or a free design cuts the screens and setup work, not the business logic.

Free chat & messaging app UI designs with Expo code

Start from working code

Go deeper

Frequently asked questions

What's the best backend for a React Native chat app?

Supabase Realtime and Firebase Firestore both work well for most apps and are cheap to start. A hosted chat API like Stream adds moderation, threads and scale out of the box at a higher price. The Expo Chat Starter supports Firebase, Supabase, Appwrite and offline SQLite behind one interface, so you can switch later.

How do I stop messages from being lost or duplicated?

Generate a client ID on the device for every message, show it immediately, and insert it on the server idempotently by that ID. When the server confirms, replace the pending message rather than adding a new one.

Is there a free React Native chat template?

Yes. DeveloperMill's Expo Chat Starter is MIT licensed and includes chat list, 1:1 and group threads, optimistic sends, pagination tests and four backend adapters.

More app development guides