# xlaugh/open-eleven architecture

> Architecture diagram of the GitHub repository xlaugh/open-eleven, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xlaugh/open-eleven
- Repository: https://github.com/xlaugh/open-eleven

## Overview

Open Eleven is a browser-based football career game. Players create a footballer, progress through choice-driven seasons and decisive match moments, then build a legacy; daily challenges and duels add competitive modes. The browser game separates interface, simulation rules, and game content, while optional cloud features support accounts and server-verified scores. The graph reflects documented calls and data relationships; some README-described capabilities have no sampled implementation links, so those connections are left out rather than inferred.

Main entry points: [`data.js`](https://github.com/xlaugh/open-eleven/blob/main/data.js) (Countries and career data), [`supabase/functions/submit-daily/index.ts`](https://github.com/xlaugh/open-eleven/blob/main/supabase/functions/submit-daily/index.ts) (Daily challenge scoring), [`supabase/functions/submit-duel/index.ts`](https://github.com/xlaugh/open-eleven/blob/main/supabase/functions/submit-duel/index.ts) (Duel scoring), [`game.js`](https://github.com/xlaugh/open-eleven/blob/main/game.js) (Game interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Career gameplay"]
  node_game["Game interface<br/>[game.js]"]
  node_simulation["Career simulation<br/>[engine.js]"]
  node_decisive["Match moments<br/>[data-moments.js]"]
  node_localization["Localization<br/>[i18n.js]"]
end

subgraph group_content["Game content"]
  node_career_events["Career events<br/>[data-events.js]"]
  node_world_data["Countries and career data<br/>[data.js]"]
  node_club_data["Club pyramid<br/>[data-clubs.js]"]
end

subgraph group_online["Online features"]
  node_account["Account and progression<br/>[account.js]"]
  node_daily["Daily challenge scoring<br/>[index.ts]"]
  node_duels["Duel scoring<br/>[index.ts]"]
  node_room["Rooms<br/>[room.js]"]
end

subgraph group_shared["Shared services"]
  node_server_engine["Shared score engine<br/>[game-engine.ts]"]
end

node_player(("Player"))
node_supabase[("Supabase")]

node_player -->|"plays"| node_game
node_game -->|"uses"| node_simulation
node_world_data -->|"loads"| node_club_data
node_world_data -->|"loads"| node_career_events
node_world_data -->|"loads"| node_decisive
node_daily -->|"loads and scores"| node_server_engine
node_duels -->|"loads and scores"| node_server_engine
node_daily -->|"stores scores"| node_supabase
node_duels -->|"stores duels"| node_supabase
node_account -.->|"syncs progress"| node_supabase

click node_game "https://github.com/xlaugh/open-eleven/blob/main/game.js"
click node_simulation "https://github.com/xlaugh/open-eleven/blob/main/engine.js"
click node_decisive "https://github.com/xlaugh/open-eleven/blob/main/data-moments.js"
click node_career_events "https://github.com/xlaugh/open-eleven/blob/main/data-events.js"
click node_world_data "https://github.com/xlaugh/open-eleven/blob/main/data.js"
click node_club_data "https://github.com/xlaugh/open-eleven/blob/main/data-clubs.js"
click node_localization "https://github.com/xlaugh/open-eleven/blob/main/i18n.js"
click node_account "https://github.com/xlaugh/open-eleven/blob/main/account.js"
click node_daily "https://github.com/xlaugh/open-eleven/blob/main/supabase/functions/submit-daily/index.ts"
click node_duels "https://github.com/xlaugh/open-eleven/blob/main/supabase/functions/submit-duel/index.ts"
click node_room "https://github.com/xlaugh/open-eleven/blob/main/room.js"
click node_server_engine "https://github.com/xlaugh/open-eleven/blob/main/supabase/functions/_shared/game-engine.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_game,node_simulation,node_decisive,node_localization toneBlue
class node_career_events,node_world_data,node_club_data,node_supabase toneAmber
class node_account,node_daily,node_duels,node_room toneMint
class node_server_engine toneRose
class node_player toneIndigo
```

## Components

### Career gameplay

- [Game interface](https://github.com/xlaugh/open-eleven/blob/main/game.js): `game.js`
- [Career simulation](https://github.com/xlaugh/open-eleven/blob/main/engine.js): `engine.js`
- [Match moments](https://github.com/xlaugh/open-eleven/blob/main/data-moments.js): `data-moments.js`
- [Localization](https://github.com/xlaugh/open-eleven/blob/main/i18n.js): `i18n.js`

### Game content

- [Career events](https://github.com/xlaugh/open-eleven/blob/main/data-events.js): `data-events.js`
- [Countries and career data](https://github.com/xlaugh/open-eleven/blob/main/data.js): `data.js`
- [Club pyramid](https://github.com/xlaugh/open-eleven/blob/main/data-clubs.js): `data-clubs.js`

### Online features

- [Account and progression](https://github.com/xlaugh/open-eleven/blob/main/account.js): `account.js`
- [Daily challenge scoring](https://github.com/xlaugh/open-eleven/blob/main/supabase/functions/submit-daily/index.ts): `supabase/functions/submit-daily/index.ts`
- [Duel scoring](https://github.com/xlaugh/open-eleven/blob/main/supabase/functions/submit-duel/index.ts): `supabase/functions/submit-duel/index.ts`
- [Rooms](https://github.com/xlaugh/open-eleven/blob/main/room.js): `room.js`

### Shared services

- [Shared score engine](https://github.com/xlaugh/open-eleven/blob/main/supabase/functions/_shared/game-engine.ts): `supabase/functions/_shared/game-engine.ts`

### Other components

- **Player**
- **Supabase**

## Connections

- Player → Game interface: plays (evidence: `README.md`)
- Game interface → Career simulation: uses (evidence: `engine.js`)
- Countries and career data → Club pyramid: loads (evidence: `data.js`)
- Countries and career data → Career events: loads (evidence: `data.js`)
- Countries and career data → Match moments: loads (evidence: `data.js`)
- Daily challenge scoring → Shared score engine: loads and scores (evidence: `supabase/functions/submit-daily/index.ts`)
- Duel scoring → Shared score engine: loads and scores (evidence: `supabase/functions/submit-duel/index.ts`)
- Daily challenge scoring → Supabase: stores scores (evidence: `supabase/functions/submit-daily/index.ts`)
- Duel scoring → Supabase: stores duels (evidence: `supabase/functions/submit-duel/index.ts`)
- Account and progression → Supabase: syncs progress (evidence: `README.md`)
