Skip to content

[BE-45] Community feed: backend #1234

Description

@yusuftomilola

Overview

A community bulletin board lets members post short updates, share opportunities, or celebrate milestones. Admins can pin important posts and moderate content. This is the backend for the FE-39 community feed.

Context

  • User entity: backend/src/users/entities/user.entity.ts
  • CommunityModule — may already exist for the directory endpoints (BE-11, BE-12); extend it here

Tasks

  • Create CommunityPost entity: id, authorUserId (FK), body (text, max 1000 chars), isPinned (bool, default false), isDeleted (bool, default false), likeCount (int, default 0), createdAt, updatedAt
  • Create CommunityPostLike entity: id, postId (FK), userId (FK), createdAt; unique constraint on (postId, userId)
  • POST /community/posts — any active authenticated member creates a post; validate body max length
  • GET /community/posts — paginated feed; pinned posts always first, then newest first; author basic info included
  • DELETE /community/posts/:id — soft-delete own post (member) or any post (admin); sets isDeleted = true
  • POST /community/posts/:id/like — toggle like: if already liked, unlike; if not liked, like; updates likeCount atomically
  • PATCH /community/posts/:id/pin — toggle pin/unpin (admin only)

Files to Modify / Create

  • New entities in backend/src/community/
  • backend/src/community/community.controller.ts
  • backend/src/community/community.module.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions