> ## Documentation Index
> Fetch the complete documentation index at: https://memberpulseptyltd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Interest Feed

> Personalized content feed based on your interests

Discover content curated for you based on your selected interests.

## Your Interests

Manage your interest preferences to get relevant content:

* Select categories that match your professional interests
* Content is recommended based on your selections
* Update anytime in your profile settings

## Feed Features

### Recommended Content

Content nominated for you appears with:

* "Recommended for You" badge
* Category tag
* Engagement prompt (discussion question)
* Comment and reaction counts

#### Acceptance Criteria

##### Frontend

* [ ] Recommended Content workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Recommended Content as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

### Content Types

| Type        | Description                     |
| ----------- | ------------------------------- |
| Articles    | In-depth content pieces         |
| Discussions | Opinion and discussion starters |
| Polls       | Quick community surveys         |
| Tips        | Short practical insights        |

#### Acceptance Criteria

##### Frontend

* [ ] Content Types workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Content Types as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

### Engagement Options

For each content item:

* **Comment**: Share your opinion or insights
* **React**: Like, Insightful, Agree, Disagree
* **Share**: Share with colleagues or externally
* **Bookmark**: Save for later reading

### Threads & replies (reddit-style)

Discussion content behaves like a thread:

* A single top-level post (the discussion prompt)
* Members can add comments and **reply to comments** to form nested threads
* Threads can be sorted (e.g. newest, most active)

### Polls & surveys

Poll content allows members to vote on a set of options:

* **One vote per member** per poll
* Optionally allow changing a vote until poll close (configurable)
* Results can be shown immediately or after voting (configurable)

#### Acceptance Criteria

##### Frontend

* [ ] Engagement Options workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Engagement Options as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

## Activity Notifications

Get notified when:

* New content matches your interests
* Someone comments on content you engaged with
* Your comment receives replies
* Content is trending in your interest areas

### Notification Preferences

Members can opt out of community notifications in their profile:

| Setting                 | Description                            |
| ----------------------- | -------------------------------------- |
| Content Recommendations | New content matching your interests    |
| Comment Notifications   | Activity on content you engaged with   |
| Trending Alerts         | Popular content in your interest areas |
| All Community           | Disable all community notifications    |

<Note>
  Opting out of notifications does not remove content from your feed - you can still browse community content manually.
</Note>

#### Acceptance Criteria

##### Frontend

* [ ] Notification Preferences workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Notification Preferences as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

## Features

### Interest Feed

#### Acceptance Criteria

##### Frontend

* [ ] Personalized content feed
* [ ] Interest category filter
* [ ] Comment composer with rich text
* [ ] Reaction buttons
* [ ] Share functionality
* [ ] Bookmark toggle
* [ ] Activity notifications
* [ ] "Mark all as read" for notifications

##### Backend / API

* [ ] Backend behavior supports this feature as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

## Implementation Contracts

### Backend (API)

```
# Feed
GET    /api/member/community/feed                # Personalized feed
GET    /api/member/community/feed/trending       # Trending content
GET    /api/member/community/bookmarks           # Saved content

# Interests
GET    /api/member/interests                     # My interests
PUT    /api/member/interests                     # Update interests

# Community Notification Preferences
GET    /api/member/community/preferences         # Get preferences
PUT    /api/member/community/preferences         # Update preferences (opt-out)

# Engagement
POST   /api/community/content/{id}/view          # Track view
POST   /api/community/content/{id}/react         # Add reaction
DELETE /api/community/content/{id}/react         # Remove reaction
POST   /api/community/content/{id}/bookmark      # Bookmark
DELETE /api/community/content/{id}/bookmark      # Remove bookmark
POST   /api/community/content/{id}/share         # Share content

# Comments
GET    /api/community/content/{id}/comments      # List comments
POST   /api/community/content/{id}/comments      # Add comment
PUT    /api/community/comments/{id}              # Edit comment
DELETE /api/community/comments/{id}              # Delete comment
POST   /api/community/comments/{id}/react        # React to comment

# Polls
POST   /api/community/content/{id}/vote          # Vote on a poll (one vote per member)
DELETE /api/community/content/{id}/vote          # Optional: remove/change vote if enabled

# Notifications
GET    /api/member/community/notifications       # Activity notifications
PUT    /api/member/community/notifications/read  # Mark as read
```

### Data Model

```typescript theme={null}
interface MemberInterests {
  memberId: string;
  categoryIds: string[];
  updatedAt: string;
}

interface MemberCommunityPreferences {
  memberId: string;
  contentRecommendations: boolean;  // New content notifications
  commentNotifications: boolean;    // Activity on engaged content
  trendingAlerts: boolean;          // Trending content alerts
  communityOptOut: boolean;         // Master opt-out for all
  updatedAt: string;
}

interface ContentEngagement {
  contentId: string;
  memberId: string;
  viewed: boolean;
  viewedAt?: string;
  reaction?: 'like' | 'insightful' | 'agree' | 'disagree';
  reactedAt?: string;
  bookmarked: boolean;
  bookmarkedAt?: string;
  shared: boolean;
  sharedAt?: string;
  commented: boolean;
}
```
