Database Schemas & AI
Turn an app idea into a database, with AI
You do not need a Bubble app to use the Database Visualizer. You do not even need a paid Bubble plan. Describe your idea to ChatGPT or Claude, hand it our prompt, and you have a real schema diagram in about five minutes.
This is the route to take if you are still designing. If you already have a Bubble app, get its export instead.
Why this route exists
Four of LumiDevKit's six tools need a full Bubble application export, and Bubble only enables that export on its Starter plan and above. The Database Visualizer is the exception: it needs nothing but a small JSON file, and an AI can write that file for you.
So this is the one path through LumiDevKit that works on a free Bubble account, or with no Bubble account at all.
The loop
The whole workflow is a loop, and the loop is the point:
describe → generate → upload → look at the diagram → tell the AI what's wrong → repeat
Most people get a schema they are happy with in two or three passes. Reading a diagram is much faster than reading JSON, which is exactly why it is worth pushing the AI's output through the visualizer rather than eyeballing the code.
Step 1 — Copy the prompt
Open LumiDevKit schema format for AI and press Copy prompt.
The prompt is long and unusually strict, deliberately. LumiDevKit's parser accepts any field type you give it and silently downgrades the ones it does not recognise, so a vague prompt produces a schema that looks fine and is quietly broken. The prompt closes that door by listing every legal type and naming the specific mistakes models make.
If you would rather not copy anything, you can point a browsing-capable model straight at it:
Read https://lumidevkit.com/prompt/schema and follow it exactly. My app is a marketplace for dog walkers.
Step 2 — Describe your app
Paste the prompt into a new chat and replace the last line with your app.
Vague descriptions produce vague schemas. A good description answers:
- Who uses it? Different kinds of user usually become either a role option set or separate data types.
- What do they create? These become your core data types.
- What do they browse or search? Anything searchable needs to be its own type, not a text field.
- What states do things move through? Draft → submitted → approved. States become option sets.
- What is money, files, or locations? These map onto specific field types and are easy for a model to get wrong if you do not mention them.
A weak prompt: "a booking app".
A strong one: "A marketplace where dog owners book walkers. Owners create dogs with photos and notes. Walkers have profiles, hourly rates and service areas. Owners request a walk for a date and time; walkers accept or decline; after the walk both sides leave a rating. Walks move through requested, accepted, in progress, completed and cancelled. Payments are recorded per walk."
Step 3 — Save the reply and upload it
The model should answer with a single JSON block and nothing else. Copy it into a file called my-app.json.
Then open the Database Visualizer and drop the file onto the Database Schema card.
If the upload is rejected, the error decoder explains every message. The most common cause is the model wrapping the JSON in commentary — delete everything before the first { and after the last }.
Step 4 — Read the diagram, not the JSON
This is the step people skip, and it is the one that catches real mistakes. Six checks:
- No red boxes. Red means
[Missing: …]— the AI referenced a type it never defined, or referenced it by display name instead of key. - Every box has a name. A blank name means a missing
display. - Lists have links. If a field you meant as "many of these" has no line leaving it, the type string degraded. The usual culprit is
list.userwhere it should belist.custom.user. - Colours are right. Blue is a data type, orange an option set, gold the built-in User. A status that came out blue should probably have been an option set.
- The count matches. Fewer types than you asked for usually means two of them collided on the same key.
- Toggle Show deleted. Anything that appears was marked
deleted: trueand was invisible until now.
The full trap list explains what each symptom means.
Step 5 — Tell the AI what is wrong
Be specific and quote the diagram. These work well:
- "The
watchersfield on Order has no relationship line. Fix the type string." - "There is a red
[Missing: order_item]box. Add that data type or fix the reference." - "Payment status came out as a text field. Make it an option set."
- "Split Address out of Customer into its own data type."
Then re-upload. You do not need to start a new chat — the model still has the spec in context.
Step 6 — Do something with it
Once the diagram is right, you have several exits:
- Refine it by hand on the canvas — build or edit a schema.
- Push it into a real Bubble app, every type and option set at once, with the LumiDevKit extension — push a schema into Bubble.
- Take it to another stack as Postgres SQL, Prisma or Drizzle — export your schema.
- Save it to your account so you can come back to it — saved schemas.
A note on trusting the output
An AI-generated schema is a good first draft, not a finished data model. It will usually get the obvious entities and relationships right, and it will usually be too flat about things like addresses, money and history. Treat it as the starting point a diagram makes easy to critique — which is the whole reason to look at it as a picture rather than as code.