# rsrini7/techfren-leaderboard architecture

> Architecture diagram of the GitHub repository rsrini7/techfren-leaderboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rsrini7/techfren-leaderboard
- Repository: https://github.com/rsrini7/techfren-leaderboard

## Overview

##### Project type and purpose
- This is a front-end‐only, static Next.js application (using the App Router) that generates a “coding LLM benchmark” leaderboard at build time.
- It ingests YAML data (`src/data/models.yaml`), parses it with a utility (`src/utils/yamlLoader.ts` + `js-yaml`), and outputs a fully static site (HTML/CSS/JS) hosted on Cloudflare Pages.

##### File structure
- Top-level:
- `index.html`, `next.config.js`, `wrangler.toml`, `package.json`, `tsconfig.json` – configuration for SSG, Cloudflare, TypeScript, build
- `public/` – static assets (_redirects, robots.txt)
- `src/app/` – Next.js App Router entrypoints (layout.tsx, page.tsx, global CSS)
- `src/components/` – React UI pieces (Leaderboard table, ModelDetailModal, DigitalRain effect)
- `src/data/` – YAML file with model metrics
- `src/utils/` – loader logic using Node.js fs + js-yaml

##### README for additional insights
- The app is statically exported (`output: 'export'` in `next.config.js`).
- Deployment target is Cloudflare Pages (configured via `wrangler.toml`).
- No runtime API or server-side process; all data is baked in at build time.

##### Elements
- Commit → Build → Deploy → Serve → Browser interactions
- Build process → YAML loader → Page generation
- Blue for build-time components
- Green for deployment/hosting
- Yellow for client-side/runtime

##### Detailed capture of essential architectural elements
- Developer flow: local dev → `npm run dev` → local Next.js dev server
- Production flow: commit → `npm run build` → SSG export → Cloudflare Pages publish
- Data ingestion: `src/data/models.yaml` → parsed by `src/utils/yamlLoader.ts` → props into React components
- UI: `Leaderboard` table + filters → `ModelDetailModal` → `DigitalRain` background effect

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build-Time Components
    subgraph "Build-Time" 
        direction TB
        Dev["Developer Local"]:::build
        GH["GitHub Repo"]:::build
        CI["CI/CD Build"]:::build
        NXConfig["next.config.js"]:::build
        TSConfig["tsconfig.json"]:::build
        Package["package.json"]:::build
        IndexHTML["index.html"]:::build
        Wrangler["wrangler.toml"]:::build
        ModelsYAML["models.yaml"]:::build
        YamlLoader["yamlLoader.ts"]:::build
        NextBuild["Next.js Build Process"]:::build
        AppRouter["App Router (layout.tsx, page.tsx, globals.css)"]:::build
    end

    %% Deployment Components
    subgraph "Deployment" 
        direction TB
        StaticAssets["public/"]:::deploy
        Cloudflare["Cloudflare Pages + CDN"]:::deploy
    end

    %% Client-Side Runtime
    subgraph "Client-Side" 
        direction TB
        Browser["User Browser"]:::runtime
        Leaderboard["Leaderboard.tsx"]:::runtime
        Modal["ModelDetailModal.tsx"]:::runtime
        DigitalRain["DigitalRain.tsx"]:::runtime
    end

    %% Relationships
    Dev -->|commits code| GH
    GH -->|triggers| CI
    CI -->|runs build| NextBuild
    NextBuild -->|reads config| NXConfig
    NextBuild -->|reads config| TSConfig
    NextBuild -->|reads manifest| Package
    NextBuild -->|reads fallback| IndexHTML
    NextBuild -->|reads deploy config| Wrangler
    NextBuild -->|loads data| ModelsYAML
    NextBuild -->|parses YAML| YamlLoader
    YamlLoader -->|provides props| NextBuild
    NextBuild -->|uses app router| AppRouter
    NextBuild -->|outputs| StaticAssets
    StaticAssets --> Cloudflare
    Cloudflare -->|serves static files| Browser
    Browser -->|hydrates| Leaderboard
    Browser -->|opens modal| Modal
    Browser -->|renders effect| DigitalRain

    %% Click Events
    click NXConfig "https://github.com/rsrini7/techfren-leaderboard/blob/main/next.config.js"
    click Wrangler "https://github.com/rsrini7/techfren-leaderboard/blob/main/wrangler.toml"
    click StaticAssets "https://github.com/rsrini7/techfren-leaderboard/tree/main/public/"
    click AppRouter "https://github.com/rsrini7/techfren-leaderboard/blob/main/src/app/layout.tsx"
    click AppRouter "https://github.com/rsrini7/techfren-leaderboard/blob/main/src/app/page.tsx"
    click AppRouter "https://github.com/rsrini7/techfren-leaderboard/blob/main/src/app/globals.css"
    click ModelsYAML "https://github.com/rsrini7/techfren-leaderboard/blob/main/src/data/models.yaml"
    click YamlLoader "https://github.com/rsrini7/techfren-leaderboard/blob/main/src/utils/yamlLoader.ts"
    click Leaderboard "https://github.com/rsrini7/techfren-leaderboard/blob/main/src/components/Leaderboard.tsx"
    click Modal "https://github.com/rsrini7/techfren-leaderboard/blob/main/src/components/ModelDetailModal.tsx"
    click DigitalRain "https://github.com/rsrini7/techfren-leaderboard/blob/main/src/components/DigitalRain.tsx"
    click TSConfig "https://github.com/rsrini7/techfren-leaderboard/blob/main/tsconfig.json"
    click IndexHTML "https://github.com/rsrini7/techfren-leaderboard/blob/main/index.html"
    click Package "https://github.com/rsrini7/techfren-leaderboard/blob/main/package.json"

    %% Styles
    classDef build fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef deploy fill:#90EE90,stroke:#000,stroke-width:1px
    classDef runtime fill:#FFFACD,stroke:#000,stroke-width:1px
```
