feat(metrics): add GitHub Discussions metrics route and DiscussionsMe… - #3253
Open
Nareshkumawat-star wants to merge 3 commits into
Open
feat(metrics): add GitHub Discussions metrics route and DiscussionsMe…#3253Nareshkumawat-star wants to merge 3 commits into
Nareshkumawat-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):
|
Author
|
Hi @Priyanshu-byte-coder kindly review and merge it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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