How rowkavdev/github-profile-stats works
GitHub Profile Stats serves live, embeddable SVG and PNG cards, badges, language charts, sparklines, visit counts, and service-status views. The main workflow accepts a user or repository and display options, retrieves GitHub data, then renders an image response; builders help users preview and copy embeds. The README documents several layouts and metrics beyond the sampled route implementations. Unsampled internals are represented only where the tree or README supports the capability; uncertain wiring is omitted.
Main entry points: github.ts GitHub data access · profile/route.ts Profile and repo API · card/route.ts Stats card API · mini/route.ts Mini badge API
Components 28
Web experience
- Landing page
src/app/page.tsx - Profile page
src/app/[username]/page.tsx - Repository page
src/app/[username]/[repo]/page.tsx - Visual builder
src/components/VisualBuilder.tsx - Social card builder
src/components/ProfilePage/SocialCardBuilder.tsx - Repository card builder
src/components/RepositoryPage/RepositoryCardBuilder.tsx - Card preview
src/components/CardPreview/CardPreview.tsx
GitHub statistics
- Stats card API
src/app/api/card/route.ts - Mini badge API
src/app/api/mini/route.ts - Language chart API
src/app/api/langs/route.ts - Sparkline API
src/app/api/sparkline/route.ts - Profile and repo API
src/app/api/profile/route.ts - PNG card API
src/app/api/profile/png/route.tsx - GitHub data access
src/lib/github.ts
Image rendering
- SVG renderers
src/lib/svg/index.ts - Badge renderer
src/lib/svg/badge/index.ts - Profile card renderer
src/lib/profile-card.ts - Theme registry
src/lib/themes/themes.ts
Tracking and status
- Visit counter API
src/app/api/visits/route.ts - User count API
src/app/api/badge/route.ts - Visit tracking
src/lib/tracking.ts - Status page
src/app/status/page.tsx - Status report API
src/app/api/status/route.ts - Status collection
src/lib/status.ts - Status badge API
src/app/api/status/badge/route.ts
Other components
- Embed consumer
- GitHub API
- Redis
Connections 39
- Embed consumer → Stats card API: requests card
- Embed consumer → Mini badge API: requests badge
- Embed consumer → Language chart API: requests chart
- Embed consumer → Sparkline API: requests sparkline
- Embed consumer → Profile and repo API: requests card
- Embed consumer → PNG card API: requests PNG
- Stats card API → GitHub data access: fetches stats
- Mini badge API → GitHub data access: fetches stats
- Language chart API → GitHub data access: fetches languages
- Sparkline API → GitHub data access: fetches stats
- Profile and repo API → GitHub data access: fetches stats
- Profile and repo API → Profile card renderer: renders card
- PNG card API → GitHub data access: fetches stats
- PNG card API → Profile card renderer: renders card
- GitHub data access → GitHub API: queries
- Stats card API → SVG renderers: renders card
- Stats card API → Theme registry: resolves theme
- Mini badge API → Badge renderer: renders badge
- Mini badge API → Theme registry: resolves theme
- Language chart API → SVG renderers: renders chart
- Language chart API → Theme registry: resolves theme
- Sparkline API → SVG renderers: renders sparkline
- Sparkline API → Theme registry: resolves theme
- Visit counter API → Visit tracking: counts views
- Visit counter API → Badge renderer: renders badge
- User count API → Visit tracking: reads count
- User count API → Badge renderer: renders badge
- Visit tracking → Redis: updates counters
- Status page → Status report API: requests report
- Status report API → Status collection: collects report
- Status badge API → Status report API: fetches report
- Status badge API → Badge renderer: renders badge
- Visual builder → Card preview: configures preview
- Social card builder → Profile and repo API: previews card
- Repository card builder → Profile and repo API: previews card
- Repository card builder → PNG card API: downloads PNG
- Landing page → Visual builder: offers builder
- Profile page → Social card builder: offers builder
- Repository page → Repository card builder: offers builder