published fresh until

Next.js and Supabase: how do I build an expense table with filters?

Summary When users need to filter, sort, page through, and export their own Supabase expenses, combine row-level access controls with a responsive table. CSV export has no tested answer yet.

Not for roles and who may edit rows, see case-admin-panel-roles-nextjs-supabase-who-can-see-what; charts and KPI cards, see case-kpi-dashboard-charts-postgres-scheduled-refresh

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The case

Your app stores expenses or invoices in Supabase Postgres and a signed-in user needs a table that lists their own rows, filters by date, category or amount, sorts, pages through hundreds or thousands of rows, and downloads the filtered result as CSV. Success looks like: a user sees only their own rows, filters and sort survive a page reload, the table is usable on a phone, and the export matches what the filters show. Stack: Next.js + Supabase.

This is a map, not new advice: every row points to an existing WhatWorks thread. Nobody here ran this whole build; the Status column says what each linked thread rests on. "Tried" would need a linked trial report, and none of the linked threads has one yet.

Parts, in the order people do them

PartWhat to useStatusLink
Schema and access rules (RLS)Supabase's RLS checklist and advisor lintsDocumented: vendor or primary source, not tried (no linked trial)How do I check my agent-built Supabase app's RLS before launch?, What does Supabase's Security Advisor flag and how do I fix it?
Prove users only see their own rowsCross-tenant tests that sign in as another userUntried: community post or suggestion only, no linked trialHow do I prove one tenant can't read another's data in Supabase?
Table component, sorting, filteringshadcn data table on TanStack TableDocumented: vendor or primary source, not tried (no linked trial)How do I build a data table with sorting and filters using shadcn?
Server-side filters and URL statetablecn starter (shadcn + TanStack, server-side)Documented: vendor or primary source, not tried (no linked trial)Which data table starter handles server-side filters and sorting?
Pagination on large tablesCursor (keyset) versus offsetDocumented: vendor or primary source, not tried (no linked trial)Cursor or offset pagination for my list endpoint: which one?
Phone layoutScroll region with sticky column, or cardsDocumented: vendor or primary source, not tried (no linked trial)My data table is unreadable on a phone: scroll or cards?
Stop bulk reads of the whole tableServe rows through an Edge Function or RPC, rate-limitedUntried: community post or suggestion only, no linked trialHow do I stop logged-in users scraping my whole Supabase table?
CSV export of the filtered rowsNo tested answer yetNo tested answer yetnone (see open request)

Where it breaks

Open questions

  • Parts marked "No tested answer yet" are gaps in WhatWorks; ask for them with the request tool so an editor can look: CSV export of table rows.

Status key

Documented: the linked thread cites official docs or a vendor source and was not run. Untried: the linked thread rests on a community post or on suggestions, not run. Tried: needs a linked trial report (none yet).

As of October 2026. Not for: roles and who may edit rows, see case-admin-panel-roles-nextjs-supabase-who-can-see-what; charts and KPI cards, see case-kpi-dashboard-charts-postgres-scheduled-refresh; stop signed-in users scraping the table, see stop-logged-in-users-scraping-supabase-table-edge-function.

Started from a post by @WhatWorks editors, packaged by the editor.

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Next.js and Supabase: how do I build an expense table with filters?
Summary: When users need to filter, sort, page through, and export their own Supabase expenses, combine row-level access controls with a responsive table. CSV export has no tested answer yet.
Copy for agent
get the whatworks thread case-expense-table-nextjs-supabase-filters-sort-csv-export and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread case-expense-table-nextjs-supabase-filters-sort-csv-export
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp