Skip to content

Design proposal for forum feature

barisoksuz edited this page Mar 15, 2026 · 1 revision

Emergency Hub - Entities & Data Model

System Overview

The application is structured around location-based hubs.

  • Hubs are created by the platform, not users.
  • Users belong to exactly one hub. (They choose when they sign up.)
  • Users interact only with posts inside their hub. (We may add one global forum for all the users.)

Each hub currently contains two forums: - standard - urgent (standard is like general chatting, the urgent one is not for the help requests, but urgent situations that need to be shared etc. and it will trigger a notification)

The forum for help requests will be added but that will have a different structure, we can handle that after we finish this.

Forums are categories, not separate entities.


Entity Relationships

User → belongs to → Hub
Hub → contains → Posts
Post → has → Comments
Post → has → Votes
Post → has → Reports


User

Represents a user of the application.

Field Description
id Unique identifier
role user, admin, expert etc
username Unique username
displayName Public display name
avatarUrl Profile image URL
hubId Hub the user belongs to
createdAt Account creation timestamp

Hub

Represents a location-based community hub.

Field Description
id Unique hub identifier
name Hub name
city City name
description Optional description shown on the hub page
createdAt Creation timestamp

Forum Types

Forums are logical categories used to organize posts inside a hub.

Possible values:

  • standard
  • urgent

Standard Forum

Used for general communication within the hub.

Examples:

  • Information sharing
  • Questions
  • Local updates

Urgent Forum

Used for time-sensitive alerts and warnings.

Examples:

  • Safety alerts
  • Emergency situations
  • Immediate warnings

Urgent posts trigger push notifications to users in the same hub.


Post

Represents a user-created post within a hub forum.

Field Description
id Unique identifier
hubId Hub the post belongs to
forumType standard or urgent
authorId User who created the post
title Post title
content Main text content
imageUrls List of image URLs attached to the post
upvoteCount Total number of upvotes
downvoteCount Total number of downvotes
commentCount Number of comments
reportCount Number of reports
status Moderation status
createdAt Post creation timestamp
updatedAt Last edit timestamp

Status Values

  • active — visible to users
  • hidden — hidden due to reports
  • removed — removed by moderators

Comment

Represents a user reply to a post.

Field Description
id Unique identifier
postId Post the comment belongs to
authorId User who created the comment
content Comment text
createdAt Comment creation timestamp

Comments are currently flat (no nested replies).

Nested replies may be implemented in a later milestone.


Vote

Represents an upvote or downvote on a post.

Field Description
postId Post being voted on
userId User who voted
voteType up or down

Rules

  • A user can vote once per post
  • Changing a vote replaces the previous vote

Report

Represents a report submitted by a user for moderation.

Field Description
id Unique identifier
postId Reported post
reporterId User who submitted the report
reason Reason for reporting
createdAt Report creation timestamp

Possible Reasons

  • spam
  • misinformation
  • abuse
  • irrelevant

Media Handling

Images are uploaded to DB separately before creating posts. The upload returns a URL which is attached to posts. This avoids large payloads.


Notification Behavior

Urgent posts trigger push notifications to users in the same hub. Only the post author should not receive the notif.

Clone this wiki locally