Skip to content

[Demo] Local-only supabase todo app #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Sep 9, 2024
Merged

[Demo] Local-only supabase todo app #138

merged 42 commits into from
Sep 9, 2024

Conversation

Chriztiaan
Copy link
Contributor

This adds a demo project that aims to demonstrate how an app could be built starting from a local-only state and later being "upgraded" to a version that has sync capabilities. It started off as a copy of the existing todo app that was stripped of some of the features. The biggest changes are in powersync.dart, login/signup views, and models/schema.dart (which illustrates how to update the schema to supporting syncing).

The readme has a basic description of how everything works, with a small mermaid diagram to show how the app switches from the local-only mode to sync mode.

@Chriztiaan Chriztiaan requested review from stevensJourney, kobiebotha and mugikhan and removed request for kobiebotha August 5, 2024 12:21
@Chriztiaan
Copy link
Contributor Author

@kobiebotha @stevensJourney I've updated the readme, schema comment about switching, and allowed the app to work without specifying credentials in which case login/sign up is disabled.

@guillempuche
Copy link

guillempuche commented Aug 7, 2024

Good work! Much needed for a seamless experience.
I'll try to implement for my app (Typescript).

stevensJourney
stevensJourney previously approved these changes Aug 7, 2024
Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

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

Nice!

@Chriztiaan
Copy link
Contributor Author

Good work! Much needed for a seamless experience. I'll try to implement for my app (Typescript).

Hey @guillempuche, a JS/TS version is on the one in the coming weeks too.

@Chriztiaan
Copy link
Contributor Author

Chriztiaan commented Aug 8, 2024

There is currently a bug where if the user logs in immediately without creating data, existing data doesn't sync down.

Edit: The issue pertains to the .connect() in powersync.dart resolving too early and watch() breaking when logging in without having any local table entries during the switch from local-only to synced mode.

kobiebotha
kobiebotha previously approved these changes Sep 5, 2024
benitav
benitav previously approved these changes Sep 6, 2024
benitav
benitav previously approved these changes Sep 6, 2024
# Conflicts:
#	demos/django-todolist/pubspec.lock
#	demos/supabase-anonymous-auth/pubspec.lock
#	demos/supabase-edge-function-auth/pubspec.lock
#	demos/supabase-simple-chat/pubspec.lock
#	demos/supabase-todolist-drift/pubspec.lock
#	demos/supabase-todolist-drift/pubspec.yaml
#	demos/supabase-todolist/pubspec.lock
#	demos/supabase-todolist/pubspec.yaml
@Chriztiaan Chriztiaan merged commit 2ccf239 into main Sep 9, 2024
7 checks passed
@guillempuche
Copy link

guillempuche commented Sep 9, 2024

I'm ready for Typescript!
This is a great feature for a consumer app. Fewer clicks for experiencing the AHA moment, login is a big barrier

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.

7 participants