feat: added profile management page and user API#76
Conversation
|
@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. |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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-700inNavbar.tsxis hardcoded — looks wrong in light mode. Usehover:bg-[var(--control)]like the rest of the UI.DashboardHeader.tsxis 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.
akhila-sraj
left a comment
There was a problem hiding this comment.
Thanks for the review! I’ve addressed the requested changes and pushed the fixes to the same branch.
Changes made:
- Fixed
supabaseAdminnullability handling - Replaced
window.confirm()with inline confirmation UI - Removed
anyusage with proper typing - Updated hover styling and formatting issues
Also re-ran lint and build successfully.
|
@Priyanshu-byte-coder I have implemented everything you had asked for. Could you go through it once and confirm the PR |
|
Hi @akhila-sraj — this PR has merge conflicts with git fetch upstream
git rebase upstream/main
# resolve conflicts, then:
git push --force-with-leaseOnce rebased, we'll do a full review. |
99936e0 to
dee5355
Compare
|
@Priyanshu-byte-coder I have resolved all the merge conflicts. I was hoping if you could do a full review now. |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
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 pushOther issues:
-
Duplicate null-check block in
goals/route.ts**
The samesupabaseAdminnull-check is pasted twice consecutively. Remove one copy. -
Hardcoded colors in
profile/page.tsx
bg-white text-slate-900on sign-in button →bg-[var(--card)] text-[var(--card-foreground)]hover:bg-slate-100→hover:bg-[var(--control)]
session.user?.namein/api/user/route.tsfallback
username: session.githubLogin ?? session.user?.name ?? ""— usesession.githubLoginonly.user.nameis the OAuth display name, not the GitHub login.
Do NOT merge until DashboardHeader.tsx is restored.
|
@Priyanshu-byte-coder Could you check once |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
- 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.
|
@Priyanshu-byte-coder Can you check it now ? |
|
@Priyanshu-byte-coder Could you review it once I have rectified the conflicts |
|
@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 |
|
This PR has merge conflicts with |
2c2a062 to
51bb828
Compare
|
@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 |
|
This PR has conflicts with the current |
|
This PR has merge conflicts with |
|
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. |
|
Hi! This PR has merge conflicts with the git fetch upstream
git rebase upstream/main
# resolve any conflicts
git push --force-with-leaseIf you're no longer working on this, let us know and we can close it. Thanks! |
|
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. |
|
This PR has been open for a long time and has merge conflicts with the current If you're still interested in contributing this change, please:
If no update is made within 2 weeks, this PR will be closed as stale. |
Description
Implemented a complete profile management system for users.
Features Added
/profilepage for viewing account detailsGET /api/userto fetch current user informationDELETE /api/userfor account deletionTech Used
Testing Done
Fixes #15