Repository navigation
[Feat] Add AI chat demo that streams replies through PowerSync - #1152
Merged
Merged
Conversation
|
bean1352
marked this pull request as ready for review
October 19, 2026 09:04
bean1352
marked this pull request as draft
October 19, 2026 12:51
…XT setting to turn it off
bean1352
marked this pull request as ready for review
October 21, 2026 12:03
Chriztiaan
previously approved these changes
Oct 21, 2026
bean1352
marked this pull request as draft
October 21, 2026 12:11
bean1352
marked this pull request as ready for review
October 21, 2026 13:36
…nc-ja/powersync-js into feat/react-supabase-ai-chat-demo
Chriztiaan
previously approved these changes
Oct 27, 2026
Chriztiaan
left a comment
Contributor
There was a problem hiding this comment.
I see there are minor security warnings, but this is just a demo.
joshuabrink
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_MODEpicks how the text reaches the app while it generates. Inpostgresmode (the default), the backend writes the reply so far to its row every 100 ms and PowerSync syncs each write. Inssemode, 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.