Skip to content
unvendor

Early development

An exit toolkit for Backend-as-a-Service platforms, starting with Supabase.

Unvendor is an open source toolkit for converting a Backend-as-a-Service deployment into standard, self-hostable components: plain PostgreSQL, any OIDC identity provider and S3-compatible storage. The goal is to do this without a full rewrite of the app.

The problem

Backend-as-a-Service platforms (Supabase, Firebase, Appwrite, Nhost, PocketBase) bundle database, auth, storage and functions behind platform-specific APIs. Apps built on them become hard to self-host, migrate or audit, even when parts of the platform are open source.

RLS is tied to the platform

On Supabase, policies call auth.uid(), auth.jwt() and auth.role(), which only exist in Supabase.

Users live in the platform's schema

Application tables reference IDs in auth.users, so accounts can't simply be recreated somewhere else.

Storage rules are database policies

The object store knows nothing about them, so copying files isn't enough.

Today, leaving means a dump, one-off scripts and rewriting access control by hand. Self-hosting the platform itself changes where it runs, not what the app depends on.

How it works

Each part of the platform moves onto a standard replacement that can be swapped independently. Supabase is the first source platform and the reference implementation; others are planned through a source adapter interface.

Components

  1. 1

    Inventory and source adapter interfacePlanned

    Reads schemas, roles, RLS policies that use auth.*, buckets, functions and secrets, and reports everything that has to move. Platform-specific reading sits behind an adapter interface so other platforms can be added later.

  2. 2

    Auth migrationPlanned

    Exports users, identities, password hashes and MFA factors. Imports into Keycloak through its native user import, keeping user IDs and bcrypt hashes through a small Keycloak bcrypt provider, so users don't have to reset their passwords. A SCIM 2.0 export covers other OIDC providers such as Authentik and Zitadel.

  3. 3

    RLS translationPlanned

    Rewrites policies that call auth.uid(), auth.jwt() and auth.role() into portable SQL on top of a small shim schema. Anything that can't be converted is listed in the report. Every rewrite gets a negative test, and differential tests compare what each user can see on source and target.

  4. 4

    Storage migrationPlanned

    Copies buckets and objects to any S3-compatible backend (SeaweedFS, Ceph Object Gateway), maps public buckets to anonymous read, keeps all other buckets private, and reports per-object rules with their original SQL.

  5. 5

    Verification and releasePlanned

    An end-to-end harness runs the whole migration on a copy and compares row counts, logins and access. Documentation, reproducible packaging on npm, and fixes from a security review.

What exists today is a Supabase test fixture: tables with RLS policies, storage buckets with per-user folder policies, and a seed script. It is the source project used to develop and test the components.

After the migration

Something has to set the claims that the translated policies read. The app's server side, or PostgREST, validates the OIDC token and sets them as a transaction-local setting before each query; the shim's auth.uid(), auth.jwt() and auth.role() read from that setting. Apps that reach the database only through supabase-js need a server-side layer first; the inventory flags this.

Later

Roadmap

  1. M1Inventory and source adapter interface
  2. M2Auth migration → any OIDC provider (Keycloak first; SCIM 2.0 export for others)
  3. M3RLS translation → plain PostgreSQL with shim schema
  4. M4Storage migration → S3-compatible storage (SeaweedFS, Ceph Object Gateway)
  5. M5Verification and release

Open source

Unvendor is written in TypeScript and licensed under Apache-2.0. It is meant for teams that need to run their backend on infrastructure they control: small teams, NGOs, public bodies, and anyone who needs data sovereignty, GDPR-compliant self-hosting, or protection against pricing or platform changes.

If you've moved off a Backend-as-a-Service platform, or tried and gave up,open an issue and describe what broke.