feat(badges): add awards, mentorship, and contribution badges

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start with computeBadges, the event_attendances schema for foreign-key and cascade conventions, and HexStamp.tsx for fallback glyphs. Review how the three tables should support the listed award, mentorship, and contribution badges, including the public/discoverable partner condition. Done means the migrations, seed entries, badge computation, tooltips, and fallback visuals cover the stated requirements.

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

描述

Summary

Phase 3 of the badge expansion. Adds three new tables — `awards`, `mentorship_pairings`, `community_contributions` — and wires `computeBadges` to surface ~15 new badges spanning recognition, paired mentorship, and sustained contribution to community resources.

Requirements

Schema
  • `awards` table: id, name, slug, description, tier (e.g., 'lifetime' | 'annual' | 'special'), visual accent. Plus `user_awards` (user_id, award_id, awarded_at, citation, awarding_event_id?).
  • `mentorship_pairings` table: id, mentor_id, mentee_id, program_slug, started_at, ended_at?, notes?. Both sides earn a paired badge with the partner's name in the tooltip.
  • `community_contributions` table: id, contributor_id, kind ('newsletter' | 'tutorial' | 'guide' | 'translation' | 'comm-call-host' | ...), title, url?, published_at. One row per attributed contribution.
Badges
  • USRSE Award (parameterized — one badge kind, accent + label vary by award tier).
  • Rising Star, Mentor of the Year, Excellence in Service, Lifetime Achievement (named awards, derive from `user_awards` joined to `awards`).
  • Mentor / Mentee badges from `mentorship_pairings`.
  • Newsletter Contributor, Resource Author, Tutorial Author, Translator, Community Call Host from `community_contributions` filtered by kind.
  • First Contribution milestone (one per user, on first `community_contributions` row).
  • Sustained Contributor — 5+ contributions across any kind.
Visual
  • Premium awards (Lifetime Achievement, Excellence) are good R2 artwork candidates — see # for the storage strategy.
  • Default fallback glyphs in `HexStamp.tsx` for awards without commissioned artwork.

Context

Phases 1 and 2 (#1951, #1952) widen `computeBadges` to accept richer existing data without schema changes. This phase introduces the tables that don't exist yet. Each table is small and additive — none of them couple to existing tables in a way that risks the rest of the data model.

Implementation Notes

  • Generate the migration via `drizzle-kit generate` for the three new tables. Mirror the FK and cascade rules from `event_attendances` (cascade on user delete, set null on awarding_event delete).
  • Awards seed: start with the actual USRSE community awards as approved entries (Service Award, etc.) — admin tooling to grant them comes later.
  • Mentorship pairing badge tooltip should include the partner's display name, surfaced via a join in `computeBadges`. That's a privacy-tinted decision — only show the partner if both are public/discoverable.
  • Contribution-attribution should accept a free-text `title` plus optional `url` so we can backfill historical contributions before building any admin UI.
主要语言
HTML
星标
33
派生
107
平均合并
14 小时 6 分钟
30 天内合并 PR
19

环境准备

从这里开始

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

USRSE/usrse.github.io 的其他 Issue

查看 USRSE/usrse.github.io 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

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