Skip to content

feat: add Supabase caching for project-admin tracker & PA role on homepage#10

Open
Ixotic27 wants to merge 16 commits into
PRODHOSH:mainfrom
Ixotic27:feat/pa-supabase-dashboard
Open

feat: add Supabase caching for project-admin tracker & PA role on homepage#10
Ixotic27 wants to merge 16 commits into
PRODHOSH:mainfrom
Ixotic27:feat/pa-supabase-dashboard

Conversation

@Ixotic27

@Ixotic27 Ixotic27 commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Adds Supabase-backed caching to the Project Admin tracker and introduces a Project Admin role on the homepage, so PAs can enter their repo and see contributor stats.

Changes

src/lib/project-admin-tracker.ts

  • Supabase delta-sync: Uses pa_repos and pa_pull_requests tables with 1-minute stampede prevention (mirrors pr-tracker.ts pattern)
  • Date-filtering: On subsequent visits, only fetches PRs updated since last sync, bypassing the 1000 PR GitHub API limit
  • Paginated fetch: Added ASC/DESC hack for repos with >1000 approved PRs (up to 2000)
  • Graceful fallback: Falls back to direct GitHub API fetch when Supabase is not configured
  • Removed unstable_cache: Supabase handles caching now

src/app/page.tsx

  • New Project Admin role: Added indigo-themed role card with FolderGit2 icon
  • Repo input: PA role shows owner/repo placeholder, validates against GitHub repos API
  • URL parsing: Accepts both owner/repo and full GitHub URLs
  • Themed UI: Indigo accent color for PA role (input border, button)

Supabase Tables Needed

CREATE TABLE pa_repos (
  repo_key TEXT PRIMARY KEY,
  last_synced_at TIMESTAMPTZ NOT NULL
);

CREATE TABLE pa_pull_requests (
  id BIGINT PRIMARY KEY,
  repo_key TEXT NOT NULL REFERENCES pa_repos(repo_key),
  raw_data JSONB NOT NULL,
  updated_at TIMESTAMPTZ
);

CREATE INDEX idx_pa_prs_repo ON pa_pull_requests(repo_key);

Testing

  • Works without Supabase (falls back to direct GitHub API)
  • With Supabase configured, first visit syncs all PRs, subsequent visits only delta-sync
  • Home page correctly routes to /project-admin/owner/repo

Ixotic27 added 10 commits June 26, 2026 10:09
…nonicalize login matching, and encode URL components
…epage

- project-admin-tracker.ts: Added Supabase delta-sync with date-filtering to bypass 1000 PR GitHub API limit. Uses pa_repos and pa_pull_requests tables with 1-minute cache stampede prevention. Falls back to direct GitHub API when Supabase is not configured.

- page.tsx: Added 'Project Admin' role card to the home page. PAs enter owner/repo format (or paste GitHub URL) to navigate to /project-admin/owner/repo. Includes repo validation, indigo theming for PA role, and appropriate placeholder/icon changes.
Copilot AI review requested due to automatic review settings June 29, 2026 05:51
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@Ixotic27 is attempting to deploy a commit to the prodhoshvs2025-8980's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gssoc-tracker Ready Ready Preview, Comment Jul 3, 2026 6:31pm

@PRODHOSH

Copy link
Copy Markdown
Owner

@Ixotic27 thanks for raising the pr
image
the current formula ur using, is it the correct one?
cause for pr closed/opened ur counting 130 100 points
can u pls check the formula and update it
image

and next up pls add pagination for the below part
image

and update the points system u used in this pop up
image

Thanks!

@Ixotic27

Ixotic27 commented Jun 29, 2026

Copy link
Copy Markdown
Author

@Ixotic27 thanks for raising the pr image the current formula ur using, is it the correct one? cause for pr closed/opened ur counting 130 100 points can u pls check the formula and update it image

and next up pls add pagination for the below part image

and update the points system u used in this pop up image

Thanks!

@Ixotic27 Ok i will check also can you please share the website link from where you have got the formulas so that i can cross check

@PRODHOSH

