Skip to content

feat: add public profile comparison feature#1214

Open
ramlal-01 wants to merge 5 commits into
Priyanshu-byte-coder:mainfrom
ramlal-01:feat/compare-with-friend
Open

feat: add public profile comparison feature#1214
ramlal-01 wants to merge 5 commits into
Priyanshu-byte-coder:mainfrom
ramlal-01:feat/compare-with-friend

Conversation

@ramlal-01
Copy link
Copy Markdown
Contributor

@ramlal-01 ramlal-01 commented May 26, 2026

Summary

closes #1068

Adds a public profile comparison system to DevTrack.

Users can now compare themselves with another public DevTrack profile directly from /u/[username].

This introduces:

  • shareable comparison URLs
  • side-by-side public stat comparison
  • winner/tie indicators
  • privacy-safe public profile comparisons

Features Added

Public Profile Compare Button

On /u/[username]:

  • Logged-out visitors see Log in to compare
  • Logged-in visitors viewing another profile see Compare with me
  • Logged-in visitors viewing their own profile do not see the compare button

Clicking the compare button navigates to:

/compare/currentUser-vs-profileUser

Example:

/compare/priyanshu-vs-ramlal

Shareable Compare Route

Added:

src/app/compare/[users]/page.tsx

Supports routes like:

/compare/alice-vs-bob

The compare page:

  • works without authentication
  • fetches both users using public profile data
  • shows side-by-side comparison
  • highlights winners/ties per metric
  • respects privacy/public profile visibility

Architecture Changes

Reused Existing Public Profile Infrastructure

Instead of creating a separate comparison backend, this PR reuses and extends the existing public-profile architecture.

Shared Public Profile Logic

Moved reusable public profile fetch logic into shared helpers to reduce duplication and keep compare pages public-first and privacy-safe.

Public Compare Data

Added support for:

  • public PR counts
  • public top languages
  • reusable compare-ready public stats

Privacy Handling

If either profile:

  • is private
  • unavailable
  • missing

the compare page shows an unavailable state instead of exposing hidden data.


Files Added / Updated

Added

src/app/compare/[users]/page.tsx

Updated

src/app/u/[username]/page.tsx
src/lib/public-profile-data.ts
src/app/api/public/[username]/route.ts
src/lib/supabase.ts

Validation

Verified locally:

npm run lint
npm run type-check
npm run build

All passing successfully.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

@ramlal-01 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 26, 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

@ramlal-01
Copy link
Copy Markdown
Contributor Author

Rebased with latest main and re-ran CI.

Build, lint, and typecheck are passing successfully.
The remaining Playwright failure appears to be an upstream test environment issue.

Feature implementation is complete and ready for review. 🚀

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

CI is failing on this PR. Please fix the failing checks before this can be merged.

@ramlal-01 ramlal-01 force-pushed the feat/compare-with-friend branch from 3943163 to d0b9bfa Compare May 27, 2026 08:30
@ramlal-01
Copy link
Copy Markdown
Contributor Author

Rebase with the main branch.
All checks are now passing successfully.
@Priyanshu-byte-coder

@ramlal-01
Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder
please review and merge

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

Labels

gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add "compare with friend" feature on public profiles

2 participants