Demo app demonstrating use of the PowerSync SDK for React Native together with a Django backend. The sample backend that you can run alongside this demo can be found here: PowerSync Django Backend: Todo List Demo
Install the dependencies, including the React Native SDK:
pnpm installUpdate the .env file with PowerSync and Django details
Run on iOS
pnpm iosRun on Android
pnpm androidThis demo can be used with cloud or local services.
The Self Hosting Demo repository contains a Docker Compose Django backend demo which can be used with this client. See instructions for starting the backend locally.
Note that Android requires port forwarding of local services. These can be configured with ADB as below:
adb reverse tcp:8080 tcp:8080 && adb reverse tcp:6061 tcp:6061This demo requires that you have the PowerSync Django Backend: Todo List Demo running on your machine. Follow the guide in the README of the PowerSync Django Backend to set it up.
Create a new PowerSync instance, connecting to the database of the Supabase project.
Then deploy the following sync rules:
config:
edition: 3
streams:
user_lists:
queries:
- SELECT * FROM lists WHERE owner_id = auth.user_id()
- SELECT todos.* FROM todos JOIN lists ON todos.list_id = lists.id WHERE lists.owner_id = auth.user_id()Copy the AppConfig.template.ts to a usable file
cp library/django/AppConfig.template.ts library/django/AppConfig.tsInsert the necessary credentials.