GitHub Ranking is a Next.js 16 web application that displays rankings of GitHub repositories, users, and organizations by stars, forks, and followers. Uses the GitHub Search API via Octokit.
pnpm dev # Start development server at localhost:3000
pnpm build # Build for production
pnpm lint # Run ESLint
pnpm start # Start production serverCopy .example.env to .env.local and add a GitHub personal access token:
GITHUB_ACCESS_TOKEN="your_token"
- Server Actions (
api/index.ts) - Octokit-based functions with'use server'directive call GitHub API - SWR Hooks (
hooks/use-github-api.ts) - Client-side data fetching with 24-hour cache - Pages (
app/) - Client components that consume hooks
api/- Server actions wrapping GitHub API calls (getTopReposAsync, getTopUsersAsync, etc.)hooks/- SWR hooks for all data fetchingcontext/- LanguageProvider fetches and shares available programming languages globallycomponents/ui/- shadcn/ui components (radix-lyra style, hugeicons icons)app/repositories/_components/- Repository page-specific components
- Organizations page (
app/organizations/) reusesUserTablefrom users page withUSER_TYPE.ORGANIZATION - GitHub API limits search results to 1000 items max (
MAX_DATA_COUNTin constants) - Language list is fetched from GitHub Linguist's YAML file
Use @/ for imports from project root (configured in tsconfig.json).