Skip to content

Add project favorites: database table and API endpoints #30

@JohnRDOrazio

Description

@JohnRDOrazio

Context

Users should be able to favorite projects. This requires a new database table and API endpoints.

Database

New project_favorites table:

Column Type Description
user_id text FK to user (from auth provider)
project_id UUID FK to projects.id
created_at timestamp When favorited
PK (user_id, project_id) Composite primary key

API endpoints

  • POST /api/v1/projects/{projectId}/favorite — add to favorites (idempotent)
  • DELETE /api/v1/projects/{projectId}/favorite — remove from favorites
  • GET /api/v1/projects — include is_favorited: boolean in each project response item (for authenticated users)

Sorting

When returning project lists, favorited projects should sort to the top (within the existing sort order). Consider adding a sort query parameter or always sorting favorites first for authenticated users.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions