Skip to main content
The ScoreSaber Reloaded frontend is a modern Next.js 16 application using the App Router architecture with React 19.

Project Structure

Next.js Configuration

From next.config.ts:

Routing Strategy

Route Groups

Next.js uses route groups to organize layouts without affecting URLs:

Dynamic Routes

Player profiles use dynamic routing:

Catch-all Routes

Rankings support optional segments:

State Management

1. TanStack Query (Server State)

Manages all API data fetching and caching:
Usage example:

2. Dexie (Client Persistence)

IndexedDB wrapper for offline-first user data:
Settings stored in Dexie:
  • Main player ID
  • Friends list
  • Background preferences
  • Overlay settings
  • Chart legend states

3. Zustand (Global State)

Lightweight state management for UI state:

4. React Context

For component-tree scoped state:

Component Architecture

Root Layout

Provider hierarchy:
  1. LazyMotion: Lazy-loads Framer Motion features
  2. PageTransitionProvider: Smooth page transitions
  3. ViewportProvider: Responsive breakpoint detection
  4. QueryProvider: TanStack Query client

Custom Hooks

Reusable logic extraction:

API Integration

All API calls go through the shared @ssr/common package:

Real-time Features

WebSocket Integration

Performance Optimizations

1. React Compiler

Automatic memoization eliminates manual useMemo/useCallback:

2. Code Splitting

Dynamic imports for heavy components:

3. Image Optimization

Styling

Tailwind CSS

Utility-first styling with v4:

Radix UI Components

Accessible primitives with custom styling:

Build Output

Standalone build for Docker:
This creates a self-contained application with all dependencies bundled.