How it works

The pieces

PieceWhereWhat it does
A reportapp/src/reports/<id>/report.tsxThe page: its name, its named queries, the blocks, the "(i)" dialog. The folder name is the address, /reports/<id>.
Its SQL.sql files beside itOne query each
A connectorapp/src/connectors/<id>/Reaches one kind of database; its keys are in app/.env
The report-kitapp/src/components/report-kit/Draws the blocks and checks the files

Adding a folder with a report.tsx adds a report to the list. Nothing else needs changing.

How a page is served

  1. The file is checked before it runs. Every block, prop, query and column it names must be one the kit and its queries know; the check names the file and line of an error.
  2. Every query runs once, over a wide window. Each query runs over the last 24 months up to today: $from and $to in the SQL are bound to that window, not to the dates you pick. The result is cached for ten minutes.
  3. The rows are sliced to your dates. Each query's grain says how: with week, each row's week column ("2026-W14") is kept when it falls in the range; with month, its month column ("2026-03"); with all (the default) nothing is sliced. Changing the dates re-slices the cached rows, so it is instant and runs no query.
  4. The page draws the blocks. Each block reads one result by its name (its series) and the columns it names.

So a report that should follow the date filter returns a week or month column and sets grain. One whose queries are all "all" shows the same rows whatever the dates; filterBar: false hides the date filter for such a report.

The checks

CheckWhenWhat it catches
The lint checkAfter every change Claude makesFiles that are not allowed in a report folder, a .sql file without its title line, and every series, column and prop a block names that its queries do not return
The pageWhen you open the reportA query that fails on your database shows its error

Claude runs these for you. What each part of a report accepts is in Components.

In this section

PageRead it to
ConnectorsSee how the app reaches your database