Data and storage

Most apps need to remember things — bookings, orders, messages — and many need to hold files such as photos or PDFs. This guide explains how your project’s database and file storage work, how to describe your data to the agent, and how to look after the personal data you collect.

Available

Each Kree8 project can have its own database and file storage, set up by the agent when your app needs them. Running them uses credits while they are in use; an idle database sleeps and costs very little.

Your project’s database

Each project can have its own PostgreSQL database, separate from every other project. Your app’s server code reads and writes it; visitors never connect to it directly. You don’t need to know database language — describe what you want stored and the agent designs the tables, writes the code and explains the result.

Describing your data in plain words

Think in terms of the “things” your app keeps, what you need to know about each, and how they relate.

Ask Kree8

“I need to store customers, appointments and services. A customer has a name, email and phone. A service has a name, duration and price in pounds. An appointment links one customer to one service at a date and time, with a status of booked, cancelled or completed. Show me the structure before you build it.”

  • Say which details are required and which are optional.
  • Say what must be unique, such as one account per email address.
  • Mention anything that should never be deleted, only archived.
  • Ask for a plain-English summary of the structure after any change.

Idle sleep, frequency and cost

A database that isn’t being used can go to sleep, which keeps running costs down. The first request after a quiet spell may take a moment longer while it wakes. Anything that touches the database very often keeps it awake and uses more credits.

  • Schedule background jobs every 5 minutes or slower where you can; hourly or daily is often enough.
  • Prefer events — a customer submitting a form, or a webhook from Stripe — over repeatedly checking for changes.
  • Ask the agent to avoid unnecessary database calls on pages that don’t need fresh data.

Scheduling is covered in Agents and scheduled routines.

Backups and restore

Your project database can be restored to an earlier point in time within the last seven days, and the agent can export tables to spreadsheet files or take a full copy on request. Restoring replaces current data, so the agent explains what will change and waits for your yes. Good habits on top of that:

  1. Keep your own copy. Ask the agent for an export of your key records before big changes, or have it add a private admin download you can use regularly.
  2. Be careful with destructive changes. Before the agent removes or reshapes stored data, ask it to explain what will be lost and wait for your yes.
  3. Remember deletion is final. Deleting a project from /platform/ removes it, including its data. Export anything you need first.

Files: public and private

File storage holds things like images, documents and uploads. Each file is either public or private.

TypeWho can see itUse for
PublicAnyone with the address, served under a public path such as /media/Product photos, logos, downloadable brochures
PrivateOnly people your app gives a short-lived link toInvoices, ID documents, customer uploads, paid downloads

Short-lived links

For a private file, your app checks that the person is allowed to see it, then creates a link that works for a limited time. If the link is shared later, it will have expired. Ask for a short expiry for sensitive files.

Direct uploads

When a visitor uploads a file, your app’s server code prepares a short-lived upload link and the browser sends the file straight to storage. Ask the agent to limit the file types and maximum size it accepts.

Ask Kree8

“Let signed-in customers upload a PDF or JPG up to 10 MB to their booking. Keep the files private, and let only that customer and admins open them through short-lived links.”

Privacy checklist

If your app stores information about people, you are responsible for it. Run through this list with the agent.

  • Collect less. Only ask for details you actually use. If you don’t need a date of birth or address, don’t store it.
  • Know who sees what. List who should see each kind of record — the customer, staff, admins — and ask the agent to enforce it in server code, not just hide it on the page.
  • Private by default. Customer uploads and documents should be private files.
  • No secrets in the page. Keys and passwords stay in server settings; passwords are stored only as salted hashes (see Authentication).
  • Retention. Decide how long you keep data and ask for old records to be removed or anonymised on a schedule.
  • Requests from people. Make sure you can find, export and delete one person’s data if they ask.
  • Tell people. Publish a privacy notice that matches what your app really does, and have it checked by someone qualified.
Ask Kree8

“List every piece of personal data this app stores, where it’s stored, and who can see it. Flag anything we don’t actually use.”