Alina Lozowski
Migrating to the React project
e7abd9e
|
raw
history blame
2.14 kB

Frontend - Open LLM Leaderboard πŸ†

React interface for exploring and comparing open-source language models.

πŸ— Architecture

flowchart TD
    Client(["User Browser"]) --> Components["React Components"]

    subgraph Frontend
        Components --> Context["Context Layer<br>β€’ LeaderboardContext<br>β€’ Global State"]

        API["API Layer<br>β€’ /api/leaderboard/formatted<br>β€’ TanStack Query"] --> |Data Feed| Context

        Context --> Hooks["Hooks Layer<br>β€’ Data Processing<br>β€’ Filtering<br>β€’ Caching"]

        Hooks --> Features["Features<br>β€’ Table Management<br>β€’ Search & Filters<br>β€’ Display Options"]
        Features --> Cache["Cache Layer<br>β€’ LocalStorage<br>β€’ URL State"]
    end

    API --> Backend["Backend Server"]

    style Backend fill:#f96,stroke:#333,stroke-width:2px

✨ Core Features

  • πŸ” Search & Filters: Real-time filtering, regex search, advanced filters
  • πŸ“Š Data Visualization: Interactive table, customizable columns, sorting
  • πŸ”„ State Management: URL sync, client-side caching (5min TTL)
  • πŸ“± Responsive Design: Mobile-friendly, dark/light themes

πŸ›  Tech Stack

  • React 18 + Material-UI
  • TanStack Query & Table
  • React Router v6

πŸ“ Project Structure

src/
β”œβ”€β”€ pages/
β”‚   └── LeaderboardPage/
β”‚       β”œβ”€β”€ components/      # UI Components
β”‚       β”œβ”€β”€ context/        # Global State
β”‚       └── hooks/          # Data Processing
β”œβ”€β”€ components/             # Shared Components
└── utils/                 # Helper Functions

πŸš€ Development

# Install dependencies
npm install

# Start development server
npm start

# Production build
npm run build

πŸ”§ Environment Variables

# API Configuration
REACT_APP_API_URL=http://localhost:8000
REACT_APP_CACHE_DURATION=300000  # 5 minutes

πŸ”„ Data Flow

  1. API fetches leaderboard data from backend
  2. Context stores and manages global state
  3. Hooks handle data processing and filtering
  4. Components render based on processed data
  5. Cache maintains user preferences and URL state