Billing, admin and the frontend platform
The parts that turn a scaffold into a product.
- Billing. Stripe through the Better Auth plugin, with the organization as the customer. A browser-safe plan catalog renders the pricing page, the in-app billing page and drives the API’s limits. Checkout, customer portal, cancel and restore; per-seat plans follow the member count; trials, dunning emails and a payment-failed banner. Everything stays dormant until Stripe keys are set.
- Admin. Platform administrators (a role on the user, independent of organization roles) get user search, ban and unban, role changes, session revocation and one-hour impersonation; a tenant list with members, workspaces and subscription state; feature flags with a global default and per-organization overrides; and a system page with version, uptime, counts, database and migration state, and service health. The first admin is created from the command line.
- Component kit. shadcn-svelte components generated into the shared UI package, alongside the
hand-written primitives. Design tokens as
light-dark()pairs, so every surface follows the operating system without JavaScript; the app adds a Light/Dark/System toggle. - Forms and data. sveltekit-superforms in SPA mode with Zod 4, validating the contract’s own schemas; TanStack Query with keys, fetchers and types derived from the contract.
- App shell. Skip link, responsive sidebar, command palette (Ctrl/⌘K), toasts, dialog confirmations, skeletons and empty states, error boundaries with a reference id, and an “Install app” button when the browser offers it.
- PWA. A service worker that precaches the build and serves a prerendered offline page, registered in production browsers only.
- Deployment switches. Sentry error tracking and PostHog analytics, both off until a key is set; PostHog loads only after the visitor accepts a consent banner.
- Accessibility. axe (WCAG 2.2 AA) runs on the public pages in the end-to-end suite; the authenticated pages passed the same checks in both color modes.