Skip to content

Add Upvote/Downvote Reactions to Projects #7

Description

@shri30yans

Implement upvote and downvote reactions for projects.

Preferable prerequisites: #6 #2

Requirements

  1. Database Schema Update:

    • Create a new table to store reactions:
    • This table will store:
      • project_id: The ID of the project being reacted to. Needs to be of UUID type.
      • reactor_id: The ID of the user reacting.
      • time: The timestamp when the reaction was made.
      • reaction_type: The type of reaction (upvote or downvote)
    • Create corresponding types in TypeScript for frontend and Go for backend.
  2. Adjusting Project Score:

    • Modify the Projects table to include a score column
      • Implement logic to update the score based on reactions:
      • If the reaction is an upvote, increment the score.
      • If the reaction is a downvote, decrement the score.
  3. Sorting Projects:

Acceptance Criteria

  • Users can upvote or downvote a project.
  • Reactions are stored in the new Reactions table.
  • The project score is updated correctly based on reactions.
  • Projects are displayed in order of score on the Project page.

Additional Notes:

  • Ensure proper testing for the new functionality and database changes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions