Skip to content

App: root keys

The keys at the top of an App that name it, say where its data comes from and where it opens. Every key here is stable (status). All parts.

Only name and home are required. id is the App’s address and account store, a slug of name by default (Help Desk → help-desk); set it before accounts are created. connection names one configured connection, never a URL; sources bind several instead.

home: 'tasks',
home: [{ view: 'welcome', signedOut: true }, { view: 'manager-desk', roles: ['manager', 'admin'] }, { view: 'portfolio' }],

A view id, or rules read in order on every request, first match wins: signedOut: true (needs auth, names a public view), roles, and a last rule with neither. A rule whose view the visitor cannot open gives way to the next.

import { navGroup } from 'tablewalk/app';
export const navigation = [
navGroup('sales', 'Sales', ['sales-dashboard', 'leads', 'opportunities', 'accounts'], { icon: 'chart-line' }),
navGroup('activity', 'Activity', ['tasks', { to: 'activities', label: 'Calls & meetings' }]),
];

Optional; without it there is no menu. An entry is a view id, { to, label }, a navGroup(id, label, children, { icon?, placement?, inline? }) (nesting up to eight deep) or a feature placement { feature: 'id' }. A top-level group with inline: true draws its items straight in the top bar as links, and stays a section in the folded menu and the sidebar. Each list, dashboard, signed-in form or room appears at most once; landings and public forms are refused. A list the menu does not name is still served at its address and offered by ⌘K. Icons are Phosphor names from a curated set, and a wrong one is refused with the nearest. See Navigation and shell.

Every record, list, dashboard and form has one canonical address; tablewalk check --app <dir> --routes prints them all. For a server serving one App, at the root:

What Address
A list, with a tab, search, filter and sort /leads?tab=working&search=stone&source=referral&sort=-created_on
A record, and one of its tabs /leads/127, /accounts/13/opportunities
The New form /leads/new
A dashboard’s window, a section’s own /sales-dashboard?period=last-30-days, ?period.lines-moved-by-day=last-30-days
A natural key, a public slug /label/bug, /vehicles/1-2024-toyota-corolla-le

A record is addressed through the first list showing its table among the views the person reading is served: the resource’s view where they are served it, else the first plain list over it in menu order. A resident’s repair is /my-requests/12 and the office’s the same record at /repairs/12; a mailed link is the recipient’s own, and a signed-in person opening the other’s address is sent on to theirs. Several Apps on one server each keep their id (/lintel/leases/12), and --base-path /tools puts the whole server under a proxy’s path. new, api, assets, sign-in, welcome and form are reserved segments. A query-language address still opens and is rewritten to the canonical one.

