Skip to content

Supabase Sync Setup

david edited this page Sep 3, 2026 · 5 revisions

Supabase Sync Setup

Inventorinator keeps a local SQLite database. Supabase sync is optional and experimental. Export a backup before enabling it.

1. Enable anonymous sign-ins

Inventorinator uses anonymous Supabase users as device identities; no email is required.

  • Hosted Supabase: enable Allow anonymous sign-ins in the project's authentication settings.
  • Self-hosted Supabase: set ENABLE_ANONYMOUS_USERS=true in the Supabase .env, then recreate the Auth service.

2. Run the installer

Use the instructions for the same version as the app. Version-specific files remain available so older working installations are not silently redirected to incompatible migrations.

v0.1.0-alpha

For v0.1.0-alpha on Linux, macOS, or Windows through WSL/Git Bash, download the corrected schema bundle attached to the release:

curl -fLO \
  https://github.com/DavidThePurple/Inventorinator/releases/download/v0.1.0-alpha/Inventorinator-v0.1.0-alpha-Supabase-schema15.tar.gz
tar -xzf Inventorinator-v0.1.0-alpha-Supabase-schema15.tar.gz
cd Inventorinator-v0.1.0-alpha-Supabase-schema15
./install-or-update.sh

Choose:

  • Hosted: paste the PostgreSQL connection string from the Supabase project's Connect dialog. The script reads it silently and does not save it.
  • Self-hosted Docker: select the database container. The default is supabase-db; if yours differs, run:
SUPABASE_DB_CONTAINER=my-database-container \
  ./install-or-update.sh --self-hosted

The script detects the installed schema, applies only missing migrations, and verifies the final version. Success ends with:

Inventorinator schema v15 is ready.

Run the same installer again after updating Inventorinator. Already-applied migrations are skipped.

For later versions, use the schema bundle attached to that release. This keeps the installer, connector, and migrations matched to the app. Follow [[How to Upgrade]] before replacing an existing installation.

v0.0.9-alpha (legacy)

v0.0.9-alpha requires its tagged schema 7 files and self-hosted connector. Use the supabase directory from the v0.0.9-alpha source and run sh apply-migrations.sh. Keep its connector and migrations together. Do not point a v0.0.9 client at schema 15, which blocks obsolete whole-snapshot writes, and do not downgrade an upgraded database in place.

The installer requires either PostgreSQL psql or Docker. If psql is absent for a hosted project, it automatically uses the official PostgreSQL Docker image.

3. Get the app connection details

From the Supabase Connect dialog or Settings → API Keys, copy:

  • the public Project/Supabase API URL;
  • the client-safe Publishable key (sb_publishable_...) or legacy anon key.

Never enter a secret key, service_role key, database password, dashboard password, or JWT secret into Inventorinator.

4. Connect Inventorinator

  1. Choose Supabase on first launch. If already running locally, open Sync devices → Advanced.
  2. Enter the Supabase API URL and publishable key.
  3. Select Verify and continue, then Create shared inventory on the device that should own it.

Add another device

  1. On the owner device, open Sync devices → Add another device.
  2. On the new device, choose Join existing inventory—not Create.
  3. Scan the QR code or enter its one-use code within 10 minutes.
  4. Select Sync now to verify both devices.

Troubleshooting

  • Schema/connector update required: rerun the installer.
  • Anonymous sign-in failed: enable anonymous users, then restart Auth.
  • Server does not respond: enter the Supabase API gateway URL, not the Studio dashboard or Inventorinator connector status port.
  • Unauthorized: use the publishable/legacy anon key.
  • Wrong shared inventory: disconnect and join again using a fresh pairing code from the owner.
  • Locked out of owner access / recovery key rejected: see [[Owner Recovery]].

References: Supabase anonymous sign-ins, API keys, and self-hosting with Docker.

Planned Remote Sync reliability work is tracked on the Roadmap.

Clone this wiki locally