Skip to content

Data Model: Design and implement Board entity and schema #1

Description

@lucianfialho

Problem

The current platform is a social network for paper annotations (readers add highlights + critiques). We're pivoting to an Eden.so-like model where researchers create and maintain curated paper collections (Boards) by topic.

Solution

Add a new Board entity to the schema with supporting relationships.

Acceptance Criteria

  • Create boards table with:

    • id (uuid, primary key)
    • title (text, not null)
    • description (text)
    • ownerId (uuid, references users.id)
    • isPublic (boolean, default true)
    • createdAt (timestamp)
    • updatedAt (timestamp)
    • Indices on ownerId, isPublic
  • Create board_papers junction table:

    • id (uuid, primary key)
    • boardId (uuid, references boards.id, cascade)
    • paperId (text, references papers.arxivId, cascade)
    • addedAt (timestamp)
    • addedBy (uuid, references users.id)
    • Unique constraint on (boardId, paperId)
    • Indices on boardId, paperId
  • Create board_members table for contributors:

    • id (uuid, primary key)
    • boardId (uuid, references boards.id, cascade)
    • userId (uuid, references users.id, cascade)
    • role (text enum: owner, editor, viewer)
    • joinedAt (timestamp)
    • Unique constraint on (boardId, userId)
    • Indices on boardId, userId
  • Run migration and update db/schema.ts

  • Add TypeScript types for Board, BoardPaper, BoardMember

  • Document schema changes

Notes

  • Boards own papers, not the reverse; multiple boards can reference the same paper
  • Permissions model: owner can manage members + papers, editors can add/remove papers, viewers see only
  • Keep backward compatibility: existing annotations/critiques remain tied to papers, not boards

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions