How databricks/app-templates works
Project type and purpose
• This is an open-source monorepo of “app templates” (README just says “app-templates”).
• It contains dozens of lightweight starter projects (Python Flask, Dash, Streamlit, Gradio, Shiny) plus a more advanced Next.js “e2e-chatbot-app-next” sample with Databricks integration, database migrations, and end-to-end tests.
• Use-cases: provide boilerplates for different web-framework stacks and a showcase reference implementation of a chat UI + backend + data persistence + external AI provider.
File structure
• Top-level directories:
· dash-*, flask-*, gradio-*, shiny-*, streamlit-*: each folder is a standalone template.
· e2e-chatbot-app-next: a full-stack Next.js 13 App Router project.
· mcp-server-hello-world, nodejs-fastapi-hello-world-app: additional examples.
• Patterns:
· Each Python template has app.py (entry), requirements.txt, app.yaml (deployment config).
· The Next.js sample has “app/” (App Router pages & API routes), “components/”, “databricks/” (auth, db, providers), “lib/”, “scripts/”, “tests/”.
• CI/config:
· e2e sample has .github/workflows, playwright.config.ts, drizzle.config.ts, databricks.yml.
Diagramming main components and relationships
a. Monorepo overview
• Monorepo root
→ Python templates (each isolated)
→ Node.js/Next.js template
→ Shared docs, LICENSE, NOTICE
b. Drill into “e2e-chatbot-app-next”
• Frontend (Next.js App Router):
• UI pages, components, global layout
• API routes (app/(chat)/api/*):
• chat streaming, history, session endpoints
• Databricks integration (databricks/):
• Auth module → Chat transport utility → Language model providers
• Database (drizzle.config.ts + databricks/db/):
• Connection & migrations → query layer → Postgres
• Testing & CI:
• Playwright E2E tests → API mocking server → GitHub Actions workflows
• Scripts: deployment, reset database, generate OAuth tokens
c. Relationships
• Frontend calls API routes
• API routes orchestrate Databricks calls and DB queries
• Tests simulate front-end and API interactions
• CI pipeline triggers linting, tests, deploy scripts
Architectural patterns & design principles
• Template isolation: each folder is a self-contained app
• For Next.js: App Router (React server/client components), layered service modules (auth, providers, db)
• Clear separation: UI vs API vs data vs external AI services vs tests