Skip to content

Add self-hosted time-based sync demo#892

Merged
bean1352 merged 20 commits intomainfrom
feat/add-time-based-sync-demo
Mar 30, 2026
Merged

Add self-hosted time-based sync demo#892
bean1352 merged 20 commits intomainfrom
feat/add-time-based-sync-demo

Conversation

@bean1352
Copy link
Copy Markdown
Contributor

@bean1352 bean1352 commented Mar 12, 2026

A React demo that shows how to use PowerSync sync streams to dynamically control which data is synced to the client based on a date field. Issues are grouped by updated_at date, and each date is a separate stream subscription that the user can toggle on or off. Runs entirely locally with self-hosted PowerSync and Supabase.

  • Self-hosted PowerSync + local Supabase setup using PowerSync CLI and supabase start
  • Anonymous auth, well-known local anon key hardcoded in env template
  • Supabase migrations for schema, seed data, and powersync publication
  • Per-date useQuery that both subscribes to the sync stream and renders matching issues (TTL 0)

TODO: Add demo link to this guide.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 12, 2026

⚠️ No Changeset found

Latest commit: ec54060

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 March 12, 2026 12:47
@bean1352 bean1352 requested a review from joshuabrink March 12, 2026 12:47
@bean1352 bean1352 marked this pull request as draft March 12, 2026 12:47
@bean1352 bean1352 requested a review from khawarizmus March 19, 2026 07:59
Comment thread demos/react-supabase-time-based-sync/powersync/docker/docker-compose.yaml Outdated
Comment thread demos/react-supabase-time-based-sync/src/app/views/issues/page.tsx Outdated
@bean1352 bean1352 marked this pull request as ready for review March 19, 2026 11:45
@bean1352 bean1352 requested a review from Chriztiaan March 19, 2026 11:45
@joshuabrink joshuabrink self-requested a review March 19, 2026 11:50
joshuabrink
joshuabrink previously approved these changes Mar 19, 2026
@bean1352 bean1352 marked this pull request as draft March 24, 2026 07:42
@benitav
Copy link
Copy Markdown
Contributor

benitav commented Mar 24, 2026

Just a hygiene thing, we should also add a reference to this demo in the root README https://github.com/powersync-ja/powersync-js

@bean1352 bean1352 marked this pull request as ready for review March 30, 2026 10:58
Chriztiaan
Chriztiaan previously approved these changes Mar 30, 2026
Copy link
Copy Markdown
Contributor

@Chriztiaan Chriztiaan left a comment

Choose a reason for hiding this comment

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

Looks good from my perspective. We cleared up the flicker issues we caught with stream changing and fixed them in the @powersync/react package.

Comment thread demos/react-supabase-time-based-sync/README.md Outdated
Comment thread demos/react-supabase-time-based-sync/README.md Outdated
Comment thread demos/react-supabase-time-based-sync/README.md Outdated
@bean1352 bean1352 merged commit f720d62 into main Mar 30, 2026
11 of 12 checks passed
@bean1352 bean1352 deleted the feat/add-time-based-sync-demo branch March 30, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants