Skip to main content
The ScoreSaber Reloaded backend is built with Elysia, a high-performance web framework running on Bun, providing REST APIs, WebSocket connections, and scheduled tasks.

Project Structure

Application Bootstrap

From index.ts:

Controller Layer

Controllers define API routes and validation:
Key features:
  • Type-safe: Zod schemas validate inputs
  • Auto-documented: OpenAPI specs generated automatically
  • Grouped routes: Logical organization with .group()

Service Layer

Services contain business logic and data access:

Caching Strategy

Redis caching with automatic serialization:
Usage example:

WebSocket Integration

Real-time score processing from external WebSockets:

Event System

Decoupled event handling:
Registering listeners:

Scheduled Tasks

Cron jobs for periodic tasks:

Error Handling

Global error handler:

Prometheus Metrics

Application monitoring:
Metrics endpoint:

Graceful Shutdown

Clean application termination: