Skip to content

[FEAT] Export metrics to CSV/PDF #16

@Priyanshu-byte-coder

Description

@Priyanshu-byte-coder

What Needs to Be Done

Add an export button to the dashboard that downloads metrics (contributions, PRs, goals) as a CSV or PDF file.

Why This Matters

Developers may want to share their metrics in standups, include in portfolios, or import into spreadsheets for further analysis.

Files to Create/Modify

  • src/components/ExportButton.tsx — new client component with dropdown (CSV / PDF)
  • src/app/dashboard/page.tsx — add ExportButton to header
  • CSV generation: can be done client-side from the already-fetched data
  • PDF: use a library like `jspdf` or `@react-pdf/renderer`

Acceptance Criteria

  • Export button visible on dashboard
  • CSV export works for contributions (date, count) and PR stats
  • File downloads with a readable filename like `devtrack-metrics-2025-05-10.csv`
  • No TypeScript errors, lint passes

Tech Context

For CSV (simpler, start here):

const csv = "Date,Commits\n" + data.map(d => \`\${d.day},\${d.commits}\`).join("\n");
const blob = new Blob([csv], { type: "text/csv" });
const url = URL.createObjectURL(blob);
// trigger download via <a> element

PDF can be a follow-up PR.

Metadata

Metadata

Labels

enhancementNew feature or requestgssoc26GSSoC 2026 contributionlevel2GSSoC Level 2 - Medium complexity (25 points)mediumMedium difficulty task~4hEstimated 4 hours

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions