A modern, full-stack application template for building Databricks Apps with Python FastAPI backend and React TypeScript frontend.
Claude Code-centric workflow - a single /dba
command transforms your ideas into deployed applications. Claude guides you through product requirements, technical design, implementation, and deployment. It knows the entire Databricks Apps ecosystem and self-heals by automatically diagnosing and fixing issues.
The /dba
workflow acts as your product strategist and development architect - brainstorming ideas with you, then building everything all the way to deployment.
Click "Use this template" on GitHub to create your own Databricks app repository.
git clone https://github.com/yourusername/your-databricks-app
cd your-databricks-app
Open your repository in Claude Code and run the fully automated, opinionated workflow:
/dba describe your app here
The /dba
command will:
- β Set up your development environment with interactive configuration
- β Test your app locally before deployment to catch issues early
- β Create or verify your Databricks app exists
- β Deploy successfully to Databricks Apps platform
- β Guide you through product requirements with collaborative iteration
- β Design your technical architecture with ultrathinking approach
- β
Generate documentation (
docs/product.md
anddocs/design.md
) - β Optionally implement your design or provide guidance for later implementation
This provides a complete guided experience from idea to deployed app.
If you prefer to have full control over the development process:
-
Run the setup script to configure your environment:
./setup.sh
-
Open in Claude Code and develop normally. Claude will:
- Know about your entire repository structure
- Understand the Databricks Apps framework
- Help with any development tasks you request
- Use the natural language commands documented below
This approach gives you complete flexibility while still benefiting from Claude's knowledge of the codebase and all available commands.
This is a 40-minute walkthrough demo of making an app from start to finish using the /dba
command in Claude Code.
Working Example: trace-summary-dashboard branch - Complete implementation from the video
See the Changes: View diff - All code changes made during the demo
Before using this template, ensure you have:
- Git - Version control
- uv - Ultra-fast Python package manager (auto-manages Python versions)
- bun - Fast JavaScript package manager
- Node.js 18+ - Required for Playwright
- Homebrew - Package manager (macOS only, auto-checked)
- Playwright - Browser automation and testing (optional but recommended)
Note: Python 3.11+ and Databricks CLI are automatically managed by uv
The setup.sh
script will help you install any missing dependencies with interactive prompts.
- Valid Databricks workspace
- Personal Access Token (PAT) or CLI profile configured
- Appropriate permissions for app deployment
- π₯ Hot Reloading - Instant updates for both Python backend and React frontend
- π Auto-Generated API Client - TypeScript client automatically generated from FastAPI OpenAPI spec
- π Databricks Authentication - Integrated with Databricks SDK for seamless workspace integration
- π¨ Modern UI - Beautiful components using shadcn/ui + Tailwind CSS
- π¦ Package Management - uv for Python, bun for frontend
- π Databricks Apps Ready - Pre-configured for deployment to Databricks Apps platform
- π€ Claude Integration - Natural language development commands documented
βββ server/ # FastAPI backend
β βββ app.py # Main application
β βββ routers/ # API route handlers
β β βββ __init__.py # Example router
β βββ services/ # Business logic
β
βββ client/ # React frontend
β βββ src/
β β βββ pages/ # React pages
β β βββ components/ # UI components
β β βββ lib/ # Utilities
β β βββ fastapi_client/ # Generated API client
β βββ package.json # Frontend dependencies
β βββ vite.config.ts # Vite configuration
β
βββ setup_utils/ # Modular setup system
β βββ utils.sh # Shared utilities
β βββ check_git.sh # Git dependency check
β βββ check_uv.sh # uv package manager check
β βββ check_bun.sh # Bun package manager check
β βββ check_node.sh # Node.js 18+ check
β βββ check_homebrew.sh # Homebrew check (macOS)
β
βββ scripts/ # Development automation
β βββ watch.sh # Development server
β βββ fix.sh # Code formatting
β βββ deploy.sh # Deployment
β
βββ setup.sh # Main setup script
βββ pyproject.toml # Python dependencies
βββ app.yaml # Databricks Apps config
βββ CLAUDE.md # Development guide
Note: This section is for manual setup. For the automated workflow, use the
/dba
command described above.
./setup.sh
This interactive script will:
- Check system dependencies (Git, uv, Bun, Node.js 18+)
- Install missing dependencies with interactive prompts and OS-specific commands
- Set up Databricks authentication (PAT or profile)
- Install Python dependencies with uv (including Python 3.11+ if needed)
- Install frontend dependencies with bun
- Configure environment variables
The setup script uses a modular design with individual dependency checkers in the setup_utils/
directory for better maintainability.
./watch.sh
This runs both servers in the background:
- Frontend: http://localhost:5173
- Backend: http://localhost:8000
- API Docs: http://localhost:8000/docs
Open http://localhost:5173 to see the beautiful welcome page with:
- Getting Started guide
- Claude Commands reference
- Tech Stack overview
- Project Structure visualization
- Current user information from Databricks
This template includes natural language commands that Claude understands:
"start the devserver"
β Runs development servers"kill the devserver"
β Stops background processes"fix the code"
β Formats Python and TypeScript code"deploy the app"
β Deploys to Databricks Apps
"add a new API endpoint"
β Creates FastAPI routes"create a new React component"
β Builds UI components"open the UI in playwright"
β Opens app in browser for testing"debug this error"
β Analyzes logs and fixes issues
See CLAUDE.md
for the complete development guide.
Command | Description | Flags |
---|---|---|
./setup.sh |
Interactive environment setup | --auto-close |
./watch.sh |
Start dev servers (background) | --prod |
./fix.sh |
Format code (Python + TypeScript) | None |
./deploy.sh |
Deploy to Databricks Apps | --verbose , --create |
./app_status.sh |
Check deployed app status | --verbose |
./run_app_local.sh |
Run app locally for debugging | --verbose |
./setup.sh
- Configures authentication, installs dependencies, sets up environment./watch.sh
- Starts both frontend and backend with hot reloading and auto-client generation./fix.sh
- Formats Python (ruff) and TypeScript (prettier) code
./deploy.sh
- Builds, syncs, and deploys to Databricks Apps--create
- Creates app if it doesn't exist--verbose
- Shows detailed deployment logs
./app_status.sh
- Shows app status with nice formatting--verbose
- Includes full JSON response and workspace files
./run_app_local.sh
- Runs app locally with debug mode for troubleshooting deployment issuesscripts/make_fastapi_client.py
- Generates TypeScript client from OpenAPI specscripts/generate_semver_requirements.py
- Creates requirements.txt from pyproject.toml
- FastAPI - Modern Python web framework
- uv - Ultra-fast Python package management
- Databricks SDK - Workspace integration and API access
- Databricks Connect - Local development with remote compute
- MLflow[databricks] - Experiment tracking, model management, and AI agents
- Automatic OpenAPI - Generated documentation
- React 18 - Modern React with TypeScript
- Vite - Lightning-fast build tool
- shadcn/ui - Beautiful, accessible components
- Tailwind CSS - Utility-first styling
- React Query - Server state management
- bun - Fast package manager
- Hot Reloading - Instant feedback loop
- Type Safety - Full TypeScript coverage
- Code Quality - ruff (Python) + prettier (TypeScript)
- Background Processes - nohup with comprehensive logging
The setup script creates .env.local
with your configuration:
# Authentication Type
DATABRICKS_AUTH_TYPE=pat # or "databricks-cli"
# For PAT Authentication
DATABRICKS_HOST=https://your-workspace.cloud.databricks.com
DATABRICKS_TOKEN=your-personal-access-token
# For Profile Authentication
DATABRICKS_CONFIG_PROFILE=your-profile-name
# App Configuration
DATABRICKS_APP_NAME=your-app-name
DBA_SOURCE_CODE_PATH=/Workspace/Users/you@company.com/your-app-name
- Pros: Simple setup, works everywhere
- Cons: Token needs periodic renewal
- Setup: Generate PAT in Databricks workspace β User Settings β Access Tokens
- Pros: More secure, supports OAuth
- Cons: Requires CLI configuration
- Setup: Run
databricks auth login --host <workspace-url> --profile <profile-name>
The setup script automatically validates your configuration and tests connectivity.
# Deploy existing app
./deploy.sh
# Create and deploy new app
./deploy.sh --create
# Deploy with verbose logging
./deploy.sh --verbose
The deployment script automatically:
- Authenticates with Databricks using your
.env.local
configuration - Creates app (if using
--create
flag and app doesn't exist) - Builds frontend using Vite for production
- Generates requirements.txt from pyproject.toml (avoids editable installs)
- Syncs source code to Databricks workspace
- Deploys app via Databricks CLI
- Verifies deployment and shows app URL
./app_status.sh # Basic status with nice formatting
./app_status.sh --verbose # Includes full JSON + workspace files
- Visit your app URL +
/logz
in browser (requires OAuth authentication) - Example:
https://your-app-url.databricksapps.com/logz
- Cannot be accessed via curl - browser authentication required
./run_app_local.sh # Test app locally first
./run_app_local.sh --verbose # Detailed local debugging
Common Issues:
- Import errors: Run
./run_app_local.sh
to test locally first - Missing files: Check with
./app_status.sh --verbose
- Authentication: Verify
.env.local
configuration - CLI outdated: Since we use
databricks
, the CLI is always up-to-date
- Update branding in
client/src/pages/WelcomePage.tsx
- Add new API endpoints in
server/routers/
- Create UI components in
client/src/components/
- Modify authentication in
scripts/setup.sh
# View logs
tail -f /tmp/databricks-app-watch.log
# Check running processes
ps aux | grep databricks-app
# Check PID file
cat /tmp/databricks-app-watch.pid
# Stop servers
kill $(cat /tmp/databricks-app-watch.pid) || pkill -f watch.sh
# Start servers
nohup ./watch.sh > /tmp/databricks-app-watch.log 2>&1 &
# Kill processes using ports 5173/8000
pkill -f "uvicorn server.app:app"
pkill -f "vite"
# Regenerate TypeScript client
uv run python scripts/make_fastapi_client.py
# Check if utils.ts exists in correct location
ls -la src/lib/utils.ts
ls -la client/src/lib/utils.ts
# Copy if missing
cp client/src/lib/utils.ts src/lib/utils.ts
# Test authentication (works for both PAT and profile)
source .env.local && export DATABRICKS_HOST && export DATABRICKS_TOKEN && databricks current-user me
# Reconfigure if needed
./setup.sh
# Check app status
./app_status.sh
# Get detailed information
./app_status.sh --verbose
# Check workspace files
source .env.local && export DATABRICKS_HOST && export DATABRICKS_TOKEN && databricks workspace list "$DBA_SOURCE_CODE_PATH"
# Test locally to catch issues
./run_app_local.sh
# Debug mode
./run_app_local.sh --verbose
- API Documentation: http://localhost:8000/docs
- OpenAPI Spec: http://localhost:8000/openapi.json
- Health Check: http://localhost:8000/health
- Development Server: http://localhost:5173
- Network Tab: Check browser dev tools for API calls
- React Query DevTools: Available in development mode
- Development:
/tmp/databricks-app-watch.log
- Local App Test:
/tmp/local-app-test.log
- Deployment: Visit app URL +
/logz
in browser
# Nuclear option - reset everything
pkill -f watch.sh
rm -f /tmp/databricks-app-watch.pid
rm -f /tmp/databricks-app-watch.log
./setup.sh
- Security Policy: See SECURITY.md for reporting vulnerabilities
- Authentication: Uses Databricks SDK with proper credential management
- Environment Variables: Stored in
.env.local
(excluded from version control) - Best Practices: Follow secure coding practices in all contributions
- License: Custom Databricks license - see LICENSE.md
- Code Ownership: See CODEOWNERS.txt for maintainer information
- Notice: See NOTICE.md for third-party notices
- Data Handling: App runs in your Databricks workspace with your data governance
- Credentials: Stored locally, never transmitted except to Databricks
- Logging: Development logs stored locally in
/tmp/
directory
- Fork the repository
- Create a feature branch
- Make your changes
- Run
./fix.sh
to format code - Submit a pull request
Ready to build something amazing? π
Start with ./setup.sh
and let this template accelerate your Databricks app development!