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.
Key Features
Section titled “Key Features”- 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
Page Structure
Section titled “Page Structure”| Route | Purpose |
|---|---|
/business/apps/forums | Forum list with create dialog and delete actions |
Data Model Overview
Section titled “Data Model Overview”Forum (via Supabase forums table)
Section titled “Forum (via Supabase forums table)”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.
Forum Topics
Section titled “Forum Topics”Topic counts are fetched via a Supabase aggregate: forum_topics(count) joined to each forum record.
Key Components
Section titled “Key Components”- 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.Rootmodal 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 hiddenforum_idinput, using SvelteKit form actions withenhance
Notable Integrations
Section titled “Notable Integrations”- Direct Supabase queries — unlike other apps that use service modules, Forums queries
locals.supabasedirectly in the server load and actions - Form handling:
sveltekit-superformswithzod4adapter for the create form; nativeenhancefor the delete form - Validation: Zod schema defined in both the server file and the client component (duplicated
createForumSchema) - Toast notifications:
svelte-sonnerfor success feedback on create and delete operations - Public routes: Forums are viewed at
/forums/[slug](outside the business app)