Copy link
Copy Markdown
Owner

@Ixotic27 scroll thru the end of the leaderboard in gssoc website. its ther

@Ixotic27

Copy link
Copy Markdown
Author

@Ixotic27 scroll thru the end of the leaderboard in gssoc website. its ther

ok

@Ixotic27

Copy link
Copy Markdown
Author

@PRODHOSH thanks for the review! I've updated the PR with all the requested fixes:

  1. Points Formula Fixes:
    • Zeroed out contributor points for non-merged (open / closed unmerged) PRs in the details page.
    • Refined the Project Admin point calculations to only count truly merged PRs (is:merged) and restricted the issue resolution boost calculation to GSSoC-specific issues with difficulty labels (level:).
  2. Truncated Pagination:
    • Replaced the listing of all page buttons at the bottom of the PR table with a clean truncated window (← 1 … 49 50 51 … 103 →), limiting the visible pages to at most 7 buttons.
  3. Scoring Guide Popup:
    • Updated the points description in the scoring guide popup to match the official system exactly (removed the ~ prefix), cleaned up the disclaimer text, and added the contributor PR points formula.
  4. Rate Limit Prevention:
    • Routed client-side lookups through a server API route /api/github-user to leverage the GH_TOKEN securely and avoid rate-limiting issues for the end user.

@Ixotic27

Ixotic27 commented Jul 3, 2026

Copy link
Copy Markdown
Author

@PRODHOSH, @claude any update

@PRODHOSH

PRODHOSH commented Jul 3, 2026

Copy link
Copy Markdown
Owner

@PRODHOSH thanks for the review! I've updated the PR with all the requested fixes:

  1. Points Formula Fixes:

    • Zeroed out contributor points for non-merged (open / closed unmerged) PRs in the details page.
    • Refined the Project Admin point calculations to only count truly merged PRs (is:merged) and restricted the issue resolution boost calculation to GSSoC-specific issues with difficulty labels (level:).
  2. Truncated Pagination:

    • Replaced the listing of all page buttons at the bottom of the PR table with a clean truncated window (← 1 … 49 50 51 … 103 →), limiting the visible pages to at most 7 buttons.
  3. Scoring Guide Popup:

    • Updated the points description in the scoring guide popup to match the official system exactly (removed the ~ prefix), cleaned up the disclaimer text, and added the contributor PR points formula.
  4. Rate Limit Prevention:

    • Routed client-side lookups through a server API route /api/github-user to leverage the GH_TOKEN securely and avoid rate-limiting issues for the end user.

Hey, i dont think u commited in this pr man
I'm not able to see any of these changes here

@Ixotic27

…d to integrate project admin page and activity tracking
@PRODHOSH

PRODHOSH commented Jul 3, 2026

Copy link
Copy Markdown
Owner

@Ixotic27 now ur commits are reflected here
pls fix the merge conflicts alone

@Ixotic27

Ixotic27 commented Jul 3, 2026

Copy link
Copy Markdown
Author

@Ixotic27 now ur commits are reflected here pls fix the merge conflicts alone

sorry i force pushed into closed pr
fixing the merge conflict now

@Ixotic27

Ixotic27 commented Jul 3, 2026

Copy link
Copy Markdown
Author

@PRODHOSH fixed the merge conflict

@Ixotic27

Ixotic27 commented Jul 9, 2026

Copy link
Copy Markdown
Author

@PRODHOSH any updates?

@PRODHOSH

Copy link
Copy Markdown
Owner

hi so i think for project admins the best thing is we move into a seperate app
cause the supabase 500mb limit is getting close just on the contributors data
thats why i dint merge this pr

since contributors are the main thing here let this app live alone for them
and i think if u can deploy ur version with my repo but only for the project admin would be better
and in my app i can redirect to urs

@Ixotic27
wat do u say

@PRODHOSH

Copy link
Copy Markdown
Owner

so basically with ur updated changes
remove the contirbutors and mentors logic
and deploy in vercel just for project admins

from my side, i will put a project admin to redirect to urs
@Ixotic27 i hope thats fine

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants