Skip to content

Build and run

  • Node and Bun: The protobase command runs on Node 22.12 or later or on Bun, and a bundle runs on both unless it is built for Bun only.
  • Dev server: The admin app and the API on one port, with changes shown without a restart; each project keeps its own port, so its address and bookmarks stay the same.
  • Dev server without jobs: protobase dev --no-jobs runs no jobs and delivers no events, webhooks or pushes, to develop against a hosted app’s database without doing its work twice.
  • UI-only dev server (beta): protobase dev --api <url> serves the app’s UI from the project with the API of an app already running, such as its staging deploy, with no database.
  • Editor types: protobase types gives the editor and tsc the types of the CLI that builds the app, with nothing installed.
  • Project scripts: protobase run runs a seed or a migration script on the CLI’s packages.
  • Migrate command: protobase migrate applies the project’s SQL migrations, with nothing installed, and --plan prints the SQL it would apply.
  • Migrations from config: Writes the SQL migrations for what the config turns on, as files of the project.
  • Schema snapshot (beta): protobase.snapshot.json in the project describes the schema its migrations make, so each new migration is the next numbered file and the change shows in review. The sign-in tables and every built-in schema are worked out from it without a database, protobase migration check fails CI when the config has a change the migrations lack, drop takes the newest file back, and protobase migration baseline starts the snapshot of an existing app from its database, or records the built-in schemas an earlier version made, once, without changing or dropping anything.
  • User and organization commands: Create users, set roles and manage organizations from the terminal, in the organization the config pins, another one you name, or every one when you ask.
  • Encryption commands: Report and fix plaintext or old-key values of encrypted fields.
  • One bundle: protobase build writes one folder with everything the app needs, without a database or secrets. It fails on a view that filters, sorts or searches by a field its resource does not allow.
  • Source maps: The bundle and plugins can carry source maps with debug ids, for an error tracker to read browser stack frames.
  • Extensions: A host adds its own widgets, dock assistant tools (assistant/tools.ts) and MCP tools (mcp/tools.ts) to every app it builds.
  • Native packages: npm packages with native add-ons are bundled for Linux.
  • Serve runtime: Runs a bundle, set by environment variables, with a health check, startup checks, jobs and a clean shutdown. PROTOBASE_HOST=127.0.0.1 keeps it to this computer.
  • Host module list: Each release of @protobase/cli carries the modules its runtime supplies to a bundle as @protobase/cli/host-modules.json, for a host to check a bundle’s imports against the version that serves it.
  • Migrations at update time: The bundle carries the project’s migrations, and the runtime applies them before the new version serves, in batches of one transaction each, refusing a second run while one runs, with an .after.sql beside a file for statements such as create index concurrently, which a stopped run’s next run finishes.
  • Migration record: Every migration file Protobase writes ends by adding its own row to migrations.history, so any tool that applies the file also records it. At startup the server reads the record: it starts when the database matches its version or is ahead only by additive migrations, and when the database is behind, it refuses and says what is missing and how to fix it.
  • Changes that break older code (beta): protobase migration applies each new file to the database in a transaction it rolls back and names what the code still running would lose; Protobase’s own parts keep what older code reads, a change only a hand-written file can make is refused with the way through, and a file that breaks older code makes the version before it refuse to start, saying rolling back is blocked. protobase migration check lints hand-written files with Postgres’s own parser and warns of statements that lock reads.
  • Signing off an update (beta): Sign off an update with protobase migration contract to archive what it retired, and remove it later with protobase migration delete once nothing writes it.
  • Release steps: protobase-serve migrate-release brings a database up to a release’s own built-in schema steps straight from a built bundle, with a dry-run plan, without writing files into the project.
  • Single-file runtime: The runtime as one file, so a host needs only Bun and that file.
  • Separate worker: Jobs and event delivery in their own process.
  • Container images: A runtime image for each release, for amd64 and arm64.
  • Self-hosted image: One image with the app inside that serves, migrates and creates the first admin.
  • Protobase Cloud deploys: A push to the app’s GitHub branch builds it, migrates and checks its database in one transaction, and switches to the new version once it answers its health check.
  • Deploy checks in CI: One step in an app’s GitHub workflow runs the checks a Protobase Cloud deploy runs, the server’s startup checks included, on a fresh Postgres of its own, so a change that would not deploy or start fails before it merges.
  • The version before in CI (beta): A workflow, in every app started from a preset, runs the tests of the version that serves now on a database with a branch’s migrations applied, so a migration that takes what that version reads fails before it deploys.
  • Mobile apps (beta): Runs an app on iOS and Android, also on your own iPhone, with sign-in, and builds signed store releases from a section in its config. Your app shows its own home-screen icon on iOS and Android, generated from one image you name in your config. It can open on a splash screen of its own, an image on a colour, in light and dark mode.
  • Files from the phone (beta): In the iOS and Android app, Import and file fields open the phone’s file picker, offering Excel, CSV and JSON files from the device and its cloud drives.
  • Mobile releases (in development): The server offers the mobile app a newer copy of its files, signed, and any host that serves bundles can offer the same from the bundle’s files without running its config.
  • Live updates (in development): The Android and iOS app update themselves in the background to the server’s release, downloading only the files that changed, switch to it when they come back after 5 minutes or more away, on the same page, and go back to the files they were built with when a release fails to start.