Skip to content

09 Web and Edge Platform

Vicky Patel edited this page Nov 18, 2026 · 1 revision

09. Web & Edge Platform

Vercel Serverless Go Architecture, Global Edge Caching & Responsive UI


🌐 Platform Architecture

The web edition of GitVerse (mygitverse.vercel.app) is deployed on Vercel’s global Edge network. Rather than running a monolithic long-lived Node.js or Python backend, GitVerse compiles directly into lightweight, sub-50ms cold-start Go serverless functions.

graph TD
    Client[Web Browser] --> CDN[Vercel Global Edge CDN]
    CDN -->|Static Files / Assets| EdgeStorage[Prerendered site/ & assets/]
    CDN -->|Dynamic Requests| GoFuncs[Serverless Go Handlers]

    subgraph Serverless Edge Functions (api/)
        GoFuncs --> Stars[api/stars - Edge Cached Stargazers]
        GoFuncs --> Login[api/login - OAuth Initiator]
        GoFuncs --> Callback[api/callback - Token Exchange]
        GoFuncs --> Result[api/result - Profile Intelligence Report]
        GoFuncs --> Markdown[api/markdown - Badge Generator]
    end
Loading

πŸ›£οΈ Routing & Configuration (vercel.json)

Vercel routes and rewrites incoming HTTP traffic to static files or serverless Go functions via vercel.json:

{
  "rewrites": [
    { "source": "/api/stars", "destination": "/api/stars/index.go" },
    { "source": "/auth/login", "destination": "/api/login/index.go" },
    { "source": "/auth/callback", "destination": "/api/callback/index.go" },
    { "source": "/check", "destination": "/api/result/index.go" },
    { "source": "/private", "destination": "/api/private/index.go" },
    { "source": "/badge/:user/:badge", "destination": "/api/markdown/index.go" }
  ],
  "headers": [
    {
      "source": "/api/stars",
      "headers": [
        { "key": "Cache-Control", "value": "public, s-maxage=60, stale-while-revalidate=120" }
      ]
    }
  ]
}

⚑ Edge CDN Caching Strategy

To deliver instant page loads and protect GitHub APIs from rate limiting, GitVerse implements a multi-tier caching strategy:

  1. Static Pre-Rendering: Informational pages (/achievements/, /about/, /privacy/) are compiled ahead-of-time by scripts/gendocs/ into pure static HTML files located in site/. They are served directly from edge points of presence with zero compute overhead.
  2. Dynamic Serverless Caching: Endpoints with dynamic backing data (such as /api/stars) apply strict s-maxage=60 headers. Vercel caches the response at the edge for 60 seconds; subsequent visitors within that window receive cached payloads in $<20\text{ ms}$.
  3. Background Stale-While-Revalidate: If a cached response is older than 60 seconds, Vercel serves the stale response immediately while asynchronously invoking the Go handler in the background to refresh the edge cache.

πŸ“± Responsive Aurora Interface

The front-end is built using semantic HTML5 and vanilla modern CSS (CSS variables, Flexbox, and CSS Grid) without bulky external JavaScript dependencies:

  • Mobile First: Adapts fluidly from small smartphone viewports ($\le 360\text{px}$) to ultra-wide displays ($\ge 2560\text{px}$).
  • Accessibility (a11y): Enforces WCAG 2.1 AA standards with high-contrast text, keyboard-focusable interactive elements, and ARIA labels.
  • Glassmorphism Styling: Backdrop blur filters (backdrop-filter: blur(16px)), subtle 1px border glows, and dark OLED surfaces.

Clone this wiki locally