Hallo Stroke

Frontend Forum

Preference-filtered forum with threads, nested replies, and roles.

The forum is the peer-support core. It is preference-filtered — users only see categories matching their registration preferences, including religion-gated categories.

Routes

RouteFilePurpose
/forumForumCategory.jsCategories filtered by user preferences
/forum/:topicIdForumTopic.jsThreads in a category: create, reply, like, edit, delete
/forum/:topicId/discussion/:idDiscussionDetails.jsThread detail with nested replies, likes, image upload
/forum/dukungan-emosionalDukunganEmosional.jsStatic "Emotional Support" feed (partial)

Preference filtering

ForumCategory.js contains filterCategoriesByPreference:

  • Religion-gated categories (Islam, Kristen, Katolik, Hindu, Buddha, Konghucu) are shown only if the user selected that preference during registration.
  • Non-religious categories (medical info, mental health, emotional support) are shown based on matching preferences.
  • Logged-out users see only non-religious categories.

Thread lifecycle

Loading diagram...
  • Edit/delete window: threads can only be edited/deleted within 15 minutes of creation (isThread15minutesOldOrLess in ForumTopic.js).
  • Owner-only delete — enforced by the backend (DELETE /api/forum/threads/:id checks author).
  • Image upload — 5 MB limit, multipart, stored by the backend.

Roles & verification

ForumTopic.js fetches /api/users/:id/roles for each thread author to display role badges, and shows a verified checkmark (CircleCheck from lucide) for is_verified users.

Pseudonym

Threads and replies accept use_pseudonym — when true, the user's nama_samaran (forum alias) is displayed instead of their real name.

Reusable modals

src/components/modals/ThreadModals.js provides the only extracted reusable modal components — EditThreadModal and DeleteThreadModal — used by both ForumTopic.js and DiscussionDetails.js.

WhatsApp broadcast

When a thread is created (POST /api/forum/threads), the backend fires a WhatsApp broadcast in a goroutine to all users whose preferences match the thread's category. See Backend → WhatsApp Bot.

On this page