Skip to content

feat(dashboard): add json export functionality#1437

Open
Aspirant200715 wants to merge 4 commits into
Priyanshu-byte-coder:mainfrom
Aspirant200715:feat/json-export
Open

feat(dashboard): add json export functionality#1437
Aspirant200715 wants to merge 4 commits into
Priyanshu-byte-coder:mainfrom
Aspirant200715:feat/json-export

Conversation

@Aspirant200715
Copy link
Copy Markdown

Summary

Added a new "Export JSON" feature to the dashboard, allowing users to download their coding activity, goals, and metric snapshots in a highly structured programmatic format, while safely falling back if the database is disconnected.

Closes #1030


Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

  • Created a new exportJSON function inside the ExportButton component.
  • Implemented a unified fetch that combines GitHub metrics (commits, PRs) with full database extracts (/api/user/data-export).
  • Added graceful fallback logic so the application will not crash if Supabase credentials are missing locally.
  • Added a styled "Export JSON" button to the dashboard UI matching the existing CSV/PDF buttons.
  • Formatted the resulting output into a clean JSON structure and handled client-side Blob downloading.

How to Test

Steps for the reviewer to verify this works:

  1. Run the local development server (pnpm dev)
  2. Log in using GitHub OAuth and navigate to the Dashboard.
  3. Click the new "Export JSON" button located at the top right of the dashboard.
  4. Open the downloaded .json file and verify that the data correctly maps your GitHub commits, PRs, and (if connected) your Supabase goals and streak history.

Screenshots (if UI change)

The UI introduces a third "Export JSON" button perfectly matching the flex layout of the existing export buttons.


Checklist

  • Linked issue in summary
  • pnpm run lint passes locally
  • No TypeScript errors (pnpm run type-check)
  • Self-reviewed the diff
  • Added/updated tests if applicable

Accessibility Checklist

  • Proper keyboard navigation tested
  • Responsive UI verified
  • Accessibility labels added where needed

Additional Notes

The JSON export route was heavily tested for edge cases. It is intentionally designed to bypass strict errors when /api/goals fails, allowing users to export their GitHub contributions still even if they are in an incomplete local dev environment.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@Aspirant200715 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels May 28, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first PR on DevTrack! 🎉

A maintainer will review it within 48 hours. While you wait:

  • Make sure CI is passing (type-check + lint)
  • Double-check the PR description is filled out and the issue is linked
  • Feel free to ask questions in Discussions if you need help

If you find DevTrack useful, a ⭐ star on the repo is always appreciated — it helps the project grow and attract more contributors!

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level:intermediate GSSoC: Intermediate difficulty (35 pts) labels May 29, 2026
@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Hi! Your PR has merge conflicts with the current main branch. Please rebase your branch on latest main and resolve the conflicts:

git fetch upstream
git rebase upstream/main
# resolve any conflicts
git push --force-with-lease origin your-branch

Once resolved, we'll merge it in. Thanks!

@Aspirant200715
Copy link
Copy Markdown
Author

Hi @Priyanshu-byte-coder, I have resolved the conflicts as asked pls check once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:intermediate GSSoC: Intermediate difficulty (35 pts) type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: export dashboard data as CSV / JSON

2 participants