Skip to content

Commit 5284177

Browse files
authored
docs: describe development flow and app management (#55)
* docs: describe development flow and app management * chore: improve docs after review
1 parent 4978b50 commit 5284177

11 files changed

Lines changed: 379 additions & 35 deletions

docs/docs/_prerequisites.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Prerequisites
2+
3+
- [Node.js](https://nodejs.org) environment
4+
- Databricks CLI: install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).

docs/docs/app-management.mdx

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
import Prerequisites from './_prerequisites.mdx';
6+
7+
# App management
8+
9+
Manage your AppKit application throughout its lifecycle using the Databricks CLI. This guide covers deploying, starting, stopping, monitoring, and deleting apps.
10+
11+
<Prerequisites />
12+
13+
## Create app
14+
15+
See the [Quick start](./index.md#quick-start-options) section to create a new Databricks app with AppKit installed.
16+
17+
## Configuration
18+
19+
Before deploying your app, configure it according to your needs. See the [Databricks Apps Configuration](https://docs.databricks.com/aws/en/dev-tools/databricks-apps/configuration) documentation for details on:
20+
21+
- App configuration file (`app.yaml`)
22+
- Environment variables
23+
- Authorization and permissions
24+
- Networking configuration
25+
26+
## Deploy app
27+
28+
Deploy your AppKit application using the automated deployment pipeline:
29+
30+
```bash
31+
databricks apps deploy
32+
```
33+
34+
This command runs a complete deployment pipeline:
35+
1. Builds the frontend (`npm run build`)
36+
2. Deploys the bundle to the workspace
37+
3. Runs the app
38+
39+
:::note
40+
41+
For all available options, run:
42+
```bash
43+
databricks apps deploy --help
44+
```
45+
:::
46+
47+
### Examples
48+
49+
- Deploy to a specific target:
50+
51+
```bash
52+
databricks apps deploy --target prod
53+
```
54+
55+
- Deploy with custom variables:
56+
57+
```bash
58+
databricks apps deploy --var="warehouse_id=abc123"
59+
```
60+
61+
- Skip the build step for faster iteration:
62+
63+
```bash
64+
databricks apps deploy --skip-build
65+
```
66+
67+
- Force deploy (override Git branch validation):
68+
69+
```bash
70+
databricks apps deploy --force
71+
```
72+
73+
## Start app
74+
75+
To start a stopped app, run:
76+
77+
```bash
78+
databricks apps start {name}
79+
```
80+
81+
## Stop app
82+
83+
Stop a running app without deleting it:
84+
85+
```bash
86+
databricks apps stop {name}
87+
```
88+
89+
## List all apps
90+
91+
```bash
92+
databricks apps list
93+
```
94+
95+
## Get detailed app information
96+
97+
```bash
98+
databricks apps get {name}
99+
```
100+
101+
## Stream app Logs
102+
103+
Stream application logs in real-time:
104+
105+
```bash
106+
databricks apps logs {name}
107+
```
108+
109+
By default, this shows the most recent 200 log lines and exits.
110+
111+
> **Note:** For all available options, run `databricks apps logs --help`
112+
113+
### Examples
114+
115+
- Show the last 50 log lines:
116+
117+
```bash
118+
databricks apps logs my-app --tail-lines 50
119+
```
120+
121+
- Follow logs with a search filter:
122+
123+
```bash
124+
databricks apps logs my-app --follow --search ERROR
125+
```
126+
127+
- Filter logs by source:
128+
129+
```bash
130+
databricks apps logs my-app --follow --source APP
131+
```
132+
133+
- Save logs to a file:
134+
135+
```bash
136+
databricks apps logs my-app --follow --output-file app.log
137+
```
138+
139+
- Stream logs for 5 minutes:
140+
141+
```bash
142+
databricks apps logs my-app --follow --timeout 5m
143+
```
144+
145+
## Delete app
146+
147+
Permanently delete an app:
148+
149+
```bash
150+
databricks apps delete {name}
151+
```
152+
153+
**⚠️ Warning:** This action cannot be undone. All app data and configurations will be removed.
154+
155+
## See also
156+
157+
For more information about Databricks Apps, including platform architecture, use cases, security, and advanced features, see the [Databricks Apps documentation](https://docs.databricks.com/aws/en/dev-tools/databricks-apps/).

docs/docs/core-concepts/_category_.json

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Principles
1+
# Core Principles
22

33
Learn about the fundamental concepts and principles behind AppKit.
44

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Prerequisites
2+
3+
- [Node.js](https://nodejs.org) environment
4+
- Databricks CLI: install and configure it according to the [official tutorial](https://docs.databricks.com/aws/en/dev-tools/cli/tutorial).
5+
- A new Databricks app with AppKit installed. See [Bootstrap a new Databricks app](../index.md#quick-start-options) for more details.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
import Prerequisites from './_prerequisites_app.mdx';
6+
7+
# AI-Assisted development
8+
9+
<Prerequisites />
10+
11+
AppKit integrates with AI coding assistants through the Model Context Protocol (MCP).
12+
13+
## Installing MCP server
14+
15+
To install the Databricks MCP server for your preferred AI assistant, run:
16+
17+
```bash
18+
databricks experimental apps-mcp install
19+
```
20+
21+
## MCP capabilities
22+
23+
The MCP server exposes the following capabilities for AI assistants:
24+
25+
- **Data exploration**: Query catalogs, schemas, tables, and execute SQL
26+
- **CLI command execution**: Deploy and manage apps, and run other workspace operations
27+
- **Workspace resource discovery**: Inspect and navigate workspace resources
28+
29+
## Example prompts
30+
31+
Here are some basic examples you can use to explore your app and workspace:
32+
33+
1. Creating a new basic app
34+
```
35+
Create a new Databricks app that displays a dashboard of the users table in main.default.
36+
```
37+
1. Introspecting a table schema
38+
```
39+
Show me the schema of the users table in main.default.
40+
```
41+
1. Creating a new query
42+
```
43+
Create a new query to find users created in the last 7 days.
44+
```
45+
1. Deploying an app
46+
```
47+
Deploy the app to Databricks with the name "my-app".
48+
```
49+
50+
Possibilities are virtually endless. Ask your AI assistant to help you with your app and workspace.
51+
52+
## LLM resources
53+
54+
AppKit provides specialized guidance files to help AI coding assistants work more effectively with the projects.
55+
56+
If you're building applications using AppKit packages, reference the **[llms.txt](https://github.com/databricks/appkit/blob/main/llms.txt)** file.

docs/docs/development/index.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
import Prerequisites from './_prerequisites_app.mdx';
6+
7+
# Development
8+
9+
AppKit provides multiple development workflows to suit different needs: local development with hot reload, AI-assisted development with MCP, and remote tunneling to deployed backends.
10+
11+
<Prerequisites />
12+
13+
## Development flows
14+
15+
There are multiple supported development flows available with AppKit:
16+
17+
1. **[Local development](./local-development.mdx)**: Run the development server with hot reload for both UI and backend code. This is the default development flow and is suitable for most use cases.
18+
2. **[AI-assisted development](./ai-assisted-development.mdx)**: Use an AI coding assistant connected via the Databricks MCP server to explore data, run CLI commands, and scaffold your app interactively.
19+
3. **[Remote bridge](./remote-bridge.mdx)**: Create a remote bridge to a deployed backend while keeping your queries and UI local. This is useful for testing against production data or debugging deployed backend code without redeploying your app.
20+
21+
## See also
22+
23+
- [App Management](../app-management.mdx): Manage your AppKit application throughout its lifecycle using the Databricks CLI
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
import Prerequisites from './_prerequisites_app.mdx';
6+
7+
# Local development
8+
9+
<Prerequisites />
10+
11+
Once your app is bootstrapped according to the [Manual quick start](../index.md#manual-quick-start) guide, you can start the development server with hot reload for both UI and backend code.
12+
13+
In the application root directory, run the following command to start the development server:
14+
15+
```bash
16+
npm run dev
17+
```
18+
19+
This command will start the development server with hot reload for both UI and backend code. Open the displayed URL in your browser to see the app. Modify the code in the `src/` directory to see the changes reflected in the browser.
20+
21+
To see the other available commands, read the `README.md` file in the application root directory.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
import Prerequisites from './_prerequisites_app.mdx';
6+
7+
# Remote Bridge
8+
9+
<Prerequisites />
10+
11+
Remote bridge allows you to develop against a deployed backend while keeping your UI and queries local. This is useful for testing against production data or debugging deployed backend code without redeploying your app.
12+
13+
## When to use Remote Bridge
14+
15+
Use remote bridge when:
16+
- Testing against production data
17+
- Debugging deployed backend code
18+
- Developing UI without running backend locally
19+
- Collaborating with team members on the same backend
20+
21+
## Starting and stopping Remote Bridge
22+
23+
To start the remote bridge, run the following command:
24+
25+
```bash
26+
databricks apps dev-remote
27+
```
28+
29+
The command will:
30+
31+
1. Obtain app name from the context (either `app.yml` file or user input in the CLI)
32+
1. Start a local Vite development server
33+
2. Establish a WebSocket bridge to your deployed app
34+
3. Provide two URLs:
35+
36+
- **App URL**: Direct link for your own use (`<app-url>?dev=true`)
37+
- **Shareable URL**: Link with tunnel ID for sharing with team members (`<app-url>?dev=<tunnelId>`)
38+
39+
:::note
40+
41+
For all available options, run:
42+
```bash
43+
databricks apps dev-remote --help
44+
```
45+
:::
46+
47+
To stop the remote bridge, press `Ctrl+C` in the terminal.
48+
49+
## Connection approval
50+
51+
When you start remote bridge, every time you open the URL in your browser from a new device, you'll be prompted to approve the connection.
52+
53+
You can provide the URL to your team members to allow them to see the app in their browser. You will still need to approve the connection from your side.
54+
55+
## How it works
56+
57+
Remote bridge creates a WebSocket bridge between your local Vite dev server and the deployed backend, allowing you to develop UI locally while using the deployed backend.
58+
59+
```mermaid
60+
flowchart LR
61+
Browser[Browser]
62+
Backend[Deployed Backend]
63+
Bridge[WebSocket Bridge]
64+
LocalVite[Local Vite Dev Server]
65+
66+
Browser <-->|HTTPS| Backend
67+
Backend <-->|WSS Tunnel| Bridge
68+
Bridge <-->|HTTP/WS| LocalVite
69+
```
70+
71+
### Details
72+
73+
- The **Browser** connects to the deployed app backend with `?dev=true` or `?dev=<tunnelId>` query parameter
74+
- The **Deployed Backend** proxies UI requests through a WebSocket tunnel (`/dev-tunnel`) to your local machine
75+
- The **WebSocket Bridge** (running locally) receives fetch requests and file read requests from the backend
76+
- The **Local Vite Dev Server** serves the UI files and provides hot module replacement (HMR)
77+
- The bridge sends responses back through the WebSocket to the backend, which serves them to the browser
78+
79+
### What gets hot-reloaded
80+
81+
With remote bridge you get instant hot-reload for:
82+
83+
- **UI Changes** - Any changes to your React/TypeScript/CSS files in the `client/` directory
84+
- **Query Files** - SQL files in the `config/queries/` directory (`.sql` files only)
85+
86+
Backend code is **not** hot-reloaded. You need to redeploy your app to see changes in the backend code.

0 commit comments

Comments
 (0)