Next Chat IDB Demo

A static-exported chat demo built against a packed local copy of the current next branch.

What it shows

  • App Router with output: 'export'
  • Cache Components enabled
  • Dynamic thread routes that are not prerendered at build time
  • React Query persisted to IndexedDB for local-first state
  • A build-time Server Component shell around client-rendered thread data
  • A checked-in packed next tarball so the demo deploys against this exact local branch build

Install

pnpm install

Run in dev

pnpm dev

Build and preview the exported app

pnpm build
pnpm start:static

Then open one of these URLs:

  • http://localhost:4100/
  • http://localhost:4100/workspace/demo
  • http://localhost:4100/workspace/demo/thread/export-fallback-rollout

The thread URLs are dynamic App Router routes. They are not prerendered to HTML files ahead of time, so /_fallback.html needs to recover them at runtime.

Deploy to Vercel as static files

This demo includes vercel.json with a custom static hosting setup:

  • framework: null tells Vercel to treat the project as a plain static build
  • outputDirectory: "out" serves the exported files directly
  • the catch-all rewrite sends URLs that do not exist on disk to /_fallback.html

That lets Vercel serve real exported files from out/ first, while still booting unknown dynamic App Router URLs through the export fallback document.

Reset local state

The chat state lives in the browser's React Query cache and is persisted to IndexedDB. Clear site storage in the browser if you want to start fresh.