Proposal: PocketBase add-on #527
Proposal#
Add a built-in PocketBase add-on for React (--add-ons pocketbase).
PocketBase is an open source backend in a single binary: embedded SQLite, auth, realtime subscriptions, file storage and an admin UI. It's a popular choice for side projects and self-hosted apps, and right now the CLI has no self-hosted backend option in the database category (Neon, Convex and PowerSync are all hosted services).
Scope#
It follows the same shape as the existing Convex / PowerSync add-ons:
pocketbaseJS SDK dependency +src/lib/pocketbase.tsclient readingVITE_POCKETBASE_URL- a
pb_migrations/JS migration that creates atodoscollection on./pocketbase serve pb_data/added to.gitignore- a
/demo/pocketbaserealtime todo route using the standarddemo-*styles - category
database, exclusive withdatabase/orm, React + Vite only
The user downloads the PocketBase binary themselves (same manual-backend model as the Strapi add-on).
I have a working implementation ready and tested against a real PocketBase v0.40.6 server. Would you be open to this? Happy to adjust scope or naming.
Thanks! Draft PR is up: #572
It has what you asked for:
- Versions: PocketBase server v0.40.6 and JS SDK
^0.28.2. - Migration:
pb_migrations/1761955200_created_todos.js. - Permissions: my first version had public rules, so I changed it after your question. Todos now have a required
ownerrelation, and the collection's API rules restrict list, view, update, delete and realtime events to the owner. The create and update rules also stop a user from creating a todo for someone else or handing one over. - Local setup and tests: the commands are in the PR, along with a script that checks these permissions against a local PocketBase server.
The PR lists what I ran. I don't have branded Chrome, so I ran the E2E suite on headless Chromium with a local config.
- Versions: PocketBase server v0.40.6 and JS SDK
akanyane(GitHub profile, opens in a new tab) linked this to #572
Sign in to join this conversation.
Thanks for putting this together! Could you link the implementation or open a draft PR so we can review what you already have?