Skip to main content
Back to Documentation

Backend & Database

How Mobiforge sets up and manages your Supabase backend.

Fully managed Supabase backend

Every Mobiforge app comes with a fully managed Supabase backend — a PostgreSQL database, authentication, file storage, and real-time subscriptions. The AI generates your schema automatically from your prompt, so your backend is live and functional from the very first build. No manual table creation, no hand-written SQL.

What's included

PostgreSQL database

Tables and relationships auto-generated from your data model. Every entity you mention in your prompt becomes a properly typed table with foreign keys.

Authentication

Email/password and social login built in from day one. Sessions, refresh tokens, and protected routes are wired up automatically.

Row Level Security

Data access rules are auto-generated so users only see their own data. RLS policies are set on every table that contains user-scoped records.

File storage

Image and file uploads are handled automatically when your app needs them. Storage buckets, upload helpers, and signed URL generation are included.

Connecting your own Supabase project

By default, Mobiforge manages a Supabase project for your app. On Growth and Studio plans, you can connect your own Supabase project to keep full ownership of your data and use your existing configuration.

1

Open Project Settings

In the Mobiforge builder, click the gear icon in the top bar to open Project Settings.

2

Go to the Supabase tab

Inside Project Settings, select the "Supabase" tab to see the database connection options.

3

Enter your project URL and anon key

Paste your Supabase project URL (e.g. https://xxxx.supabase.co) and your project's anon public key from the Supabase dashboard.

4

Save

Click Save. Your app will now read and write to your own Supabase database. Migrations and RLS policies will be applied to your project going forward.

SQL Explorer

The built-in SQL Explorer lets you run queries directly against your database from within the Mobiforge builder — no external tool required. Click the database icon in the left sidebar to open it.

-- Example: inspect your users table
SELECT id, email, created_at
FROM auth.users
ORDER BY created_at DESC
LIMIT 20;

Use the SQL Explorer to inspect data, debug queries, seed test records, or manually patch values during development.

Automatic migrations

When the AI changes your data model — adds a table, adds a column, changes a relationship — it generates and runs a migration automatically. You never need to write SQL to keep your schema in sync with your code.

You can view all past migrations in the SQL Explorer under the Migrations tab. Each migration is timestamped and includes the SQL that was executed, so you always have a full audit trail of schema changes.

Do not delete tables manually

Do not delete Supabase tables that Mobiforge created while your app is live — this will break your production app. If you need to change your schema, describe the change to the AI in the chat and it will generate and apply the correct migration safely.