DuckBT is a lightweight, serverless SQL development environment designed for analytics engineers. It brings the power of dbt (data build tool) modeling syntax directly to your browser using DuckDB-WASM.
DuckBTは、アナリティクスエンジニア向けの軽量でサーバーレスなSQL開発環境です。dbt (data build tool) のモデリング構文を、DuckDB-WASMを使ってブラウザ上で直接利用できます。
No python venv, no cloud warehouse credentials, no latency. Just you, your SQL, and a duck. 🦆
Python仮想環境も、クラウドDWの認証情報も、レイテンシも不要。あなたとSQLと、一羽のアヒルだけ。🦆
- Serverless & Local: Powered by DuckDB-WASM. All data processing happens locally in your browser.
- dbt-flavored SQL: Supports Jinja templating like
{{ ref() }}and{{ source() }}. - Instant Feedback: Compile and run models instantly without round-trips to a cloud DW.
- Data Persistence: Saves your code and data load configuration to LocalStorage.
- CSV Loading: Load CSV data from external URLs (with CORS proxy support).
- Cute Companion: Includes a wandering duck and legendary quotes to keep you motivated.
DuckBT is built with modern web technologies and a modular architecture:
- Core Engine: DuckDB-WASM (v1.29.0)
- Compiler: Mozilla Nunjucks (Jinja2-compatible templating)
- Editor: CodeJar + Prism.js (Syntax highlighting)
- Config Parser: js-yaml
duckbt/
├── src/
│ ├── main.js # Entry point & UI logic
│ ├── db.js # DuckDB-WASM wrapper
│ ├── editor.js # Editor component
│ └── dbt-core.js # Compiler & DAG logic (Pure functions)
├── tests/ # Unit tests (Vitest)
├── index.html # Main application
├── style.css # Styling
├── server.py # Local dev server with COOP/COEP headers
└── coi-serviceworker.js # Cross-Origin Isolation handler
Since DuckDB-WASM requires Cross-Origin Isolation (COOP/COEP headers) to use high-performance features, you cannot simply open index.html file directly.
- Python 3.x (for local server)
- Node.js & npm (optional, for running tests)
- Clone the repository
git clone https://github.com/takimo/duckbt.git
cd duckbt- Start the local server
We provide a Python script that sets the necessary security headers.
python server.py- Open in Browser
Visit http://localhost:8000
Logic components (like the compiler and table name generators) are tested using Vitest.
# Install dependencies
npm install
# Run tests
npm testThis project uses coi-serviceworker.js to enable Cross-Origin Isolation on GitHub Pages without server-side header configuration.
- Push to GitHub.
- Go to Settings > Pages.
- Set Source to GitHub Actions or Deploy from a branch (main).
- Your IDE is live! 🎉
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
- DuckDB - For the amazing in-process SQL OLAP database.
- dbt Labs - For the inspiration on data modeling workflows.
- Voluntas - For OPFS implementation references.
Made with ❤️ and 🦆 by takimo
