feat(metrics): add GitHub Discussions metrics route and DiscussionsMe… - #3253
feat(metrics): add GitHub Discussions metrics route and DiscussionsMe…#3253Nareshkumawat-star wants to merge 3 commits into
Conversation
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
|
Hi @Priyanshu-byte-coder kindly review and merge it |
|
This PR has been inactive for 21 days. If it is still in progress, please leave an update — otherwise it will be closed in 7 days. |
|
|
Closing due to inactivity. Feel free to reopen or open a new PR if you would like to continue. |
|
This is the best PR of your batch — I built it, ran it, and looked at the rendered widget, and it's good work. What I verified against current Details I liked: every colour goes through a CSS variable — Two things to remove, then I'll merge. 1. 2. The -github-token: ${{ secrets.GITHUB_TOKEN }}
+github-token: ${{ secrets.STAR_TOKEN || secrets.GITHUB_TOKEN }}
One small thing for later, not blocking: Drop those two files and ping me. |



Summary
Adds a new GitHub Discussions metrics integration to DevTrack. This includes an enhanced GraphQL-backed API route (
/api/metrics/discussions) and a new interactiveDiscussionsMetricscomponent featuring key stat cards, a category breakdown bar chart via Recharts, and a time-range selector (7d/30d/90d).#closes : #3252
Type of Change
What Changed
src/app/api/metrics/discussions/route.ts: Updated the API route to fetch user discussion contributions, comments, accepted answers, and discussion nodes via GitHub GraphQL API (/graphql). CalculatesansweredRate%, top 3 discussion categories, and accepts time-range parameters (days=7/30/90).src/components/DiscussionsMetrics.tsx: Created a client component with stat cards (Discussions Started, Comments Left, Answered Rate %), a horizontal Recharts Bar Chart (Discussions by Category), interactive time-range selector buttons, multi-account support (useAccount), loading skeletons, error states, and empty states.src/components/DiscussionsWidget.tsx: Updated to renderDiscussionsMetricsdirectly within the customizable dashboard.How to Test
7d,30d,90d) to ensure metrics and category distribution re-fetch correctly.Expected result: The discussion widget dynamically updates with stat metrics, category bar chart, and time range selection.
Checklist
console.log, debug code, or commented-out blockscommentsGiven,markedAsAnswer)Accessibility (UI changes only)
Additional Context
https://github.com/Nareshkumawat-star/devtrack/pull/new/feature/discussions-metrics