thelastapi
Get started free

The Supabase alternative for apps your AI agent builds

thelastapi is the Supabase alternative for agent-built apps: plain Postgres, sign-in and files, plus hosting, payments and email on one key. How to move.

On this page 5 sections

thelastapi is the Supabase alternative built for apps an AI agent builds: the same plain Postgres, sign-in and file storage, plus hosting, payments, email and AI models on one key. Your agent gets a development copy of the database with none of production's rows, and its key never holds a production secret or moves live money unless you allow it. Moving an existing Supabase app is six steps: dump your tables with pg_dump, restore them with psql, turn on sign-in, move files, and deploy.

Here is what changes, what moves where, and the exact steps.

What an agent-built app needs from its backend

When Claude Code, Codex or Cursor builds your app, the backend is not only a database. The agent creates tables, wires sign-in, adds a plan, sends the welcome email and deploys, often in one session. Three things decide whether that goes well:

  • A safe place to work. The agent needs a real database to run migrations against, without your customers' rows in it. On thelastapi every project has a development copy: production's tables, every row removed, migration ledgers kept so nothing runs twice.
  • Limits it cannot talk its way past. You choose Full access or Limited when you approve the agent's sign-in. A Limited key builds, deploys and works in development, and gets 403 owner_only with a link for you when it reaches for production rows, secrets or live money.
  • One key for the whole business. Hosting, the database, sign-in, payments, email, AI, files and domains come from one account. The agent does not juggle six dashboards and six sets of keys, and it has tools for every product over MCP.

What moves where

On SupabaseOn thelastapiHow the app uses it
Postgres databaseDatabase: Postgres per projectDATABASE_URL, any Postgres client or ORM
AuthSign-in: email and password, magic links, Google, GitHubusers stored in the project's database
StorageFiles: a drive per projectpermanent links, uploads up to 50 MB each
Server functionsyour app's own API routes on Hostingvibiz deploy, previews and instant rollback
Nothing to movenew: Payments, Email, AIthe same key

Payments are the biggest addition: thelastapi is the merchant, so the app sells plans from its first call, with no payment account to open first.

Move a Supabase app in six steps

1. Create the project

In your app's folder:

Terminal
vibiz init "Acme"

That gives the project hosting, a database, sign-in and analytics, at https://acme.vibiz.app. If the app stays on its current host for now, take only what you need: vibiz init "Acme" --resources database.

2. Dump your tables from Supabase

Your app's tables live in Supabase's public schema. Dump that schema with the connection string from your Supabase project:

Terminal
pg_dump "$SUPABASE_DB_URL" --schema=public --no-owner --no-privileges -f app.sql

Supabase's own schemas for auth and storage stay behind; steps 4 and 5 replace them. Row-level security policies that call Supabase's auth.uid() will not restore outside Supabase: move those checks into your server code, which reads the signed-in user from thelastapi sign-in.

3. Rehearse on the development copy

Terminal
vibiz dev -- sh -c 'psql "$DATABASE_URL" -f app.sql'

vibiz dev creates the development copy and runs the command with its env, so DATABASE_URL is the development database, never production. Point your app at it (vibiz dev writes .env.development.local), run it and fix anything the restore surfaced.

4. Restore into production

Production is the owner's. With a full-access key, write the production env to a file, restore, and delete the file:

Terminal
vibiz env --write .env.production.local
sh -c 'set -a; . ./.env.production.local; psql "$DATABASE_URL" -f app.sql'
rm .env.production.local
vibiz dev --reset

vibiz dev --reset throws the old development copy away, so the next vibiz dev branches again with your new tables and no rows.

5. Turn on sign-in

Turn on the methods your users know. vibiz auth shows how people sign in now; email and password and magic links are switched in the console or with PATCH /v1/projects/:id/auth/settings. Social sign-in is one command:

Terminal
vibiz auth
vibiz auth providers add google

Google works with shared keys, no OAuth app of your own needed. GitHub takes your own app: vibiz auth providers add github --own --client-id <id>. Your tables still hold the user ids from Supabase Auth, so when a person signs in for the first time, link the new account to their rows by email. More in adding sign-in to a Next.js app.

6. Move files and deploy

Upload what you exported from storage, or let thelastapi fetch each public file by its URL:

Terminal
vibiz files upload ./storage-export/* --folder uploads
curl https://thelastapi.dev/v1/projects/$PROJECT/files/import \
  -H "Authorization: Bearer $VIBIZ_API_KEY" -H 'content-type: application/json' \
  -d '{"url":"https://example.com/avatar.png","folder":"avatars"}'

Each file gets a permanent link; update the URLs your tables store. Then replace client-side data calls with SQL on the server, using any client:

TypeScript
import postgres from 'postgres';

const sql = postgres(process.env.DATABASE_URL!);
const orders = await sql`select id, total, status from orders where user_id = ${user.id}`;
Terminal
vibiz deploy -m "Move from Supabase"

Let your agent do the move

Every step above is a call your agent can make. Paste this into Claude Code, Codex or Cursor, then ask it to move your app:

Text
Set up thelastapi for me: follow https://thelastapi.dev/get-started.md

On a Limited key it works on the development copy and leaves the production restore to you. Pricing is prepaid credits with $2 to start; databases are recorded at an estimated $0.02 a day of cost plus 20% while pricing is not decided, and hosting and sign-in are not charged today. Every price is on the pricing page. To keep a copy of everything at any time, see backing up Postgres as SQL.

Frequently asked questions

Is thelastapi's database real Postgres?

Yes. Each project gets a Postgres database and a `DATABASE_URL`. It is plain Postgres over the internet, so any Postgres client, ORM or migration tool works, and `pg_dump` output from another Postgres restores into it with `psql`.

Can my AI agent damage production data on thelastapi?

No. Agents work on the development copy: production's tables with none of its rows. The production `DATABASE_URL` is for owners only, and a Limited key that reaches for production rows or live money gets `403 owner_only` with a link for the owner.

Do my users have to sign up again after the move?

They sign in on thelastapi's sign-in, which keeps its users in your project's database. Turn on the methods they know (email and password, magic links, Google, GitHub), and have your app link each person's first sign-in to their existing rows by email.

Can I leave thelastapi later?

Yes. `vibiz export --db` gives you the whole database as plain SQL that `psql` restores into any Postgres, with no owners or grants, and `--code` adds your app's source as it was uploaded.