# keremkuyucu/okeydefteri architecture

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

- Interactive diagram: https://gitdiagram.com/keremkuyucu/okeydefteri
- Repository: https://github.com/keremkuyucu/okeydefteri

## Overview

Okey Defteri is a Flutter app for keeping scores during in-person Okey matches. A player opens the dashboard, sets up a game, records round scores on the live board, and can review results in history and statistics. The README also documents game rules, tile calculation, dynamic nicknames, localization, preferences, automatic local saves, JSON backup, and optional anonymous telemetry. Paths identify relevant modules from the tree; Dart implementation details were not sampled, so edges rely on README statements and omit unverified call relationships.

Main entry points: [`lib/screens/game_screen.dart`](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/game_screen.dart) (Live game board), [`lib/services/settings_service.dart`](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/settings_service.dart) (Settings), [`lib/screens/new_game_screen.dart`](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/new_game_screen.dart) (Game setup), [`lib/main.dart`](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/main.dart) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Match play"]
  node_setup["Game setup"]
  node_live["Live game board<br/>[game_screen.dart]"]
  node_score_entry["Score entry"]
  node_game_models["Game and score models<br/>[game_models.dart]"]
  node_rules_models["Rule models"]
  node_game_rules["Game rules"]
  node_americano["Americano game"]
  node_nicknames["Dynamic nicknames"]
end

subgraph group_insights["History and insights"]
  node_past_games["Past games"]
  node_score_history["Score history"]
  node_stats["Player and team stats<br/>[stats_screen.dart]"]
  node_career["Career view<br/>[career_screen.dart]"]
  node_score_models["Score models<br/>[score_models.dart]"]
  node_profiles["Player profiles"]
end

subgraph group_services["App services"]
  node_storage[("Local game storage")]
  node_cloud["Cloud backup<br/>[cloud_service.dart]"]
  node_settings["Settings"]
  node_localization["Localization"]
  node_telemetry["Anonymous telemetry"]
  node_ad_service["Ads<br/>[ad_service.dart]"]
end

subgraph group_presentation["App presentation"]
  node_app["App entry<br/>[main.dart]"]
  node_home["Home dashboard<br/>[home_screen.dart]"]
end

node_player(("Player"))

node_player -->|"opens"| node_app
node_app -->|"shows dashboard"| node_home
node_home -->|"starts game"| node_setup
node_setup -->|"begins match"| node_live
node_live -->|"enters scores"| node_score_entry
node_live -->|"auto-saves game"| node_storage
node_player -->|"browses games"| node_past_games
node_player -->|"reviews rounds"| node_score_history
node_player -->|"reviews performance"| node_stats
node_player -->|"views rules"| node_game_rules
node_player -->|"backs up data"| node_cloud
node_player -->|"changes preferences"| node_settings
node_settings -->|"selects language"| node_localization
node_settings -->|"controls telemetry"| node_telemetry
node_live -->|"shows nicknames"| node_nicknames

click node_app "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/main.dart"
click node_home "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/home_screen.dart"
click node_setup "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/new_game_screen.dart"
click node_live "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/game_screen.dart"
click node_score_entry "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/widgets/score_input_dialog.dart"
click node_game_models "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/models/game_models.dart"
click node_rules_models "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/models/game_rules_models.dart"
click node_game_rules "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/game_rules_screen.dart"
click node_americano "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/americano_game_screen.dart"
click node_past_games "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/past_games_screen.dart"
click node_score_history "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/score_history_screen.dart"
click node_stats "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/stats_screen.dart"
click node_career "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/career_screen.dart"
click node_score_models "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/models/score_models.dart"
click node_profiles "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/models/player_profile_models.dart"
click node_storage "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/storage_service.dart"
click node_cloud "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/cloud_service.dart"
click node_settings "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/settings_service.dart"
click node_localization "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/localization_service.dart"
click node_telemetry "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/telemetry_service.dart"
click node_nicknames "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/toxic_nickname_service.dart"
click node_ad_service "https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/ad_service.dart"

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_setup,node_live,node_score_entry,node_game_models,node_rules_models,node_game_rules,node_americano,node_nicknames toneBlue
class node_past_games,node_score_history,node_stats,node_career,node_score_models,node_profiles toneAmber
class node_storage,node_cloud,node_settings,node_localization,node_telemetry,node_ad_service toneMint
class node_app,node_home toneRose
class node_player toneIndigo
```

## Components

### Match play

- [Game setup](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/new_game_screen.dart): `lib/screens/new_game_screen.dart`
- [Live game board](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/game_screen.dart): `lib/screens/game_screen.dart`
- [Score entry](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/widgets/score_input_dialog.dart): `lib/widgets/score_input_dialog.dart`
- [Game and score models](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/models/game_models.dart): `lib/models/game_models.dart`
- [Rule models](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/models/game_rules_models.dart): `lib/models/game_rules_models.dart`
- [Game rules](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/game_rules_screen.dart): `lib/screens/game_rules_screen.dart`
- [Americano game](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/americano_game_screen.dart): `lib/screens/americano_game_screen.dart`
- [Dynamic nicknames](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/toxic_nickname_service.dart): `lib/services/toxic_nickname_service.dart`

### History and insights

- [Past games](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/past_games_screen.dart): `lib/screens/past_games_screen.dart`
- [Score history](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/score_history_screen.dart): `lib/screens/score_history_screen.dart`
- [Player and team stats](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/stats_screen.dart): `lib/screens/stats_screen.dart`
- [Career view](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/career_screen.dart): `lib/screens/career_screen.dart`
- [Score models](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/models/score_models.dart): `lib/models/score_models.dart`
- [Player profiles](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/models/player_profile_models.dart): `lib/models/player_profile_models.dart`

### App services

- [Local game storage](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/storage_service.dart): `lib/services/storage_service.dart`
- [Cloud backup](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/cloud_service.dart): `lib/services/cloud_service.dart`
- [Settings](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/settings_service.dart): `lib/services/settings_service.dart`
- [Localization](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/localization_service.dart): `lib/services/localization_service.dart`
- [Anonymous telemetry](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/telemetry_service.dart): `lib/services/telemetry_service.dart`
- [Ads](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/services/ad_service.dart): `lib/services/ad_service.dart`

### App presentation

- [App entry](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/main.dart): `lib/main.dart`
- [Home dashboard](https://github.com/keremkuyucu/okeydefteri/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`

### Other components

- **Player**

## Connections

- Player → App entry: opens (evidence: `README.md`)
- App entry → Home dashboard: shows dashboard (evidence: `README.md`)
- Home dashboard → Game setup: starts game (evidence: `README.md`)
- Game setup → Live game board: begins match (evidence: `README.md`)
- Live game board → Score entry: enters scores (evidence: `README.md`)
- Live game board → Local game storage: auto-saves game (evidence: `README.md`)
- Player → Past games: browses games (evidence: `README.md`)
- Player → Score history: reviews rounds (evidence: `README.md`)
- Player → Player and team stats: reviews performance (evidence: `README.md`)
- Player → Game rules: views rules (evidence: `README.md`)
- Player → Cloud backup: backs up data (evidence: `README.md`)
- Player → Settings: changes preferences (evidence: `README.md`)
- Settings → Localization: selects language (evidence: `README.md`)
- Settings → Anonymous telemetry: controls telemetry (evidence: `README.md`)
- Live game board → Dynamic nicknames: shows nicknames (evidence: `README.md`)
