Skip to content
dhanu docs
Browse pages

Tasks

Saving data and backends

An app can keep simple values on its own, or get a real backend — its own sign-in, database, file storage and server functions — which you can then browse and edit from the Backend view.

“Entries should still be there tomorrow” is the sentence that turns a page into an app with data behind it. There are two levels of that, and the assistant picks the smaller one unless you need the larger.

Level one: simple storage

For a to-do list, a saved preference, a running total, the app keeps values in its own key–value store. No setup, nothing to configure, nothing for you to manage. It is scoped to that app and works the moment it is written.

That is the right level when the data belongs to whoever is using the app and nobody needs to sign in.

Level two: a real backend

Ask for sign-in, accounts, shared records, file uploads or scheduled server work, and the assistant can provision the app its own isolated backend:

PieceWhat it gives your app
AuthenticationEnd-user accounts — email and password, guest sessions, and Google or GitHub sign-in
DatabaseCollections of records, with typed fields
StorageBuckets for images, documents and attachments
FunctionsServer-side code the app can call — the place for anything that must not run in a browser

It is provisioned by asking, not by filling in a form: “people should be able to sign up and save their own entries” is enough.

The app’s users are not your Dhanu users

Signing in to your published app is not signing in to Dhanu. The app has its own list of end users, entirely separate from your workspace members. Nobody who signs up for your app gets access to anything else you have.

Admin credentials for the backend stay on the server. The generated code never holds a key that could be lifted out of the browser.

The Backend view

Once an app has a backend, the Backend view in the app pane is a working console for it:

Database — pick a collection and page through its rows. Add a row, edit one, delete one, either through a generated form or as raw JSON when the shape is awkward.

Storage — see every file your app’s users have uploaded, with size and upload time, and delete any of them. You can create a new bucket here too.

End users — who has signed up for your app.

Authentication — turn email-and-password sign-in and guest sessions on or off, and add the keys for Google or GitHub sign-in.

Functions — the server functions the app has, and a log of their recent executions.

Everything here acts on real data belonging to real users of your app. There is no undo on a deleted row.

Availability

App backends depend on how your Dhanu deployment is configured. If the assistant says it cannot set one up, the capability is not enabled for you and an administrator can say whether it will be. Simple storage is always available.

Working with it well

Start without a backend. Most small tools never need one, and one is easy to add later.

Say who the data belongs to. “Each person should only see their own entries” is a requirement the assistant can build and check; “save the entries” is not.

Do not put secrets in the app. Anything in an app’s files reaches the browser. Keys, tokens and anything private belong in a server function — see Security checks.