logo

Setting up Databases (devbase)

In the previous section, we briefly touched on how devbase handles data storage.
Now, let’s go deeper — how your app remembers things and how you can view, understand, and work with that data.

What is a Database Schema?

When you prompt the AI to use Devbase, it creates something called a database schema behind the scenes.
Think of it as a blueprint that defines:
  • What data your app stores
  • How that data is structured
  • Who can create or change it
  • What should happen automatically when users interact with the app
You don’t write this yourself — the AI generates it based on your prompt.

🔍 Inside a Schema – Example

Let’s say you built a game where users place a bet, try their luck, and withdraw winnings.
Devbase might auto-generate something like:
json
"fields": { "isWin": "Boolean", "betAmount": "Number", "profit": "Number", "mines": "Number", "gemsFound": "Number", "withdrawalStatus": "String" }
This would store data every time someone plays:
  • isWin – Did the user win?
  • betAmount – How much did they bet?
  • profit – How much did they earn?
  • mines, gemsFound – Game-specific stats
It can also include rules:
  • Only the player can see or update their own games
And actions:
  • On game creation → Send coins from the user’s wallet to a vault + set withdrawalStatus to "none"
And payout logic:
  • Check if withdrawal is allowed
  • Calculate payout, mark "completed", send coins from vault to player

Why Schemas Matter

Your schema is the brain of your app. It ensures:
  • Data security (users can only see/change their own data)
  • Safe coin transfers during actions
  • Game results & logic are stored, protected, and consistent

How to View Your Schema

Go to Configuration → Devbase:
  • JSON schema – Shows the exact data structure
  • Plain language explanation – Describes what’s stored and how it’s used
Tip: Switch to Brainstorm Mode and ask:
“Explain my schema”
The AI will walk you through it line-by-line.

When This Helps

  • Debugging issues
  • Extending app logic
  • Understanding your backend
⚠ If Devbase is empty or inactive, it means you haven’t triggered it yet. Just prompt the AI:
“Use Devbase to save each game a user plays, and add a history tab that lists all their past games.”

Editing Your Schema

Yes — you can change stored data at any time.
  • Update your prompt with new instructions
  • Or use Brainstorm Mode to describe new data you want stored
Example:
“Also store how many times each player has used the app.”
Devbase will update your schema & logic automatically.

Summary – Schema Made Simple

  • Schema = Your app’s data + logic blueprint
  • Defines what is stored, how, and who can change it
  • Generated automatically by dev.fun from your prompt
  • Can be viewed, updated, and understood anytime — no coding needed