# Architecture

AppKit follows a plugin-based architecture designed for building production-ready Databricks applications. This document provides a high-level overview of the system components and their interactions.

## High-level architecture[​](#high-level-architecture "Direct link to High-level architecture")

<!-- -->

## Core components[​](#core-components "Direct link to Core components")

AppKit is organized into two main packages:

### @databricks/appkit[​](#databricksappkit "Direct link to @databricks/appkit")

The backend SDK that provides the plugin architecture and core functionality. It includes:

* Plugin system with lifecycle management
* Built-in server and analytics plugins
* Telemetry and observability features
* Cache management and streaming capabilities
* Type generation for SQL queries

See the [Plugins](./docs/plugins.md) and [API reference](./docs/api/appkit.md) documentation for detailed information.

### @databricks/appkit-ui[​](#databricksappkit-ui "Direct link to @databricks/appkit-ui")

A React UI library with pre-built components optimized for data applications:

* React hooks for query execution and streaming
* UI components based on Radix UI and Tailwind
* Data visualization components
* Type-safe integration with backend queries

See the [API reference](./docs/api/appkit-ui.md) for component documentation.

## Application layers[​](#application-layers "Direct link to Application layers")

### Client layer[​](#client-layer "Direct link to Client layer")

The React frontend layer that optionally uses `@databricks/appkit-ui` components:

* Renders UI components and visualizations
* Manages client state and user interactions
* Consumes backend APIs via HTTP and SSE
* Provides type-safe query execution hooks

### Server layer[​](#server-layer "Direct link to Server layer")

The Node.js backend layer built with `@databricks/appkit`:

* Serves the React application (dev and production modes)
* Executes SQL queries against Databricks SQL Warehouses
* Handles authentication and authorization
* Provides caching, retry logic, and error handling
* Exposes REST APIs and SSE endpoints

### Data layer[​](#data-layer "Direct link to Data layer")

Integration with Databricks services:

* **SQL Warehouses**: Execute analytical queries with Arrow or JSON format
* **Lakebase Autoscaling**: OLTP database access with automatic OAuth token refresh

## See also[​](#see-also "Direct link to See also")

* [Plugins](./docs/plugins.md): Deep dive into the plugin system
* [API reference](./docs/api.md): Complete API documentation
* [Development](./docs/development.md): Explore development workflows
* [Core Principles](./docs/core-principles.md): Learn about AppKit's design philosophy
