Skip to content

[Feat] Add AI chat demo that streams replies through PowerSync - #1152

Merged
bean1352 merged 17 commits into
mainfrom
feat/react-supabase-ai-chat-demo
Oct 27, 2026
Merged

bean1352 merged 17 commits into
mainfrom
feat/react-supabase-ai-chat-demo

Conversation

@bean1352

@bean1352 bean1352 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

This adds demos/react-ai-chat, a chat app whose AI replies stream to every device through PowerSync. Postgres and the PowerSync Service run locally with the PowerSync CLI, and a small Node backend issues tokens, applies the app's uploads and generates replies with the AI SDK.

VITE_STREAM_MODE picks how the text reaches the app while it generates. In postgres mode (the default), the backend writes the reply so far to its row every 100 ms and PowerSync syncs each write. In sse mode, it streams the text over Server-Sent Events and writes the finished reply once.

AI disclosure

Claude Code (Opus 5.5) made all the changes, and I reviewed them myself.

image

@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 973d4f6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@bean1352
bean1352 marked this pull request as ready for review October 19, 2026 09:04
@bean1352
bean1352 marked this pull request as draft October 19, 2026 12:51
Chriztiaan
Chriztiaan previously approved these changes Oct 21, 2026
@bean1352
bean1352 marked this pull request as draft October 21, 2026 12:11
@bean1352
bean1352 marked this pull request as ready for review October 21, 2026 13:36
Comment thread demos/react-ai-chat/server/index.ts Dismissed
Comment thread demos/react-ai-chat/server/index.ts Dismissed
@bean1352 bean1352 changed the title [POC] Add AI chat demo that streams replies through PowerSync [Feat] Add AI chat demo that streams replies through PowerSync Oct 27, 2026
Chriztiaan
Chriztiaan previously approved these changes Oct 27, 2026

@Chriztiaan Chriztiaan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there are minor security warnings, but this is just a demo.

@bean1352 bean1352 added the Product Visibility This requires documentation changes and or announcing. label Oct 27, 2026
@bean1352
bean1352 requested a review from Chriztiaan October 27, 2026 13:51
@bean1352
bean1352 merged commit 27db366 into main Oct 27, 2026
15 checks passed
@bean1352
bean1352 deleted the feat/react-supabase-ai-chat-demo branch October 27, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product Visibility This requires documentation changes and or announcing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants