Skip to content

feat: added profile management page and user API#76

Open
akhila-sraj wants to merge 5 commits into
Umbrella-io:mainfrom
akhila-sraj:feat/profile-management
Open

feat: added profile management page and user API#76
akhila-sraj wants to merge 5 commits into
Umbrella-io:mainfrom
akhila-sraj:feat/profile-management

Conversation

@akhila-sraj

Copy link
Copy Markdown

Description

Implemented a complete profile management system for users.

Features Added

  • Created /profile page for viewing account details
  • Added profile navigation link in the navbar
  • Implemented GET /api/user to fetch current user information
  • Implemented DELETE /api/user for account deletion
  • Added account deletion confirmation flow
  • Added sign out and redirect after account deletion
  • Displayed GitHub avatar, username, email, and account details
  • Added loading and error handling states

Tech Used

  • Next.js App Router
  • NextAuth authentication
  • Supabase database integration
  • Tailwind CSS

Testing Done

  • Verified profile page rendering
  • Tested user data fetching
  • Tested account deletion flow
  • Confirmed navigation works correctly
  • Ran lint and build checks successfully

Fixes #15

@vercel

vercel Bot commented May 15, 2026

Copy link
Copy Markdown

@akhila-sraj 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 left a comment

Copy link
Copy Markdown

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

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good scope — Navbar, profile page, user API, and the supabase null-guard are all worthwhile. But one change here breaks the existing codebase and needs to be resolved before this can merge.

Blockers

1. supabaseAdmin made nullable without updating all consumers

src/lib/supabase.ts now exports supabaseAdmin as SupabaseClient | null. But the existing routes — src/app/api/metrics/streak/route.ts, src/app/api/metrics/repos/route.ts, src/app/api/metrics/prs/route.ts — all call supabaseAdmin.from(...) without null checks. This PR only guards goals/route.ts and auth.ts, leaving the others as TypeScript errors (and runtime crashes if env vars are missing).

Either add null checks to every route that uses supabaseAdmin, or keep supabaseAdmin non-nullable and add a startup-time guard instead.

2. window.confirm() for account deletion

Same issue as flagged on other PRs — confirm() dialogs are inconsistent UX. Replace with an inline confirmation step (e.g. a "Are you sure?" state that reveals a second button).

3. let data: any in ProfileClient.tsx

Avoid any. Type the parsed response properly or use unknown with a type guard.

Minor

  • hover:bg-slate-700 in Navbar.tsx is hardcoded — looks wrong in light mode. Use hover:bg-[var(--control)] like the rest of the UI.
  • DashboardHeader.tsx is deleted here but PR #66 modifies it — merging either will conflict with the other. Worth noting so both can be coordinated.
  • Missing EOF newlines in several new files.

Fix the three blockers and this is solid work.

@Priyanshu-byte-coder Priyanshu-byte-coder added type:feature GSSoC type bonus: new feature level:advanced GSSoC: Advanced difficulty (55 pts) gssoc26 GSSoC 2026 contribution labels May 15, 2026

@akhila-sraj akhila-sraj left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the review! I’ve addressed the requested changes and pushed the fixes to the same branch.

Changes made:

  • Fixed supabaseAdmin nullability handling
  • Replaced window.confirm() with inline confirmation UI
  • Removed any usage with proper typing
  • Updated hover styling and formatting issues

Also re-ran lint and build successfully.

@akhila-sraj

akhila-sraj commented May 19, 2026

Copy link
Copy Markdown
Author

@Priyanshu-byte-coder I have implemented everything you had asked for. Could you go through it once and confirm the PR

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

Hi @akhila-sraj — this PR has merge conflicts with main across several files (dashboard/page.tsx, DashboardHeader.tsx, Navbar.tsx, API routes). Please rebase your branch:

git fetch upstream
git rebase upstream/main
# resolve conflicts, then:
git push --force-with-lease

Once rebased, we'll do a full review.

@akhila-sraj akhila-sraj force-pushed the feat/profile-management branch from 99936e0 to dee5355 Compare May 19, 2026 10:38
@akhila-sraj

Copy link
Copy Markdown
Author

@Priyanshu-byte-coder I have resolved all the merge conflicts. I was hoping if you could do a full review now.

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Critical: this PR deletes DashboardHeader.tsx

The diff shows DashboardHeader.tsx as a deleted file. This component is imported by dashboard/page.tsx — deleting it would break the entire dashboard (build error). This was almost certainly an accidental git stage. Restore the file:

git checkout HEAD -- src/components/DashboardHeader.tsx
git push

Other issues:

  1. Duplicate null-check block in goals/route.ts**
    The same supabaseAdmin null-check is pasted twice consecutively. Remove one copy.

  2. Hardcoded colors in profile/page.tsx

  • bg-white text-slate-900 on sign-in button → bg-[var(--card)] text-[var(--card-foreground)]
  • hover:bg-slate-100hover:bg-[var(--control)]
  1. session.user?.name in /api/user/route.ts fallback
    username: session.githubLogin ?? session.user?.name ?? "" — use session.githubLogin only. user.name is the OAuth display name, not the GitHub login.

Do NOT merge until DashboardHeader.tsx is restored.

@akhila-sraj

Copy link
Copy Markdown
Author

@Priyanshu-byte-coder Could you check once

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. AccountToggle and KeyboardShortcuts removed — the new DashboardHeader drops both components with no justification. AccountToggle is how multi-account users switch accounts — its removal is a blocking regression. Restore both. 2. Security — GET /api/user 404 response body includes { session: { githubId, githubLogin, email } }. Strip internal session data from error responses. 3. Hardcoded colors in Navbar.tsx — bg-blue-600, text-white, hover:text-blue-400. Replace with CSS vars. 4. formatDate(null) crash — created_at is null in the GitHub fallback path but formatDate is called unconditionally. 5. Missing EOF newline on DashboardHeader.tsx. 6. Cascading delete missing — DELETE /api/user only removes from users table; orphaned goals/accounts/cache rows remain.

@akhila-sraj

Copy link
Copy Markdown
Author

@Priyanshu-byte-coder Can you check it now ?

@akhila-sraj

Copy link
Copy Markdown
Author

@Priyanshu-byte-coder Could you review it once I have rectified the conflicts

@akhila-sraj

Copy link
Copy Markdown
Author

@Priyanshu-byte-coder It would be nice if you could review the work I have done as more merge conflicts are occurring with passing time

@Priyanshu-byte-coder Priyanshu-byte-coder added the gssoc:approved GSSoC: PR approved for scoring label May 24, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with main. Please rebase on the latest main branch and re-request review.

@akhila-sraj akhila-sraj force-pushed the feat/profile-management branch from 2c2a062 to 51bb828 Compare May 25, 2026 05:56
@akhila-sraj

Copy link
Copy Markdown
Author

@Priyanshu-byte-coder It would be nice if you could review the work I have done as more merge conflicts are occurring with passing time

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has conflicts with the current main branch. Please rebase on main to resolve conflicts so it can be reviewed and merged. Run: git fetch upstream main && git rebase upstream/main

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with main. Please rebase:

git fetch origin
git rebase origin/main
# fix conflicts, then:
git push --force-with-lease

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with the current main branch. Please rebase on the latest main to resolve them — your contribution is labeled for GSSoC scoring.

@Priyanshu-byte-coder Priyanshu-byte-coder added the quality:clean GSSoC: Clean quality multiplier (×1.2) label Jun 4, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

Hi! This PR has merge conflicts with the main branch. Could you please rebase or merge main into your branch to resolve them? We'd love to get this merged! 🚀

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

If you're no longer working on this, let us know and we can close it. Thanks!

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with the main branch. Please rebase your branch on latest main and resolve the conflicts so it can be reviewed and merged.

@Priyanshu-byte-coder Priyanshu-byte-coder added the stale Inactive for 21+ days label Jun 16, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has been open for a long time and has merge conflicts with the current main branch. The codebase has changed significantly since this PR was opened.

If you're still interested in contributing this change, please:

  1. Rebase your branch on latest main
  2. Resolve all merge conflicts
  3. Ensure your changes still work with the current codebase

If no update is made within 2 weeks, this PR will be closed as stale.

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:advanced GSSoC: Advanced difficulty (55 pts) quality:clean GSSoC: Clean quality multiplier (×1.2) stale Inactive for 21+ days type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add user profile/settings page

2 participants