Key Type Status What it does
connection string Stable The one connection this App is for, by id or name. Absent means every connection. Not with sources. A name that is an identifier is also the App’s one source’s: commands name it in defineSource. Used in examples/apps/tick/app.ts.
Key Type Status What it does
home string | array Stable Where a visitor starts, required: a view id for everyone, or rules read in order that end with a rule with no condition. Used in examples/apps/tick/app.ts.
Key Type Status What it does
home[].realm "tenant" · "platform" Stable The realm it belongs to: a tenant’s (the default) or the platform realm’s, which needs auth.tenancy.platform. One of platform, tenant.
Key Type Status What it does
home[].roles array Stable
Key Type Status What it does
home[].signedOut Stable One of true. Used in examples/apps/lintel/app.ts.
Key Type Status What it does
home[].view string Stable Used in examples/apps/lintel/app.ts.
Key Type Status What it does
id string Stable Absent, it derives from the name.
Key Type Status What it does
name string Stable An app is named after what it is for. Used in examples/apps/tick/app.ts.
Key Type Status What it does
nav array Stable Arrangement only: view ids, { to, label }, and groups, in order. Optional: an App without nav has no menu. Used in examples/apps/lintel/app.ts.
Key Type Status What it does
nav[].children array Stable
Key Type Status What it does
nav[].color integer Stable A dot in the entry’s icon place, in one of the theme’s eight chart colors (1-8).
Key Type Status What it does
nav[].feature string Stable
Key Type Status What it does
nav[].folded Stable In the sidebar, the section starts folded to its heading for someone who has never opened or closed it. Their own fold is remembered over it; it still opens while it holds the current room, while filtering, and in the rail. One of true.
Key Type Status What it does
nav[].icon "house" · "tray" · "list" · "list-checks" · "kanban" · "table" · "calendar" · "calendar-check" · "clock" · "chart-bar" · "chart-line" · "chart-pie" · "gauge" · "target" · "flag" · "user" · "users" · "user-circle" · "address-book" · "handshake" · "buildings" · "storefront" · "briefcase" · "package" · "truck" · "car" · "shopping-cart" · "receipt" · "currency-dollar" · "credit-card" · "wallet" · "bank" · "file" · "file-text" · "folder" · "clipboard-text" · "note" · "archive" · "tag" · "ticket" · "star" · "bookmark-simple" · "bell" · "envelope" · "chat-circle" · "phone" · "headset" · "megaphone" · "globe" · "map-pin" · "magnifying-glass" · "gear" · "sliders" · "wrench" · "bug" · "shield-check" · "lock" · "key" · "database" · "stack" · "lightning" · "check-circle" · "warning" · "info" · "cell-signal-low" · "cell-signal-medium" · "cell-signal-high" · "cell-signal-full" · "fire" · "hourglass" · "circle-dashed" · "x-circle" · "plus-circle" · "pencil-simple" · "paper-plane-tilt" · "arrows-left-right" · "arrow-circle-down" · "arrow-circle-up" · "laptop" · "monitor" · "device-mobile" · "printer" · "stethoscope" · "heartbeat" · "heart" · "pill" · "syringe" · "first-aid-kit" · "thermometer" · "flask" · "test-tube" · "microscope" · "bed" · "hospital" · "ambulance" · "tooth" · "eyeglasses" · "wheelchair" · "baby" · "dna" · "brain" · "bandaids" · "hand-heart" · "graduation-cap" · "book-open" · "student" · "chalkboard-teacher" · "factory" · "warehouse" · "house-line" · "plant" · "leaf" · "sun" · "cloud" · "drop" · "airplane" · "bicycle" · "bus" · "train" · "boat" · "hammer" · "toolbox" · "plug" · "lightbulb" · "cube" · "camera" · "image" · "trophy" · "gift" · "coffee" · "fork-knife" · "shopping-bag" · "basket" · "barcode" · "qr-code" · "scales" · "gavel" · "certificate" · "identification-card" · "fingerprint" · "eye" · "link" · "paperclip" · "scissors" · "palette" · "code" · "terminal" · "users-three" · "user-plus" Stable The group’s mark in the top bar’s strip and its menus. One of &lt;appIcon>. Used in examples/apps/lintel/app.ts.
Key Type Status What it does
nav[].id string Stable Stable group ID, unique across the navigation tree.
Key Type Status What it does
nav[].inline Stable In the top bar, a top-level group’s entries stand in the bar as links of their own, not under its menu. The sidebar still draws the group. One of true. Used in examples/apps/tick/app.ts.
Key Type Status What it does
nav[].label string Stable
Key Type Status What it does
nav[].placement Stable footer holds a top-level group at the foot of the sidebar, apart from the rest. One of footer. Used in examples/apps/tick/app.ts.
Key Type Status What it does
nav[].realm "tenant" · "platform" Stable The realm it belongs to: a tenant’s (the default) or the platform realm’s, which needs auth.tenancy.platform. One of platform, tenant.
Key Type Status What it does
nav[].to string Stable One of &lt;appTarget>. Used in examples/apps/lintel/dashboards.ts.
Key Type Status What it does
sources object Stable Named connection bindings. At most one says default: true; several may share a connection, each with its own schema. Not with root connection. Used in examples/apps/lintel/app.ts.
Key Type Status What it does
sources.*.connection string Stable Server-configured connection ID or name, never a connection URL. Used in examples/apps/tick/app.ts.
sources.*.default boolean Stable The source whose resources stay bare. At most one says true when there are several, and none has to; a source standing alone is the default unless it says false.
sources.*.realm Stable A platform-only source: read by a tenant App’s platform realm alone, never the default, never written. Its resources are owner platform, access read. One of platform.
sources.*.resources array Stable The tables this source brings in without a block each: ‘all’, or their names. Each is an implicit {} block, granting nothing. One of all. Used in examples/apps/tick/app.ts.
sources.*.schema string Stable The one schema of its connection this source sees (a PostgreSQL schema). Several sources may share a connection, each with a schema of its own. Not on SQLite.