Key concepts overview

How the ApiTables Next.js Frontend module works and how it connects to the backend

This page is for frontend developers new to ApiTables. Read it before copying a table page from an existing feature.

What you are building

A typical ApiTables page does not hard-code columns or buttons. Instead:

  1. You fetch table structure from the backend (load-table)
  2. You pass that JSON into ReactApiTable
  3. The component fetches row data (query-table) and renders filters, sort, actions automatically

Your job is wiring — not reimplementing a data grid.

Analogy

The backend sends a form template (structure). ReactApiTable is the form renderer. You do not redraw each input by hand.

Main pieces in ./ApiTables/

PieceRole
ReactApiTableEntry component — drop on a page
useTableStructureGET hook for structure JSON
useTableFetcherPOST hook for paginated data
ApiTablesProviderRedux store per table instance
useUtilsProviderRow/bulk action HTTP + toasts
ApiTablesComponentCore grid UI (toolbar, body, pagination)

Import paths in app code: @/app/ApiTables/...

Lifecycle on one page

Mount

Page calls getTableStructure({ table: '/api-table/control-tables/load-table/orders' }).

Provider init

ReactApiTable wraps children in ApiTablesProvider and dispatches structure into Redux.

First query

Fetcher POSTs to query-table/orders with default page, sort, empty filters.

User interaction

Filter apply, sort click, pagination → new query-table POST with updated payload.

Actions

Row/bulk buttons POST to URLs from structure JSON; onSuccess rules trigger refetch.

What backend must provide first

Before your page works:

Backend endpointYou need
load-table/{name}Structure with columns, optional filters, rowActions, bulkActions
query-table/{name}Paginated items matching column data_src keys

See Backend documentation for how backend developers register tables.

Junior vs senior focus

LevelFocus
JuniorCopy working page pattern, useTableStructure, ReactApiTable, correct load path
Midparams, custom toolbar slot, row action refresh behavior, filter UX
SeniorCustom controls/modals, external Redux bridge, controller overrides, performance

Common misconceptions

MisconceptionReality
“I add columns in React”Columns come from structure JSON
“Each table needs a new Redux slice file”ApiTablesProvider creates an isolated store per instance
“I call row action URLs myself”useUtilsProvider handles POST + error toasts
“Structure path is always the same”Each feature chooses its load-table/... segment

Next steps

GoalRead
Ship first pageGetting started
TermsGlossary
Redux detailsProviders overview
StuckTroubleshooting

On this page