> ## Documentation Index
> Fetch the complete documentation index at: https://docs.d-sports.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Games architecture

> Catalog models and play-route boundaries for team mini-games.

## Primary backend components

* `app/api/games/catalog/route.ts`
* `Game`, `TeamGame`, `TeamGameSchedule`, `FeaturedGames` in Prisma
* Play routers under `app/api/games/daily-spin`, `guess-player`, `live`, and `pick-em`
* Game Engine routers under `app/api/v1/engage/games/*`, including the locker-singularity ledger under `locker-singularity/ledger` (see [Game Engine server](/repositories/game-engine/server))
* Game Center routers under `app/api/events/*`, including `GET /api/events/realtime`
* Admin selection: `app/api/admin/teams/[teamId]/games`

## Core model touchpoints

* `Game` — catalog entry with cadence (`DAILY` / `WEEKLY`) and status
* `TeamGame` — which games a team has enabled
* `LiveGameSession`, `LiveGamePlayer`, `LiveGamePayout` — live session state
* `GuessPlayerSession` — guess-the-player session
* `SpinWheelSegment`, `DailySpinDayUsage` — daily spin configuration and usage

## High-level flow

```mermaid theme={null}
flowchart LR
  adminSelect[TeamGameSelection] --> catalog[GET /api/games/catalog]
  catalog --> nativeRender[NativeGamesSurface]
  nativeRender --> playRoute[PlayRouteByKey]
```

## Architectural notes

* The catalog is the public, cacheable mini-game discovery contract. Game Center schedule and detail live under `/api/events/*`.
* Clients map `key` to a local route. Unknown **legacy** keys must be ignored, not guessed. Engine catalog rows with an unknown key stay visible as **Update required** / **Not in this build**. See [Game Engine client](/repositories/game-engine/client).
* Admin catalog management is documented with redaction only.
