# gropaul/dash architecture

> Architecture diagram of the GitHub repository gropaul/dash, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gropaul/dash
- Repository: https://github.com/gropaul/dash

## Overview

Dash is a DuckDB extension that serves a local browser-based SQL workbench. The main documented flow is to start the server from DuckDB, send a query from the browser, execute it against DuckDB, and return serialized results. The extension also serves its embedded UI, supports file uploads and writes, and offers SQL table functions and serialization pragmas. Source excerpts establish the main registrations and request handling; some server handlers and UI assets were not sampled, so those links are limited to documented or indexed evidence.

Main entry points: [`src/include/http_server.hpp`](https://github.com/gropaul/dash/blob/main/src/include/http_server.hpp) (HTTP Server), [`src/include/execution_request.hpp`](https://github.com/gropaul/dash/blob/main/src/include/execution_request.hpp) (Query Execution), [`src/dash_extension.cpp`](https://github.com/gropaul/dash/blob/main/src/dash_extension.cpp) (Dash Extension), [`src/include/table_functions.hpp`](https://github.com/gropaul/dash/blob/main/src/include/table_functions.hpp) (Server Functions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extension["DuckDB Extension"]
  node_extension["Dash Extension<br/>[dash_extension.cpp]"]
  node_table_functions["Server Functions"]
  node_bind_data["Function Bind Data"]
  node_setup["Database Setup<br/>[setup.hpp]"]
end

subgraph group_http["HTTP Workbench"]
  node_http_server["HTTP Server<br/>[http_server.hpp]"]
  node_http_client["HTTP Client Function"]
  node_ui_assets["Embedded UI Assets"]
  node_file_lookup["UI File Lookup<br/>[files.hpp]"]
end

subgraph group_query["Query and Serialization"]
  node_query_function["Query Function"]
  node_execution["Query Execution"]
  node_formats["Result Formats"]
end

subgraph group_support["Files and Utilities"]
  node_write_file["File Write Handler"]
  node_temporary_files["Temporary Files<br/>[temp_file.hpp]"]
  node_auto_cleaner["Resource Cleanup<br/>[auto_cleaner.hpp]"]
  node_uri["URI Parsing<br/>[uri.hpp]"]
  node_result_errors["HTTP Results<br/>[result.hpp]"]
  node_error_data["HTTP Errors"]
end

node_duckdb_user(("DuckDB User"))
node_browser(("Browser User"))
node_duckdb[("DuckDB")]

node_duckdb_user -->|"loads extension"| node_extension
node_extension -->|"attaches database"| node_setup
node_extension -->|"registers functions"| node_table_functions
node_extension -->|"registers query"| node_query_function
node_duckdb_user -->|"starts server"| node_table_functions
node_table_functions -->|"starts or stops"| node_http_server
node_browser -->|"sends requests"| node_http_server
node_http_server -->|"executes query"| node_execution
node_execution -->|"runs SQL"| node_duckdb
node_execution -->|"parses format"| node_formats
node_http_server -->|"serves UI files"| node_file_lookup
node_file_lookup -->|"looks up embedded files"| node_ui_assets
node_http_server -->|"handles file writes"| node_write_file
node_http_server -->|"uses request state"| node_bind_data
node_http_client -->|"sends HTTP requests"| node_http_server
node_query_function -->|"executes query"| node_duckdb
node_execution -->|"loads temporary files"| node_temporary_files
node_execution -->|"cleans resources"| node_auto_cleaner
node_http_server -->|"parses proxy URI"| node_uri
node_write_file -->|"returns result"| node_result_errors
node_result_errors -->|"stores HTTP errors"| node_error_data
node_table_functions -->|"binds parameters"| node_bind_data
node_http_server -->|"serves workbench"| node_browser

click node_extension "https://github.com/gropaul/dash/blob/main/src/dash_extension.cpp"
click node_table_functions "https://github.com/gropaul/dash/blob/main/src/include/table_functions.hpp"
click node_query_function "https://github.com/gropaul/dash/blob/main/src/include/query_result_table_function.hpp"
click node_http_server "https://github.com/gropaul/dash/blob/main/src/include/http_server.hpp"
click node_execution "https://github.com/gropaul/dash/blob/main/src/include/execution_request.hpp"
click node_formats "https://github.com/gropaul/dash/blob/main/src/include/response_format.hpp"
click node_http_client "https://github.com/gropaul/dash/blob/main/src/include/http_request_table_function.hpp"
click node_write_file "https://github.com/gropaul/dash/blob/main/src/include/write_file_request.hpp"
click node_ui_assets "https://github.com/gropaul/dash/blob/main/src/gen/file_next_static_chunks_134_af427c7a8b7f6921_js.hpp"
click node_file_lookup "https://github.com/gropaul/dash/blob/main/src/include/files.hpp"
click node_temporary_files "https://github.com/gropaul/dash/blob/main/src/include/temp_file.hpp"
click node_auto_cleaner "https://github.com/gropaul/dash/blob/main/src/include/auto_cleaner.hpp"
click node_uri "https://github.com/gropaul/dash/blob/main/src/include/uri.hpp"
click node_result_errors "https://github.com/gropaul/dash/blob/main/src/include/result.hpp"
click node_error_data "https://github.com/gropaul/dash/blob/main/src/include/http_error_data.hpp"
click node_bind_data "https://github.com/gropaul/dash/blob/main/src/include/table_functions_bind_data.hpp"
click node_setup "https://github.com/gropaul/dash/blob/main/src/include/setup.hpp"

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_extension,node_table_functions,node_bind_data,node_setup,node_duckdb_user,node_browser toneBlue
class node_http_server,node_http_client,node_ui_assets,node_file_lookup,node_duckdb toneAmber
class node_query_function,node_execution,node_formats toneMint
class node_write_file,node_temporary_files,node_auto_cleaner,node_uri,node_result_errors,node_error_data toneRose
```

## Components

### DuckDB Extension

- [Dash Extension](https://github.com/gropaul/dash/blob/main/src/dash_extension.cpp): `src/dash_extension.cpp`
- [Server Functions](https://github.com/gropaul/dash/blob/main/src/include/table_functions.hpp): `src/include/table_functions.hpp`
- [Function Bind Data](https://github.com/gropaul/dash/blob/main/src/include/table_functions_bind_data.hpp): `src/include/table_functions_bind_data.hpp`
- [Database Setup](https://github.com/gropaul/dash/blob/main/src/include/setup.hpp): `src/include/setup.hpp`

### HTTP Workbench

- [HTTP Server](https://github.com/gropaul/dash/blob/main/src/include/http_server.hpp): `src/include/http_server.hpp`
- [HTTP Client Function](https://github.com/gropaul/dash/blob/main/src/include/http_request_table_function.hpp): `src/include/http_request_table_function.hpp`
- [Embedded UI Assets](https://github.com/gropaul/dash/blob/main/src/gen/file_next_static_chunks_134_af427c7a8b7f6921_js.hpp): `src/gen/file_next_static_chunks_134_af427c7a8b7f6921_js.hpp`
- [UI File Lookup](https://github.com/gropaul/dash/blob/main/src/include/files.hpp): `src/include/files.hpp`

### Query and Serialization

- [Query Function](https://github.com/gropaul/dash/blob/main/src/include/query_result_table_function.hpp): `src/include/query_result_table_function.hpp`
- [Query Execution](https://github.com/gropaul/dash/blob/main/src/include/execution_request.hpp): `src/include/execution_request.hpp`
- [Result Formats](https://github.com/gropaul/dash/blob/main/src/include/response_format.hpp): `src/include/response_format.hpp`

### Files and Utilities

- [File Write Handler](https://github.com/gropaul/dash/blob/main/src/include/write_file_request.hpp): `src/include/write_file_request.hpp`
- [Temporary Files](https://github.com/gropaul/dash/blob/main/src/include/temp_file.hpp): `src/include/temp_file.hpp`
- [Resource Cleanup](https://github.com/gropaul/dash/blob/main/src/include/auto_cleaner.hpp): `src/include/auto_cleaner.hpp`
- [URI Parsing](https://github.com/gropaul/dash/blob/main/src/include/uri.hpp): `src/include/uri.hpp`
- [HTTP Results](https://github.com/gropaul/dash/blob/main/src/include/result.hpp): `src/include/result.hpp`
- [HTTP Errors](https://github.com/gropaul/dash/blob/main/src/include/http_error_data.hpp): `src/include/http_error_data.hpp`

### Other components

- **DuckDB User**
- **Browser User**
- **DuckDB**

## Connections

- DuckDB User → Dash Extension: loads extension (evidence: `README.md`)
- Dash Extension → Database Setup: attaches database (evidence: `src/dash_extension.cpp`)
- Dash Extension → Server Functions: registers functions (evidence: `src/dash_extension.cpp`)
- Dash Extension → Query Function: registers query (evidence: `src/dash_extension.cpp`)
- DuckDB User → Server Functions: starts server (evidence: `README.md`)
- Server Functions → HTTP Server: starts or stops (evidence: `src/include/table_functions.hpp`)
- Browser User → HTTP Server: sends requests (evidence: `README.md`)
- HTTP Server → Query Execution: executes query (evidence: `src/include/http_server.hpp`)
- Query Execution → DuckDB: runs SQL (evidence: `src/include/execution_request.hpp`)
- Query Execution → Result Formats: parses format (evidence: `src/include/execution_request.hpp`)
- HTTP Server → UI File Lookup: serves UI files (evidence: `src/include/http_server.hpp`)
- UI File Lookup → Embedded UI Assets: looks up embedded files (evidence: `src/gen/file_next_static_chunks_134_af427c7a8b7f6921_js.hpp`)
- HTTP Server → File Write Handler: handles file writes (evidence: `src/include/http_server.hpp`)
- HTTP Server → Function Bind Data: uses request state (evidence: `src/include/http_server.hpp`)
- HTTP Client Function → HTTP Server: sends HTTP requests (evidence: `src/include/http_request_table_function.hpp`)
- Query Function → DuckDB: executes query (evidence: `src/include/query_result_table_function.hpp`)
- Query Execution → Temporary Files: loads temporary files (evidence: `src/include/execution_request.hpp`)
- Query Execution → Resource Cleanup: cleans resources (evidence: `src/include/execution_request.hpp`)
- HTTP Server → URI Parsing: parses proxy URI (evidence: `src/include/http_server.hpp`)
- File Write Handler → HTTP Results: returns result (evidence: `src/include/write_file_request.hpp`)
- HTTP Results → HTTP Errors: stores HTTP errors (evidence: `src/include/result.hpp`)
- Server Functions → Function Bind Data: binds parameters (evidence: `src/include/table_functions.hpp`)
- HTTP Server → Browser User: serves workbench (evidence: `README.md`)
