Expo + AI Chat Stack

The AI chat app stack: Expo, OpenAI via NestJS proxy, streaming responses, per-user quotas. Ships a real AI chat app without burning your API credit.

Stack/Expo + AI Chat Stack

Starter Kit

Expo + AI Chat Stack

Expo + OpenAI + NestJS proxy ships an AI chat app with streaming and quota controls that keep your OpenAI bill from exploding.

What this stack is good for

AI chat assistants, coach apps, tutor apps, anything where the value is a conversation with an LLM and a bit of state around it. Native iOS and Android, streaming responses, real quota handling so you do not get destroyed by one viral share.

The pieces

  • Expo + React Native with a chat UI that renders tokens as they stream in.
  • NestJS as the proxy. Holds the OpenAI key. Enforces quotas. Logs usage per user.
  • Supabase for user profiles, conversation history, quota counters.
  • OpenAI Responses API (or chat.completions for older setups) with streaming enabled.
  • Expo Notifications for re-engagement pushes.

The golden rule

Never put the OpenAI key in the mobile bundle. Every call goes through your backend. This is not optional. Your credit will be burned within hours of a public launch otherwise.

Real build time for a v1

  • NestJS /ai/chat endpoint with streaming: ~6 hours.
  • Supabase schema for conversations, messages, quota: ~3 hours.
  • React Native chat screen with streaming token render: ~8 hours.
  • Per-user daily quota logic and 429 handling: ~4 hours.
  • App Store submission + copy: ~5 hours.

About 26 hours total.

Streaming in React Native

React Native fetch supports streaming via ReadableStream on new enough versions. Older apps can use react-native-sse. AI App Factory ships a useAiStream hook that handles both and gives you { tokens, isStreaming, error } as state you can render directly.

Quota controls I run by default

  • Daily cap per user (tracked in Supabase, checked server-side on every call).
  • Soft warn at 80%.
  • Hard stop at 100% returning 429 from your backend, with a friendly client state.
  • Global backend cap too — a per-hour global limit as a second safety net.

Without these you are one Hacker News front page away from a five-figure OpenAI bill.

Retention loop

Two pushes that move the needle:

  1. Conversation continuation: "You left off at X. Pick up where you were?"
  2. Daily check-in (opt-in): one contextual prompt per day at a time the user chose.

What AI App Factory ships

  • NestJS /ai/chat streaming endpoint.
  • Supabase schema for conversations, messages, daily quota.
  • React Native chat screen with streaming.
  • useAiStream hook.
  • Quota middleware.
  • Push scheduler for conversation continuation.

See pricing

Get this stack today.

One-time purchase. Full-stack boilerplate + 11 AI agents. No subscription.

AI App FactoryStackExpo + AI Chat Stack