Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Phase 5: Reviews & ratings system

未关闭
#37 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
supabase, typescript

调研方向

Start with PRD §8.11 and the existing reviews table in src/db/schema.ts, then inspect the resource and authentication flows used by the listed files. Review src/app/reviews/actions.ts, src/lib/resources.ts, resource-card.tsx, resource-detail-dialog.tsx, and the new rating-stars.tsx component. Done means authenticated eligible users can manage reviews, public users can view them, and cards show the specified aggregate rating.

由索引模型根据 Issue 内容生成。

描述

enhancement

Description

Implement reviews and ratings as specified in PRD §8.11. This is a P2 requirement for Phase 5.

Acceptance Criteria (from PRD §8.11)

  • reviews table already modeled; ship the read path once there's enough logged-in traffic to expect write volume
  • Users can rate (1-5) and comment on resources they've bookmarked/used

Current State

  • Database schema already has reviews table (src/db/schema.ts lines 83-92):
    • id, resourceId, userId, rating (1-5), comment, createdAt
    • RLS enabled
  • No UI or API for reviews exists yet
  • Requires authenticated users (Phase 3)

Implementation Plan

  1. Review API/Server Actions:
    • Create review (requires auth, must have bookmarked resource)
    • Update review
    • Delete review
    • Get reviews for a resource
  2. ResourceCard integration:
    • Show average rating + review count
    • "Write a review" button for authenticated users who bookmarked
  3. Review display:
    • On resource detail (if /resource/[slug] page exists) or in card dialog
    • List reviews with rating, comment, user (anonymous), date
  4. Aggregate stats:
    • Average rating per resource
    • Review count
    • Update resource card to show stars

Files to Create/Modify

  • src/app/reviews/actions.ts (new) - Server Actions for review CRUD
  • src/lib/resources.ts - add getResourceReviews(), getResourceRating(), createReview(), updateReview()
  • src/components/directory/resource-card.tsx - show rating stars
  • src/components/directory/resource-detail-dialog.tsx - add reviews section
  • src/components/ui/rating-stars.tsx (new) - star rating display/input component

Database Schema (already exists)

reviews: {
  id: serial PK
  resourceId: integer (FK to resources)
  userId: uuid (FK to auth.users)
  rating: integer (1-5)
  comment: text
  createdAt: timestamp
}

RLS Policy

  • Users can only INSERT/UPDATE/DELETE their own reviews
  • Anyone can SELECT reviews (public read)
  • Consider: only allow reviews if user has bookmarked the resource (application tracker integration)

UX Notes

  • Star rating input (1-5) + optional text comment
  • Show "Verified student" badge if user has .edu email (from Supabase Auth)
  • Aggregate: "4.2 ★ (23 reviews)"
  • Sort reviews: most recent, highest rated, most helpful
主要语言
TypeScript
星标
1
派生
6
平均合并
11 小时 16 分钟
30 天内合并 PR
16

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Your-Voldemort/StudentStack 的其他 Issue

查看 Your-Voldemort/StudentStack 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。