renderTerpApp, collectModules, withAdminArea |
One-call app bootstrap: glob-import modules/*/module.tsx, merge the packaged admin area (opt out with adminArea: false, or select sections with adminArea: { users, groups, audit }; an app route claiming an admin path overrides that screen), build the router, mount provider + auth gate + shell. Options include logo (sidebar brand) and footer. |
TerpProvider, useAuth, useTerpClient |
The context root: session state + the typed API client. Drop to this + buildAppRouter when you need full control. |
buildAppRouter, DEFAULT_ROLE_RANKS, PROFILE_PATH |
TanStack Router adapter: realises stack-agnostic module manifests (routes + nav + roles) into a real router; throws at build time on a route referencing a missing view. Mounts the built-in ProfileView at /profile unless an app manifest claims that path. |
createAuthClient |
The auth/session contract implementation (login / refresh / currentUser) over the generated client. |
LoginView |
The standard sign-in screen: username/password, plus optional SSO provider buttons via ssoProviders and a dev-only credential-fill button via devCredentials (gate it on import.meta.env.DEV). |
useSso, parseSsoCallback, fetchSsoAuthorizationUrl, completeSsoCallback |
The SSO login seam (ADR 0058): useSso().begin(provider) opens an OIDC flow; TerpProvider completes the /auth/callback/{provider} redirect landing into a normal session on boot. renderTerpApp({ ssoProviders }) wires the buttons in one line. |
RequireAuth |
Renders children only with a session; pairs with the router so the app mounts only when signed in. |
ThemeProvider, ThemeToggle, useTheme |
Theming over the shipped palettes — midday, twilight, evening, night, contrast — plus system to follow the OS preference (its dark half is night). The earlier names light, dark and midnight are still accepted wherever a theme is named and resolve to midday, evening and night; the toggle writes the new names, so per-palette selectors in an app's own theme.css must use them. Applies data-theme on <html> (the token stylesheet carries every palette) and persists the choice. defaultTheme is how an app ships on a named theme — declare it in layout-contract.json so a tool can read and rewrite it, or pass the bootstrap option; both is refused. renderTerpApp mounts it for every app; the shell header uses an icon-only, token-themed variant="inline" menu. |
LocaleProvider, defineAppLocales, LanguageSwitcher, useLocale, LOCALE_EN, LOCALE_NL |
The language seam over UiTextProvider: defineAppLocales(i18n, frameworkCatalogs) validates and merges checked-in app messages with framework chrome, the active locale persists, and the shell offers a picker. Pass sourceLocale with locales; missing/empty target messages, undocumented source copies, invalid locale selection and a non-English locale without a complete framework-string catalog throw rather than silently falling back. A framework string that counts something (dataViewResultsRange, dataViewSelectAllResults, accessUnexplainedRoutes) is a PluralText: one form per plural category, chosen by the count under the active locale's Intl.PluralRules, and a catalog must supply exactly the categories its locale uses (one and other for Dutch; one, few, many and other for Polish). <html lang> follows the active locale from mount and across every switch. |
UserMenu, userInitials |
The signed-in user's menu, pinned by buildAppRouter to the bottom of the sidebar: an initials avatar trigger opening the identity block, Settings (the built-in profile page) and sign-out. Collapses to the avatar in the icon rail. |
ProfileView |
The built-in profile / settings page (/profile): the server-validated identity, theme + language preferences, and sign-out. |