Database & Data
A database is where your app remembers things. When a user signs up, the database remembers them. When they save a post, the database remembers it. When they come back tomorrow, everything they did is still there.
Think of it like a giant, very organised filing cabinet. Every kind of thing your app remembers gets its own drawer. One drawer for users, one for posts, one for orders. Each drawer is called a table.
You don't have to think about the filing cabinet to use Appsanic. When you describe a feature, the agent decides which drawers to create, what each card in the drawer should record, and how to keep everything safe. You can peek inside if you want; most people don't need to.
Heads-up: Appsanic's database is powered by Supabase. Read that page first if you haven't connected Supabase yet. It walks through the one-time signup and connection.
What you get with every project
When the agent builds your app, it sets up a real database on Supabase (a backend service we'll explain in a second). For free. It lives in your name, not ours.
Out of the box your app has:
- A real database to store anything your app needs to remember.
- A privacy guarantee: each user can only see their own data, never anyone else's. We'll explain how below.
- File storage in the same place (photos, receipts, anything).
- Live updates. When something changes, the app can show it to other users instantly.
What's Supabase? It's a service that gives your app a database, sign-in, and file storage in one place. Like having a backend you didn't have to build. It runs in your account, not Appsanic's. If you cancelled Appsanic tomorrow, your data and users would still be there.
Three prompts that cover most apps
You almost never need to think about tables, columns, or queries. You describe what you want in normal sentences, and the agent does the database work.
1. "Let users save things"
"Let users save favorite recipes. Each favorite remembers the recipe (a link or an in-app one), a note, and a tag. Each user only sees their own favorites."
The agent creates the drawer (a "favorites" table), figures out what to record on each card (recipe, note, tag, user, date saved), locks down the drawer so each user only sees their own cards, and wires up the buttons to add, remove, and list favorites.
2. "Let users belong to groups"
"Each habit belongs to an accountability group. Groups have up to 10 people. Each habit belongs to one user, but everyone in the group can see each other's habits."
The agent creates a second drawer for groups, a way to track who belongs to which group, and rules so that group members can see each other's habits but strangers cannot.
3. "Make it update live"
"When someone in my accountability group checks off a habit, I want to see that update on my phone without refreshing."
The agent wires up live updates so the screen reacts the moment something changes, anywhere in the world. See Realtime Updates for more.
How "each user only sees their own data" actually works
This is one of the most important features of your app and easy to miss because it's invisible.
Without this protection, a bug in your app could accidentally show one user another user's data. With this protection, even if there's a bug, the database itself refuses to hand over the wrong rows. It's a second locked door.
The agent turns this on for every table it creates. The technical name is Row Level Security ("RLS"). See the Glossary. But you don't need to know that. You just need to know it's on.
If you ever want to verify it's working, the Supabase dashboard shows the rules for each table under Authentication > Policies.
Looking at your data directly
You don't have to, but you can. From inside Appsanic:
- Open your project.
- Click Supabase dashboard in the top right.
- You land in your Supabase project, already signed in.
From there you can browse every drawer (table), see the cards (rows) inside, and check who's allowed to read what.
Backups
Your data is automatically backed up by Supabase on paid plans. The exact retention depends on your Supabase plan. Check the Supabase dashboard for the details.
For anything truly precious (a customer list, archived journal entries), back it up to a place you control too. Supabase lets you export everything to a file you can save anywhere. It's a button in the dashboard.
Common mistakes (read this before editing data by hand)
If you skip Appsanic and add a table directly in the Supabase dashboard, you must add the privacy rules yourself. The agent does this automatically; doing it by hand means remembering to lock down each new table.
Also: Supabase gives you two kinds of keys. The "anon key" is safe to bundle into your app. It's designed for browsers and phones. The "service role key" bypasses all your safety rules. Never put it in your app's code or share it publicly. The agent only puts the anon key in places that reach users.
Under the hood (for engineers reading this)
The database is Postgres, hosted by Supabase. Tables and policies are defined in versioned SQL migrations under supabase/migrations/. The agent generates TypeScript types from your schema and regenerates them on every schema change.
Example row-level policy the agent writes for a favorites table:
create policy "favorites read own" on favorites
for select using (auth.uid() = user_id);Queries from the app go through a thin Zustand store wrapping the Supabase client:
const { data, error } = await supabase
.from("favorites")
.select("*")
.order("created_at", { ascending: false });Standard Supabase CLI commands work locally:
supabase db reset # reset local dev DB to latest migration
supabase db push # push migrations to your hosted projectSee Editing Exported Code for the conventions the agent follows.
Next
Want to charge users? Read Payments. Want to know about file uploads? Read File Uploads & Storage.
