acmpesuecc / Loop

MIT License
0 stars 5 forks source link

Add Upvote/Downvote Reactions to Projects #7

Open shri30yans opened 1 month ago

shri30yans commented 1 month ago

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:

    • Implement sorting functionality on the Project page to display projects by their score, showing top posts first.
    • Implement this preferably after #2

Acceptance Criteria

Additional Notes:

bunsamosa-bot[bot] commented 1 month ago

Thank you for opening this issue! A Maintainer will review it soon!