Phase 5: Reviews & ratings system
维护者通常 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 内容生成。
描述
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)
-
reviewstable 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
reviewstable (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
- Review API/Server Actions:
- Create review (requires auth, must have bookmarked resource)
- Update review
- Delete review
- Get reviews for a resource
- ResourceCard integration:
- Show average rating + review count
- "Write a review" button for authenticated users who bookmarked
- Review display:
- On resource detail (if
/resource/[slug]page exists) or in card dialog - List reviews with rating, comment, user (anonymous), date
- On resource detail (if
- 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 CRUDsrc/lib/resources.ts- addgetResourceReviews(),getResourceRating(),createReview(),updateReview()src/components/directory/resource-card.tsx- show rating starssrc/components/directory/resource-detail-dialog.tsx- add reviews sectionsrc/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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Your-Voldemort/StudentStack 的其他 Issue
-
enhancement
难度 5/5 一周以上 新手友好度 20/100
Your-Voldemort/StudentStack#42 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 45/100
Your-Voldemort/StudentStack#41 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
Your-Voldemort/StudentStack#40 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 45/100
Your-Voldemort/StudentStack#38 ·
维护者通常 1 天内回复
-
enhancement
难度 3/5 3-5 天 新手友好度 68/100
Your-Voldemort/StudentStack#36 ·
维护者通常 1 天内回复
查看 Your-Voldemort/StudentStack 的全部 Issue
相似的 Issue
-
[Bug]: Server git tests sign fixture commits with the developer's key when run from the repo root未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
melgarafael/DeskcommCRM#2657 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
MystenLabs/MemWal#1163 · 2 条评论 ·
维护者通常 1 天内回复
-
Mondriaan
难度 1/5 1 小时以内 新手友好度 88/100
knaw-huc/textannoviz#709 ·
维护者通常 1 天内回复
-
billion-context-pi
难度 2/5 1-3 小时 新手友好度 62/100
ranxianglei/billion-context#2521 · 3 条评论 ·
维护者通常 1 天内回复