How blitzbugg/gitprix works
Purpose and Runtime
GitPrix is a client-facing Next.js App Router application that converts a public GitHub username into a motorsport-style collectible driver card. It runs as a single-page experience, with a server-side route acting as a narrow proxy to GitHub’s public Users API. No authentication, persistence layer, or database is present.
Primary entry points:
• app/page.tsx — application page and experience host.
• app/layout.tsx — root document/layout boundary.
• app/api/github/[username]/route.ts — GitHub profile lookup endpoint.
Experience Orchestration
The main interactive flow is concentrated in the page-level experience component. It accepts username input, drives intro/loading/error/success states, coordinates profile fetching, and exposes export/share actions once a card is assembled.
Core paths:
• app/page.tsx
• components/gitprix-experience.tsx
• app/globals.css
The UI is designed as an immersive night-race scene rather than a conventional dashboard; motion and reduced-motion behavior are part of the product experience.
GitHub Data Boundary
Browser code requests the internal dynamic API route instead of directly calling GitHub. The route resolves /api/github/:username, fetches public profile fields from GitHub, and returns data or an error response to the experience layer.
Core paths:
• app/api/github/[username]/route.ts
• types/github.ts
• components/gitprix-experience.tsx
This boundary centralizes external-service handling and keeps GitHub API URL/error semantics out of the presentation layer. It is subject to GitHub unauthenticated rate limits.
Rating and Domain Model
GitHub profile data is transformed into a driver-oriented domain model with deterministic ratings: pace, consistency, reliability, experience, versatility, and teamwork. Scores derive from public profile signals—including repository count, account age, followers/following—and a username-derived stable seed.
Core paths:
• lib/driver.ts
• types/github.ts
• components/driver-card.tsx
lib/driver.ts is the principal business-logic boundary: equivalent public profile inputs should yield equivalent driver-card values.
Visual Composition and Card Rendering
The collectible card is a distinct renderable artifact, composed from profile-derived driver data and embedded in a motorsport environment. The scene supplies circuit/stadium/pit-wall atmosphere, while the card owns the information-dense driver presentation and interactive tilt.
Core paths:
• components/driver-card.tsx
• components/ambient-scene.tsx
• components/gitprix-experience.tsx
Framer Motion and GSAP support animation/interaction; Tailwind CSS and global CSS provide styling.
Export and Sharing Output
The completed card can be rasterized into a high-resolution PNG via html-to-image. That generated image is used for download and, where browser support allows, native file sharing. X and Reddit use browser URL-based sharing flows; unsupported native image-sharing cases fall back to download.
Core paths:
• components/gitprix-experience.tsx
• components/driver-card.tsx
This is a browser capability boundary: image generation and native sharing occur client-side after the card is rendered.
Metadata and Deployment Surface
The app provides Next.js-generated icons, social images, robots, and sitemap endpoints for discoverability and link previews.
Core paths:
• app/opengraph-image.tsx
• app/twitter-image.tsx
• app/sitemap.ts
Infrastructure is standard Next.js/Node.js build and serving, configured through next.config.ts; the only named external data service is GitHub’s public API.
Main entry points: gitprix-experience.tsx GitPrix experience · page.tsx Application page · route.ts Profile lookup route · driver-card.tsx Driver card
Components 15
Browser Experience
Single-page interactive driver-card experience.
- GitPrix experience · Owns input, loading, error, success, export, and sharing states.
components/gitprix-experience.tsx - Global styling · Provides immersive race-scene and reduced-motion styling.
app/globals.css - Ambient scene · Renders circuit, stadium, and pit-wall atmosphere.
components/ambient-scene.tsx - Driver card · Presents driver data and owns interactive tilt.
components/driver-card.tsx - PNG export and sharing · Rasterizes the rendered card for download, native sharing, X, and Reddit flows.
components/gitprix-experience.tsx
Next.js Server
App routing, GitHub proxying, and metadata generation.
- Root layout
app/layout.tsx - Application page
app/page.tsx - Profile lookup route · Validates upstream results and shields presentation from GitHub API semantics.
app/api/github/[username]/route.ts - GitHub profile types
types/github.ts - Driver ratings · Deterministically derives motorsport ratings from public profile signals and a stable username seed.
lib/driver.ts - Open Graph image
app/opengraph-image.tsx - Twitter image
app/twitter-image.tsx - Sitemap
app/sitemap.ts
External Services
- GitHub Users API · Unauthenticated public-profile source subject to rate limits.
- Browser platform · Provides fetch, rendered DOM, file download, and optional native sharing.
Connections 18
- Root layout → Application page: hosts
- Application page → GitPrix experience: renders
- Global styling → GitPrix experience: styles
- GitPrix experience → Ambient scene: composes
- GitPrix experience → Driver card: renders
- GitPrix experience → Profile lookup route: fetches /api/github/:username
- Profile lookup route → GitHub Users API: requests public user
- GitHub Users API → Profile lookup route: profile or error
- GitHub profile types → Profile lookup route: defines response fields
- GitHub profile types → Driver ratings: profile input
- GitPrix experience → Driver ratings: transforms profile
- Driver ratings → Driver card: driver data
- GitPrix experience → PNG export and sharing: initiates
- Driver card → PNG export and sharing: render target
- PNG export and sharing → Browser platform: download and share APIs
- Open Graph image → Application page: link preview for
- Twitter image → Application page: social preview for
- Sitemap → Application page: indexes