Community
Community collection schemas — threads, comments, reactions, bookmarks, reports, bans
Community Collections
Community requires the community feature enabled. See Feature Setup.
Threads
| Field | Type | Description |
|---|---|---|
title | text | Thread title (required) |
slug | text | Auto-generated from title |
content | richText | Thread body (required) |
customer | relationship → customers | Author (auto-set from JWT) |
categories | relationship → thread-categories (hasMany) | Thread categories |
comments | join → comments | Reverse join of comments on this thread |
thumbnail | upload → images | Featured image |
moderationStatus | select | pending | approved | rejected | reported | hidden |
isPinned | checkbox | Admin-only, appears at top of listings |
allowComments | checkbox | Default: true |
isFeatured | checkbox | Featured flag |
publishedAt | date | Publish date |
viewCount | number | Read-only, incremented via view endpoint |
commentCount | number | Read-only, auto-updated by comment hooks |
reactionCount | number | Read-only, auto-updated by reaction hooks |
reportCount | number | Read-only, auto-updated by report hooks |
metadata | json | Arbitrary extension data |
Access: Customer-scoped. Customers create/update own threads. Admins have full control.
Soft delete: Enabled. Cascading delete removes all comments, reactions, bookmarks, and reports.
Comments
| Field | Type | Description |
|---|---|---|
thread | relationship → threads | Parent thread (required) |
customer | relationship → customers | Author (required) |
content | textarea | Comment text, max 2000 chars (required) |
parent | relationship → comments | Parent comment for nesting |
depth | number | 0-2, auto-calculated from parent |
rootId | text | First ancestor ID for thread tracking |
status | select | published | hidden | reported |
isEdited | checkbox | Auto-set on update |
reactionCount | number | Read-only |
reportCount | number | Read-only |
metadata | json | Arbitrary extension data |
Nesting: 3 levels max (depth 0, 1, 2). Cascading delete removes child comments and reactions.
Reactions
| Field | Type | Description |
|---|---|---|
thread | relationship → threads | Target thread (XOR with comment) |
comment | relationship → comments | Target comment (XOR with thread) |
customer | relationship → customers | Reactor (required) |
type | relationship → reaction-types | Reaction type (required) |
Uniqueness: One reaction per customer + target + type per tenant. Duplicate returns 409.
Reaction Types
| Field | Type | Description |
|---|---|---|
title | text | Display name (required) |
slug | text | Auto-generated |
emoji | text | Emoji character |
icon | text | Icon name/path |
Access: Tenant-admin creates/manages. Public read. Orderable.
Bookmarks
| Field | Type | Description |
|---|---|---|
thread | relationship → threads | Bookmarked thread (required) |
customer | relationship → customers | Owner (required) |
Access: Purely customer-scoped. One bookmark per customer + thread per tenant.
Thread Categories
| Field | Type | Description |
|---|---|---|
title | text | Category name (required) |
slug | text | Auto-generated |
description | textarea | Short description |
image | upload → images | Category image |
parent | relationship → thread-categories | Hierarchical parent |
color | text | Color picker value |
Reports
| Field | Type | Description |
|---|---|---|
target | relationship → threads | Reported thread (XOR with targetComment) |
targetComment | relationship → comments | Reported comment (XOR with target) |
customer | relationship → customers | Reporter (required) |
reason | select | spam | harassment | inappropriate | off-topic | other |
reasonDetail | textarea | Detail text, max 500 chars |
Auto-hide: When report count reaches 5, content is automatically hidden.
Community Bans
| Field | Type | Description |
|---|---|---|
customer | relationship → customers | Banned customer (required) |
isPermanent | checkbox | Permanent ban flag |
bannedUntil | date | Temporary ban expiry |
reason | textarea | Ban reason |
bannedBy | relationship → users | Admin who issued ban |
Access: Admin-only. Ban check runs on thread/comment creation — banned customers receive 403.
SDK Guide
For implementation examples, see Community Guide.