Template documentation
Public documentation for the Next.js template: setup, accounts, workspaces, API access, application runtime, and developer guidance.
Template documentation
This documentation explains what the Next.js application template already provides and how to use it when creating a service. It covers setup, account management, organization-backed workspaces, API keys, localization, runtime defaults, quality workflow, and release history.
Start here
General
First steps and shared terminology for template adopters.
Account
Personal settings, provider connections, sessions, invitations, and deletion.
Workspace
Organization-backed collaboration, members, teams, invitations, and settings.
Learn how the template maps user-facing workspaces to Better Auth Organizations.
Create and switch workspacesCreate workspaces, open workspace URLs, switch context, and understand deletion boundaries.
Workspace settingsReview the settings sections for workspace details, users, invitations, teams, roles, and API keys.
InvitationsCreate invitations, copy links, accept or reject decisions, and target teams.
API and integrations
Machine access with API keys and starter read-only API routes.
Application
Application shell, localization, OAuth, runtime security, caching, and settings UI.
Review public routes, protected routes, dashboard surface, and extension points.
LocalizationSee how PUBLIC_DEFAULT_LOCALE controls UI messages, metadata, and documentation variants.
Review public base URL, image host policy, security headers, and route protection defaults.
Documentation and development
How to keep public docs, OpenSpec, E2E tests, and feature slices aligned.
History
Published releases and weekly user-visible change summaries.
What the template includes
- Application foundation: Next.js App Router, React, TypeScript, Tailwind CSS v4, shadcn/ui, server actions, settings shell, and feature-sliced structure.
- Accounts and auth: Better Auth, configured-only OAuth providers, account settings, connected accounts, sessions, local automation auth, and protected routes.
- Workspaces: Better Auth Organization-backed workspaces,
/w/:organizationKey/...routes, settings, users, roles, teams, invitations, allowed email domains, and zero-workspace onboarding. - API access: personal and workspace API keys, one-time secret reveal, permissions, expiration,
rate limits, and starter read-only
/api/v1routes. - Localization:
next-intlinfrastructure, English and Russian messages, localized metadata, and localized documentation content with canonical URLs. - Quality workflow: OpenSpec requirements, Jest, Playwright E2E, shared automation helpers, public documentation updates, releases, and weekly change notes.
Documentation pages can have .en.md and .ru.md variants. The route stays canonical; the
documents system chooses the variant that matches the configured UI locale and shows a language
marker only when fallback content is used.