Skip to main content

Getting Started with Studio Apps

This walks through creating a Studio App, building it, and making it show your own data. You need a Datazone project and permission to write to its repository.

1. Create the app

Open your project, go to Studio Apps, and choose New studio app. Give it a name — the alias is derived from it — and pick the branch to create it on. Datazone commits the whole scaffold to studio/<alias>/ and adds the entry to config.yml in one commit:
Creating the app does not build it. That is the next step, and it is always explicit.

2. Build it

Press Build. Datazone queues a sandboxed job that runs npm install and vite build, then publishes the bundle. The first build takes a couple of minutes; later ones are faster. When the status reaches READY, open the app. The scaffold greets you with the signed-in user’s email — proof that the session and the API are wired up:
If the build fails, the Builds tab has the full log.

3. Edit it

You have three ways to change the app, and they all go through the repository:

In Datazone

The project’s Code tab edits files and commits them in place.

With Orion

Describe the change; Orion writes the files and can design the objects behind them.

Locally

git clone the project, edit with your own tools, and push.
After any change: push, then build again. Datazone flags the served build as stale once the branch has moved on, but it never rebuilds on its own.

4. Show your own data

src/lib/datazone.ts is the client. Replace the body of Home in src/App.tsx with a query of your own:
The query runs with the signed-in user’s permissions. A dataset they cannot read fails with an error you can show them — which is exactly what the error state above is for. For a query you will use more than once, or one that would otherwise interpolate user input into SQL, publish an endpoint and call it with callEndpoint.

5. Add a page

Create the component, then add its route — an imported component with no route is removed from the bundle at build time and its page will 404:

6. Add UI components

The scaffold ships a layout shell and leaves src/components/ui/ empty. Add components with the shadcn CLI, which reads the components.json already in your app:
The files land in src/components/ui/ and are yours to edit. Check package.json afterwards and pin any version the CLI added as a range — a ^ lets two builds of the same commit install different code. Style from the theme tokens (bg-background, text-muted-foreground, bg-card, text-primary) rather than literal colours, so the app follows Datazone’s light and dark themes. The theme lives in src/index.css; Tailwind 4 is configured there, not in a tailwind.config.js.

7. Store data

To let users create or edit records, add a Knowledge Object and have the app read and write its instances. Objects are YAML in the same repository, so both ship in the same push:
Objects migrate before they can be written to — an app whose objects are not READY will load and fail on its first write. Deploy the objects, wait for READY, then build the app.
Do not keep records in localStorage or in a file in the repository. localStorage is per-browser and lost on the next device, and the bundle is read-only at runtime. Use Knowledge Objects.

Things that build fine and break in the browser

A Studio App can compile cleanly and still fail once served. These are the causes, in order of how often they happen:

Working locally

npm install && npm run dev renders the app, but API calls will not work: in dev the client resolves the API to /api, which the Vite dev server does not serve. Develop layout locally and verify data against a built app, or add your own /api proxy to vite.config.js.

Next steps