Skip to content

Repository files navigation

FastBI

FastBI is an open-source business-intelligence tool built with FastHTML — a server-side, HTMX-driven port of the core of Frappe Insights. Python-first, no JavaScript framework: a synthetic data warehouse, saved queries that render Plotly charts, dashboards, a SQL lab, and an AI text-to-SQL assistant.

Live at fastbi.org.

Ask your data anything. Runs on port 5008.

Synthetic data only. Everything runs on a deterministic, fully synthetic retail sales warehouse generated by seed.py.

Demo

FastBI walkthrough

Captured views: desktop landing, mobile landing, and integrations and migrations.

Quickstart (native)

python -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
cp .env.sample .env          # add an LLM key to enable AI text-to-SQL
.venv/bin/python web_app.py  # http://localhost:5008  (self-seeds on first boot)

Set FASTBI_ADMIN_EMAIL and FASTBI_ADMIN_PASSWORD in the ignored .env for local password sign-in, or configure Google SSO. Rebuild the warehouse with .venv/bin/python seed.py.

Run with Docker

docker compose up --build      # http://localhost:5008

Dockerfile (python:3.12-slim, port 5008) seeds on first boot; docker-compose.yml mounts a fastbi-data volume at /data.

Module tour

  • Home (/) — KPI cards (revenue, margin, AOV, customers) + two flagship Plotly charts + dashboard links.
  • Dashboards (/dashboards) — curated boards of charts in a responsive grid.
  • Queries & Charts (/queries) — saved SQL queries, each bound to a chart type; open one for the chart, the SQL, and the result table.
  • SQL Lab + Ask AI (/sql) — run read-only SQL against the warehouse, or describe what you want in plain English and the AI writes the SQL, runs it, and charts the result. The schema is shown alongside.
  • Data Source (/sources) — browse the warehouse tables with row counts and samples.
  • Integrations (/integrations) — pull a bounded public schema or catalogue endpoint for Microsoft Fabric/OneLake, BigQuery, Redshift, Snowflake, Databricks, or a major SQL database.
  • Migrations (/migrations) — upload Power BI, Tableau, Looker, report definition, PDF, or screenshot artefacts and generate an editable dashboard grounded in a selected schema. With XAI_API_KEY configured, PNG/JPEG report screenshots are interpreted by the multimodal model before generation.
  • AI Assistant (right rail) — metric Q&A grounded in a live data summary; slash-commands /metrics /tables /top work with no API key.

AI text-to-SQL (the showcase)

The SQL Lab's Ask the data box sends your question plus the live warehouse schema to the configured LLM, which returns a single SQL query. That query is run through db.run_sql() — which enforces a single read-only SELECT (no INSERT/UPDATE/DELETE/DDL, single statement) — and the result is rendered as a chart and table. The model never touches the database directly.

MODEL_PROVIDER=xai          # xai | openai | anthropic | google
MODEL_NAME=grok-4.5
XAI_API_KEY=...

Without a key, dashboards, saved queries, the SQL lab, and slash-commands all still work — only AI generation is disabled.

Architecture

web_app.py        routes, auth, SQL-run + AI-SQL endpoints, SSE chat, boot
db.py             warehouse + app schema, read-only run_sql() guard
seed.py           synthetic retail star schema + saved queries/charts/dashboards
web/charts.py     Plotly chart + result-table rendering
web/layout.py     3-pane shell, CSS, chat JS
web/views.py      page renderers
web/integrations.py  schema import and report migration workflows
web/ai.py         grounded chat, slash-commands, text_to_sql()

See SKILLS.md for the capability reference + migration playbook, and docs/ROADMAP.md for the comparison vs Frappe Insights.

Licence

MIT. Part of the fasthtml-oss-migrations initiative.

About

FastHTML/HTMX port of Frappe Insights — BI tool with Plotly charts and AI text-to-SQL

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages