databricks-app-apx
Original:🇺🇸 English
Translated
Build full-stack Databricks applications using APX framework (FastAPI + React).
11installs
Added on
NPX Install
npx skill4agent add databricks-solutions/ai-dev-kit databricks-app-apxTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Databricks APX Application
Build full-stack Databricks applications using APX framework (FastAPI + React).
Trigger Conditions
Invoke when user requests:
- "Databricks app" or "Databricks application"
- Full-stack app for Databricks without specifying framework
- Mentions APX framework
Do NOT invoke if user specifies: Streamlit, Dash, Node.js, Shiny, Gradio, Flask, or other frameworks.
Prerequisites Check
Option A)
Repository configured for use with APX.
1.. Verify APX MCP available:
2. Verify shadcn MCP available:
3. Confirm APX project (check )
mcp-cli tools | grep apxmcp-cli tools | grep shadcnpyproject.tomlOption B)
Install APX
- Verify uv available or prompt for install. On Mac, suggest: .
brew install uv - Verify bun available or prompt for install. On Mac, suggest:
brew tap oven-sh/bun
brew install bun- Verify git available or prompt for install.
- Run APX setup commands:
uvx --from git+https://github.com/databricks-solutions/apx.git apx initWorkflow Overview
Total time: 55-70 minutes
- Initialize (5 min) - Start servers, create todos
- Backend (15-20 min) - Models + routes with mock data
- Frontend (20-25 min) - Components + pages
- Test (5-10 min) - Type check + manual verification
- Document (10 min) - README + code structure guide
Phase 1: Initialize
bash
# Start APX development server
mcp-cli call apx/start '{}'
mcp-cli call apx/status '{}'Create TodoWrite with tasks:
- Start servers ✓
- Design models
- Create API routes
- Add UI components
- Create pages
- Test & document
Phase 2: Backend Development
Create Pydantic Models
In :
src/{app_name}/backend/models.pyFollow 3-model pattern:
- - Input validation
EntityIn - - Complete output with computed fields
EntityOut - - Performance-optimized summary
EntityListOut
See backend-patterns.md for complete code templates.
Create API Routes
In :
src/{app_name}/backend/router.pyCritical requirements:
- Always include (enables OpenAPI generation)
response_model - Always include (becomes frontend hook name)
operation_id - Use naming pattern: ,
listX,getX,createX,updateXdeleteX - Initialize 3-4 mock data samples for testing
See backend-patterns.md for complete CRUD templates.
Type Check
bash
mcp-cli call apx/dev_check '{}'Fix any Python type errors reported by basedpyright.
Phase 3: Frontend Development
Wait 5-10 seconds after backend changes for OpenAPI client regeneration.
Add UI Components
bash
# Get shadcn add command
mcp-cli call shadcn/get_add_command_for_items '{
"items": ["@shadcn/button", "@shadcn/card", "@shadcn/table",
"@shadcn/badge", "@shadcn/select", "@shadcn/skeleton"]
}'Run the command from project root with flag.
--yesCreate Pages
List page:
src/{app_name}/ui/routes/_sidebar/{entity}.tsx- Table view with all entities
- Suspense boundaries with skeleton fallback
- Formatted data (currency, dates, status colors)
Detail page:
src/{app_name}/ui/routes/_sidebar/{entity}.$id.tsx- Complete entity view with cards
- Update/delete mutations
- Back navigation
See frontend-patterns.md for complete page templates.
Update Navigation
In , add new item to array.
src/{app_name}/ui/routes/_sidebar/route.tsxnavItemsPhase 4: Testing
bash
# Type check both backend and frontend
mcp-cli call apx/dev_check '{}'
# Test API endpoints
curl http://localhost:8000/api/{entities} | jq .
curl http://localhost:8000/api/{entities}/{id} | jq .
# Get frontend URL
mcp-cli call apx/get_frontend_url '{}'Manually verify in browser:
- List page displays data
- Detail page shows complete info
- Mutations work (update, delete)
- Loading states work (skeletons)
- Browser console errors are automatically captured in APX dev logs
Phase 5: Deployment & Monitoring
Deploy to Databricks
Use DABs to deploy your APX application to Databricks. See the skill for complete deployment guidance.
asset-bundlesMonitor Application Logs
Automated log checking with APX MCP:
The APX MCP server can automatically check deployed application logs. Simply ask:
"Please check the deployed app logs for <app-name>"
The APX MCP will retrieve logs and identify issues automatically, including:
- Deployment status and errors
- Runtime exceptions and stack traces
- Both (deployment) and
[SYSTEM](application) logs[APP] - Browser console errors (now included in APX dev logs)
Manual log checking (reference):
For direct CLI access:
bash
databricks apps logs <app-name> --profile <profile-name>Key patterns to look for:
- ✅ - App deployed correctly
Deployment successful - ✅ - Application is running
App started successfully - ❌ - Check stack traces for issues
Error:
Phase 6: Documentation
Create two markdown files:
README.md:
- Features overview
- Technology stack
- How app was created (AI tools + MCP servers used)
- Application architecture
- Getting started instructions
- API documentation
- Development workflow
CODE_STRUCTURE.md:
- Directory structure explanation
- Backend structure (models, routes, patterns)
- Frontend structure (routes, components, hooks)
- Auto-generated files warnings
- Guide for adding new features
- Best practices
- Common patterns
- Troubleshooting guide
Key Patterns
Backend
- 3-model pattern: Separate In, Out, and ListOut models
- operation_id naming: →
listEntitiesuseListEntities() - Type hints everywhere: Enable validation and IDE support
Frontend
- Suspense hooks:
useXSuspense(selector()) - Suspense boundaries: Always provide skeleton fallback
- Formatters: Currency, dates, status colors
- Never edit: or
lib/api.tstypes/routeTree.gen.ts
Success Criteria
- Type checking passes (succeeds)
apx dev check - API endpoints return correct data (curl verification)
- Frontend displays and mutates data correctly
- Loading states work (skeletons display)
- Documentation complete
Common Issues
Deployed app not working: Ask to check deployed app logs (APX MCP will automatically retrieve and analyze them) or manually use
Python type errors: Use explicit casting for dict access, check Optional fields
TypeScript errors: Wait for OpenAPI regen, verify hook names match operation_ids
OpenAPI not updating: Check watcher status with , restart if needed
Components not added: Run shadcn from project root with flag
databricks apps logs <app-name>apx dev status--yesReference Materials
- backend-patterns.md - Complete backend code templates
- frontend-patterns.md - Complete frontend page templates
- best-practices.md - Best practices, anti-patterns, debugging
Read these files only when actively writing that type of code or debugging issues.