Backend

Remove the PocketBase backend, turning the project into a frontend-only static site.

Syntax

$ vela disable backend

Options

  • -y, --yes - Skip the confirmation prompt

What it removes

These are deleted, along with anything you added to them:

  • data/ — the local database, and your fixtures, hooks and seeds in data/fixtures, data/hooks and data/seeds
  • src/lib/server/workflows.ts and all of src/lib/workflows/, including workflows you wrote. Workflows run on PocketBase, so they go with it.
  • Every server.test.ts under src/. Server tests run against the PocketBase test context, so they can’t run without it.
  • The openworkflow, openworkflow-pocketbase and croner packages

The database on a deployed server is not touched.

The rest is reverted rather than deleted:

  • src/hooks.server.ts loses the PocketBase handle and the init hook that starts the workflow worker. Handles other features added, such as i18n, stay. The file is deleted only if nothing is left in it.
  • The SvelteKit adapter is switched back to @sveltejs/adapter-static with an SPA fallback, and @sveltejs/adapter-static is installed.
  • The PocketBase block comes out of .gitignore.
  • test/setup.ts goes back to the version without a database, which gives tests only request and agent.
  • An older project’s src/routes/+layout.server.ts that still reads the app name and URL from locals.meta, which only the PocketBase handle set, is switched to src/lib/site.ts, created if it’s missing. Set url there to where the site is deployed. Newer projects already read src/lib/site.ts, so their root layout doesn’t change.

A file Vela can’t revert safely, such as a hooks.server.ts whose init does more than start the worker, is left as it is, and you’re told what to change.

Disable the features that depend on the backend — auth, api and the rest — before running this.

What it leaves

  • @velastack/pocketbase, pocketbase-sveltekit and @sveltejs/adapter-node stay in package.json. Uninstall them yourself if you want them gone.
  • The migrations/ directory at the project root
  • POCKETBASE_SUPERUSER_EMAIL and POCKETBASE_SUPERUSER_PASSWORD in .env, which is what lets vela enable backend reuse them rather than ask again