Skip to content
DocumentationData apps
Data apps
Develop locally

Develop locally

Start with Build a data app for a hosted app. Use local development when you need source files, a local server, or control over publishing.

Directory app workflow

1. Create a local app

Install the CLI and log in, then create a scaffold:

Altertable CLI
altertable app create product-pulse

The scaffold checks the live connection. Confirm that the active profile points to the intended environment before continuing.

2. Run the development server

Terminal
cd product-pulse
altertable app dev

Open the local URL printed by the command. Edit the scaffold's src/main.tsx and App.tsx source and verify a bounded query against a known table. Check loading, empty, and error states as well as a successful result.

3. Validate the app

From the project directory, run:

Altertable CLI
altertable app lint --lakehouse
altertable app build

The lakehouse check validates queries against the connected environment. Compare at least one displayed metric with a direct SQL result before publishing. For all options, see the app command reference.

Single-file preview and publishing

The CLI also supports a separate single-file workflow. Author a self-contained React source file using the data-app SDK, then preview and validate that file:

Altertable CLI
altertable app dev --file index.tsx
altertable app lint --file index.tsx --lakehouse

Publishing creates a hosted app in the active environment. Review the source, title, target environment, and local preview before running:

Altertable CLI
altertable app publish --title 'Product pulse' --file index.tsx

app publish --file uploads a single source file; it does not upload the directory scaffold or its build output. Use hosted app building when you want Altertable to manage the app source and publishing.

Follow the printed result URL and repeat the metric and interaction checks in the hosted app, then configure sharing. Use the update command to change an existing app.

Troubleshooting

  • Scaffold connection check fails: run altertable profile show and verify a query with the same profile.
  • A query fails validation: inspect the real catalog and column names; qualify tables with catalog and schema.
  • The preview is empty: query the source directly with the same filters and time range.
  • Publishing fails: check the entry file and the active environment, then inspect the command's error before retrying.

Follow the data-app repository for the CLI scaffold, SDK setup, development commands, and publishing workflow. Use its current instructions for the SDK version in your project.

If you are working with an agent, ask it to use Altertable's local data-app workflow explicitly and verify the app locally before publishing.

Build locally with your coding agent

Agent prompt
Build an Altertable data app locally in this repository. Read https://altertable.ai/docs/data-apps/local-development.md and the current instructions in https://github.com/altertable-ai/data-app first. Inspect the project and use its package manager. Infer which question the app should answer and who will use it from the project context; ask only for missing details. Confirm the target Altertable environment, inspect available catalogs and schemas, and agree on the metric definitions and time range. Create or reuse the local scaffold and implement a small working app with bounded queries, useful filters, and clear loading, empty, and error states. Keep credentials out of browser code and source control. Verify the query results and calculations against actual data, then run the supported validation and build commands and inspect the app locally. Leave the source and local preview ready for review. Report how to run it, the data sources used, and any remaining issues. Do not publish, deploy, or share the app.