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 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
cd product-pulsealtertable 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 app lint --lakehousealtertable 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 app dev --file index.tsxaltertable 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 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 showand 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.