This is an example self-hosted project using the PowerSync Open Edition version of the PowerSync Service, which is published to Docker Hub as journeyapps/powersync-service
.
This example uses Docker Compose to define and run the containers.
Learn more about self-hosting PowerSync here.
This repository contains basic demonstrations in the demos
folder.
-
- This can be stared from the repo root with
docker compose -f demos/nodejs/docker-compose.yaml up
- This can be stared from the repo root with
-
- This can be stared from the repo root with
docker compose -f demos/django/docker-compose.yaml up
- This can be stared from the repo root with
-
- See the README for instructions.
The configuration can be modified to match other project topologies.
Edit the demo .env
files and config files in the ./config
directory with your specific settings.
Populate the replication->connections
entry with your Postgres database connection details.
A simple Postgres server is provided in the ps-postgres.yaml
Docker compose file. Be sure to keep the credentials in powersync.yaml
in sync with the config in ps-postgres.yaml
if using this server.
The PowerSync Service uses MongoDB under the hood. A basic MongoDB replica-set service is available in ps-mongo.yaml
. The powersync.yaml
config is configured to use this service by default. Different MongoDB servers can be configured by removing the include
statement from docker-compose.yaml
and updating powersync.yaml
.
This example uses JWKS which provides the public key directly to the PowerSync instance in powersync.yaml
's jwks
section.
The key-generator
project demonstrates generating RSA key pairs for token signing.
Sync Rules are currently defined by placing them in ./config/sync_rules.yaml
.
If you want to start from a fresh start:
- Delete the Docker volumes
mongo_storage
anddb_data
Their full names might vary depending on the directory where thedocker-compose
command was executed. - Delete the service Docker containers.