HOW-I COURSE GUIDE

How I Built T3 Chat in 5 Days

A chapter-by-chapter readback of the free course by Theo - t3․gg on Theo - t3․gg.

Length29:01
Chapters14
Modules3
Plain Markdown with clickable timestamps — drops into Obsidian, Notion or GitHub as-is.

A rare transparent build retrospective where the creator shows not just what shipped, but what was thrown away — React Context sync, Zero, Jazz — and why rolling your own local-first sync beat every off-the-shelf option.

Who it's for
Read this guide if
  • You're building an AI chat app with Next.js or the Vercel AI SDK
  • You're evaluating local-first sync tools like Zero or Jazz
  • You want practical React rendering-performance techniques
Skip ahead if
  • You want a step-by-step tutorial you can follow along with
  • You expect a deep dive into model training or prompt engineering
  • You're only interested in the finished product, not the process
In brief
  • 29-minute devlog (1741 seconds) covering days 1–5 of the T3 Chat build
  • 16 chapters organized into 3 chronological modules
  • Tools: Next.js, Vercel AI SDK, Dexie (IndexedDB), React Router, Vite/Hono/Cloudflare experiments, Stripe, react scan, marked lexer
  • Solo-with-CTO build (Theo plus Mark); intermediate level, assumes familiarity with React and modern web tooling
  • Reality check: the 'five days' was closer to five and a half, with major detours into auth and sync

The walkthrough

Each chapter below is our original written explanation of what happens at that moment in the video — a paraphrase, not a transcript. Click any timestamp to jump the player.

Days 1–3: Scaffolding, Local Data, and Detours

0:00

Introduction

Theo introduces T3 Chat, billed as the fastest AI chat app, built in five days with his CTO Mark, and frames the video as a day-by-day retrospective.

2:11

Why Build Another AI Chat App

DeepSeek v3's release — fast, cheap, and Claude-comparable — sparked the project since DeepSeek's own chat UI was poor. Theo also explains his frustrations with ChatGPT and Claude web apps and why he wanted a local-first architecture.

3:26

Day 1: Scaffolding with V0 and the AI SDK

The project starts with a V0 scaffold using the Vercel AI SDK, running locally in Next.js with streaming. Navigation moves fully client-side via React Router on a single catch-all route, and a first sync layer is built with React Context.

6:38

Day 2: Dexie and the Local Data Layer

With CTO Mark, the UI gets tabs and a better chat box, and the React Context sync is replaced by Dexie, an old but effective IndexedDB wrapper. Projects, threads, and messages live locally with live queries streaming changes.

7:51

Where the AI SDK Fell Short

The AI SDK's server-side streaming stays, but its client side proved too limited for local sync and message management, so client state moves entirely to the Dexie layer. Theo then adopts T3 Chat itself for development and explains the name's origin.

9:39

Day 3: Vercel Feedback and Uploading to Reality

A morning at Vercel's office yields six pages of notes on AI SDK frustrations, with meaningful changes promised. The day also gets eaten by a Malwarebytes false-positive blocking UploadThing and a self-built auth layer Theo later regrets not delegating to Clerk.

13:41

Cloudflare Prototype and Day 4

A Vite + React + Hono prototype works on Cloudflare, but streaming hacks push him back to Next.js for launch. Day four brings streaming polish, Linear for issue tracking, and Google auth via Auth.js.

Day 5: The Sync Layer Decision

15:28

Evaluating Zero

Local DB works, but cloud sync remains unsolved, so Theo evaluates local-first tools. Zero (from the Replicache makers) is rejected for difficult setup, inflexibility, duplicated source-of-truth logic, and required downtime on upgrades.

16:25

Trying Jazz

Jazz's team is responsive, but its collaboration-first design blocks rendering without a signed-in user and routes all data access through a 'me' root object, clashing with Theo's thread-based architecture.

19:33

Rolling His Own Sync

After 3–4 hours on Jazz, Theo concludes generic local-first solutions can't serve such varied needs and builds his own sync layer, which goes better than expected.

Launch Push: Performance and Polish

20:03

Model Selection and Speed

Using artificialanalysis.ai benchmarks, Theo compares ChatGPT, Claude, GPT-4o, and DeepSeek v3. DeepSeek's provider throughput halved near launch, so GPT-4o mini deploys on Azure for speed, with model selection planned later.

22:12

Homepage, Stripe, and Onboarding

The day before launch, Mark and Theo overhaul the UI with a Claude-like input box and sidebar redesign, integrate Stripe payments (painfully, with paid-flag bugs), and replace the blank landing page with a real homepage and a message-based onboarding flow.

23:54

The Big Performance Win: Markdown Chunking

Working with Aiden of million.dev, the biggest win is splitting messages into markdown blocks via the marked lexer and memoizing each block so only changed blocks re-render. React scan confirms 60 FPS even under CPU throttling.

26:14

Why React Isn't Slow

Stacked optimizations — render avoidance, data-layer streaming, and a hybrid Next.js/React Router routing approach — support the 'fastest AI chat app' claim. A use-query-with-local-cache pattern eliminates loading states, and the design philosophy is to minimize animations and respond aggressively early.

Moment by moment

TimeWhy it matters
3:26Day 1 begins: V0 scaffold plus a client-side React Router rewrite sets the whole architecture
6:38The pivot to Dexie and IndexedDB — the decision the app's local-first design is built on
16:25Jazz's design clash explained in detail; the most concrete evaluation of a local-first tool in the video
23:54The markdown-block memoization trick, the single biggest performance win of the build
26:14Theo's conclusion that React isn't slow — it's just easy to use it in a slow way

Do this next

  1. Prototype the same stack yourself: V0 scaffold + Vercel AI SDK streaming + Dexie for local message storage
  2. Try the marked-lexer block-splitting and memoization pattern on a streaming chat UI and profile it with react scan
  3. Spend an hour evaluating Zero and Jazz against your own data model before writing a custom sync layer

Common questions

Was T3 Chat really built in five days?

Close but not exact — Theo admits it was closer to five and a half days, with detours like a Malwarebytes false positive, auth struggles, and local-first tool evaluation eating time.

Why did Theo build his own sync layer instead of using Zero or Jazz?

Zero was hard to set up, inflexible, and duplicated source-of-truth logic; Jazz required authentication before rendering and forced all data access through a 'me' root object. Generic local-first tools didn't fit his use case, so he rolled his own, which went better than expected.

What made T3 Chat so fast?

The biggest win was splitting messages into markdown blocks with the marked lexer and memoizing each block, so only changed blocks re-render — combined with local-first data, data-layer streaming, a custom routing paradigm, and avoiding animations.

Which AI model powers T3 Chat?

At launch it used GPT-4o mini deployed on Azure for speed after DeepSeek v3's provider throughput dropped; model selection and cheaper DeepSeek options were planned for later.

Spot a mistake?

Every summary on this page is hand-checked against the video, but timestamps and details can still slip. If you spot an error, email us and we'll verify and fix it.

More course guides