# anupkalburgi/db-connect-webapp architecture

> Architecture diagram of the GitHub repository anupkalburgi/db-connect-webapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anupkalburgi/db-connect-webapp
- Repository: https://github.com/anupkalburgi/db-connect-webapp

## Overview

DB Connect WebApp is a Databricks-backed data exploration application. A user loads available tables, selects one to inspect its columns, configures filters and aggregations, executes a query, and views the returned rows. The frontend coordinates these stages through its explorer and server actions; its API client calls FastAPI endpoints, which build SQL and execute it through a Databricks Connect session. The README also documents standalone and integrated deployment modes. Source excerpts establish the main query path; server-action internals were not sampled, so their downstream wiring is not asserted.

Main entry points: [`frontend/components/data-explorer.tsx`](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/data-explorer.tsx) (Data explorer), [`frontend/app/page.tsx`](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/app/page.tsx) (Explorer page), [`backend/app/main.py`](https://github.com/anupkalburgi/db-connect-webapp/blob/main/backend/app/main.py) (FastAPI endpoints), [`frontend/components/analysis-panel.tsx`](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/analysis-panel.tsx) (Analysis panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_page["Explorer page<br/>[page.tsx]"]
  node_explorer["Data explorer<br/>[data-explorer.tsx]"]
  node_panel["Analysis panel<br/>[analysis-panel.tsx]"]
  node_header["Explorer header"]
  node_skeleton["Loading table<br/>[skeleton-table.tsx]"]
  node_results["Results table<br/>[results-table.tsx]"]
  node_actions["Server actions<br/>[actions.ts]"]
end

subgraph group_api["API and query"]
  node_client["API client<br/>[api.ts]"]
  node_fastapi["FastAPI endpoints<br/>[main.py]"]
  node_builder["SQL query builder<br/>[main.py]"]
end

subgraph group_compute["Databricks compute"]
  node_source["Data source<br/>[DataSource.py]"]
  node_databricks[("Databricks")]
end

node_analyst(("Analyst"))

node_analyst -->|"uses"| node_page
node_page -->|"loads tables"| node_client
node_page -->|"renders"| node_explorer
node_explorer -->|"renders"| node_header
node_explorer -->|"renders"| node_panel
node_explorer -->|"renders while loading"| node_skeleton
node_explorer -->|"renders results"| node_results
node_panel -->|"updates query config"| node_explorer
node_explorer -->|"requests columns and queries"| node_actions
node_client -->|"calls REST endpoints"| node_fastapi
node_fastapi -->|"builds query SQL"| node_builder
node_fastapi -->|"executes SQL"| node_source
node_source -->|"connects session"| node_databricks

click node_page "https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/app/page.tsx"
click node_explorer "https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/data-explorer.tsx"
click node_panel "https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/analysis-panel.tsx"
click node_header "https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/explorer-header.tsx"
click node_skeleton "https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/skeleton-table.tsx"
click node_results "https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/results-table.tsx"
click node_actions "https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/app/actions.ts"
click node_client "https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/lib/api.ts"
click node_fastapi "https://github.com/anupkalburgi/db-connect-webapp/blob/main/backend/app/main.py"
click node_builder "https://github.com/anupkalburgi/db-connect-webapp/blob/main/backend/app/main.py"
click node_source "https://github.com/anupkalburgi/db-connect-webapp/blob/main/backend/app/DataSource.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_page,node_explorer,node_panel,node_header,node_skeleton,node_results,node_actions toneBlue
class node_client,node_fastapi,node_builder toneAmber
class node_source,node_databricks toneMint
class node_analyst toneIndigo
```

## Components

### Frontend experience

- [Explorer page](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Data explorer](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/data-explorer.tsx): `frontend/components/data-explorer.tsx`
- [Analysis panel](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/analysis-panel.tsx): `frontend/components/analysis-panel.tsx`
- [Explorer header](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/explorer-header.tsx): `frontend/components/explorer-header.tsx`
- [Loading table](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/skeleton-table.tsx): `frontend/components/skeleton-table.tsx`
- [Results table](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/components/results-table.tsx): `frontend/components/results-table.tsx`
- [Server actions](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/app/actions.ts): `frontend/app/actions.ts`

### API and query

- [API client](https://github.com/anupkalburgi/db-connect-webapp/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [FastAPI endpoints](https://github.com/anupkalburgi/db-connect-webapp/blob/main/backend/app/main.py): `backend/app/main.py`
- [SQL query builder](https://github.com/anupkalburgi/db-connect-webapp/blob/main/backend/app/main.py): `backend/app/main.py`

### Databricks compute

- [Data source](https://github.com/anupkalburgi/db-connect-webapp/blob/main/backend/app/DataSource.py): `backend/app/DataSource.py`
- **Databricks**

### Other components

- **Analyst**

## Connections

- Analyst → Explorer page: uses (evidence: `Readme.md`)
- Explorer page → API client: loads tables (evidence: `frontend/app/page.tsx`)
- Explorer page → Data explorer: renders (evidence: `frontend/app/page.tsx`)
- Data explorer → Explorer header: renders (evidence: `frontend/components/data-explorer.tsx`)
- Data explorer → Analysis panel: renders (evidence: `frontend/components/data-explorer.tsx`)
- Data explorer → Loading table: renders while loading (evidence: `frontend/components/data-explorer.tsx`)
- Data explorer → Results table: renders results (evidence: `frontend/components/data-explorer.tsx`)
- Analysis panel → Data explorer: updates query config (evidence: `frontend/components/data-explorer.tsx`)
- Data explorer → Server actions: requests columns and queries (evidence: `frontend/components/data-explorer.tsx`)
- API client → FastAPI endpoints: calls REST endpoints (evidence: `frontend/lib/api.ts`)
- FastAPI endpoints → SQL query builder: builds query SQL (evidence: `backend/app/main.py`)
- FastAPI endpoints → Data source: executes SQL (evidence: `backend/app/main.py`)
- Data source → Databricks: connects session (evidence: `backend/app/DataSource.py`)
