Skip to content

Forums

The Forums app provides community forum management. Business users can create forum boards, each with a unique slug, and manage them from a single dashboard. Forums support topics and are accessible publicly via their slug.

  • Create forums via an inline dialog with title, slug, and description fields
  • Topic counts displayed per forum via an aggregated query
  • Public forum access at /forums/[slug]
  • Delete forums with inline form actions
  • Zod validation on both client and server for forum creation
RoutePurpose
/business/apps/forumsForum list with create dialog and delete actions

Unlike most apps that use a separate extension schema, forums query the forums table directly via the Supabase client. Fields include owner_id, title, slug, description, and timestamps.

Topic counts are fetched via a Supabase aggregate: forum_topics(count) joined to each forum record.

  • Forum list — card rows showing a message-circle icon, forum title, topic count, and creation date. Each row links to the public forum page and includes an inline delete button.
  • Create forum dialog — a Dialog.Root modal with three fields:
    • Title (required, max 200 chars)
    • Slug (required, max 200 chars, used for the public URL)
    • Description (optional, max 1000 chars)
  • Delete action — inline <form> with a hidden forum_id input, using SvelteKit form actions with enhance
  • Direct Supabase queries — unlike other apps that use service modules, Forums queries locals.supabase directly in the server load and actions
  • Form handling: sveltekit-superforms with zod4 adapter for the create form; native enhance for the delete form
  • Validation: Zod schema defined in both the server file and the client component (duplicated createForumSchema)
  • Toast notifications: svelte-sonner for success feedback on create and delete operations
  • Public routes: Forums are viewed at /forums/[slug] (outside the business app)