Skip to main content

Overview

Topics and posts are the core building blocks of the forum system. Topics represent discussion threads, while posts contain the actual content and replies.

Creating Topics

Using the useForum Hook

Server Action

The createForumTopic server action handles topic creation:
src/lib/actions/forum/topics.ts

Fetching Topics

Get Topics with Pagination

Get Single Topic

Creating Posts (Replies)

Reply to a Topic

Server Action for Posts

src/lib/actions/forum/posts.ts

Upvoting Topics

Users can upvote topics to show support and surface quality content.

Upvote a Topic

Get Upvote Count

Voting Power Requirements

Users need sufficient voting power to create topics and posts. This is checked against the DAO’s token contract.

Content Moderation

Automatic NSFW Detection

All content is automatically moderated using the OpenAI moderation API:

Soft Delete

Admins can soft delete content, which hides it but allows recovery:
src/lib/actions/forum/topics.ts

Restore Deleted Content

src/lib/actions/forum/topics.ts

Archive Topics

Archiving removes topics from active view but preserves them:

Data Structure

Best Practices

Every write operation requires wallet signature verification to prevent unauthorized actions.
Verify users have sufficient voting power before allowing topic creation or posting.
Run content through moderation before saving to maintain community standards.
Don’t block user responses waiting for search indexing - run it asynchronously.
Filter NSFW content from public queries but preserve it for admin review.

Next Steps

Reactions

Add emoji reactions and engagement features

Attachments

Enable file uploads and IPFS storage

Moderation

Set up admin controls and content moderation

Search

Implement full-text search functionality