Skip to content

[REFACTOR] Optimize fetchGitHubUser with parallel requests #386

Description

@github-actions

Problem Statement

Profile pages are loading slowly because we fetch user data, repositories, organizations, and contributions sequentially.

Proposed Solution

Refactor the data fetching logic in src/app/[username]/page.tsx and src/lib/profile-data.ts to use Promise.all or Promise.allSettled. This will allow all external GitHub API requests to fire simultaneously, significantly reducing the Time to First Byte (TTFB).

Alternatives Considered

None. Parallelizing independent network requests is a standard optimization.

Additional Context

Be mindful of error handling. If one promise fails (e.g., organizations API returns 500), it shouldn't crash the entire profile page.

Metadata

Metadata

Labels

ADVENTURERIntermediate — 25 ptsELUSOCELUSOC project submissionrefactor

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions