# wlcharlie/work-on-time-game architecture

> Architecture diagram of the GitHub repository wlcharlie/work-on-time-game, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wlcharlie/work-on-time-game
- Repository: https://github.com/wlcharlie/work-on-time-game

## Overview

##### Project type and purpose
- This is a cross-platform Flutter application (“work_on_time_game”), a casual time-management game that runs on Android, iOS, Linux, macOS, Windows and Web.
- The README confirms it’s a starter Flutter project; the code under lib/ implements UI screens, game components, state providers, assets, and orchestration.

##### File structure
- Top-level directories:
- android, ios, linux, macos, windows, web → platform runners and native glue (Gradle, Xcode, CMake, plugin registrants)
- lib/ → all Dart code, subdivided into components, config, models, overlays, providers, routes, screen, plus main.dart and wot_game.dart
- assets/ → audio, fonts, images categorized by scene
- pubspec.yaml → dependency, asset, and Flutter SDK configuration
- Architectural patterns:
- UI organized by screens (lib/screen/…), overlays (lib/overlays/…), and components (lib/components/…)
- State management via generated Riverpod providers (lib/providers/)
- Config and model layers are separated (lib/config/, lib/models/)
- No external backend service or database—pure client-side game logic.

##### Key insights from README
- Relies on Flutter’s widget tree and asset bundling.

##### Detailed capture of essential elements
- Don’t omit the platform embedders—they illustrate cross-platform support.
- Code-gen artifacts under providers to highlight build-time generation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Platform Runners"
        AndroidRunner["Android Runner"]:::platform
        iOSRunner["iOS Runner"]:::platform
        LinuxRunner["Linux Runner"]:::platform
        macOSRunner["macOS Runner"]:::platform
        WindowsRunner["Windows Runner"]:::platform
        WebRunner["Web Runner"]:::platform
    end

    AndroidRunner -->|"embeds"| FlutterEngine
    iOSRunner -->|"embeds"| FlutterEngine
    LinuxRunner -->|"embeds"| FlutterEngine
    macOSRunner -->|"embeds"| FlutterEngine
    WindowsRunner -->|"embeds"| FlutterEngine
    WebRunner -->|"embeds"| FlutterEngine

    FlutterEngine["Flutter Engine"]:::engine -->|"hosts"| DartRuntime
    DartRuntime["Dart Runtime & Isolates"]:::engine -->|"runs entry"| DartEntry

    subgraph "Application Code"
        subgraph "Entry & Orchestrator"
            DartEntry["main.dart"]:::entry
            GameOrch["wot_game.dart"]:::orchestrator
        end

        DartEntry -->|"invokes"| GameOrch

        subgraph "Layers"
            subgraph "UI Layer"
                Screens["Screens\n(lib/screen/)"]:::ui
                Overlays["Overlays\n(lib/overlays/)"]:::ui
                Components["Components\n(lib/components/)"]:::ui
            end
            State["State Layer\n(lib/providers/)"]:::state
            Config["Config Layer\n(lib/config/)"]:::domain
            Model["Model Layer\n(lib/models/)"]:::domain
            subgraph "Asset Store"
                Audio["Audio\n(assets/audio/)"]:::assets
                Fonts["Fonts\n(assets/fonts/)"]:::assets
                Images["Images\n(assets/images/)"]:::assets
            end
        end

        GameOrch -->|"initializes"| State
        GameOrch -->|"builds"| Screens
        Screens -->|"uses"| State
        Overlays -->|"uses"| State
        Components -->|"uses"| State
        State -->|"notifies"| Screens
        Screens -->|"renders assets"| Audio
        Screens -->|"renders assets"| Fonts
        Screens -->|"renders assets"| Images
    end

    classDef platform fill:#cccccc,stroke:#333,stroke-width:1px
    classDef engine fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef entry fill:#E0FFFF,stroke:#333,stroke-width:1px
    classDef orchestrator fill:#B0E0E6,stroke:#333,stroke-width:1px
    classDef ui fill:#98FB98,stroke:#333,stroke-width:1px
    classDef state fill:#FFA500,stroke:#333,stroke-width:1px
    classDef domain fill:#FFFFE0,stroke:#333,stroke-width:1px
    classDef assets fill:#DDA0DD,stroke:#333,stroke-width:1px

    click AndroidRunner "https://github.com/wlcharlie/work-on-time-game/blob/main/android/app/src/main/kotlin/com/example/work_on_time_game/MainActivity.kt"
    click iOSRunner "https://github.com/wlcharlie/work-on-time-game/blob/main/ios/Runner/AppDelegate.swift"
    click LinuxRunner "https://github.com/wlcharlie/work-on-time-game/blob/main/linux/runner/main.cc"
    click macOSRunner "https://github.com/wlcharlie/work-on-time-game/blob/main/macos/Runner/AppDelegate.swift"
    click WindowsRunner "https://github.com/wlcharlie/work-on-time-game/blob/main/windows/runner/flutter_window.cpp"
    click WebRunner "https://github.com/wlcharlie/work-on-time-game/blob/main/web/index.html"
    click DartEntry "https://github.com/wlcharlie/work-on-time-game/blob/main/lib/main.dart"
    click GameOrch "https://github.com/wlcharlie/work-on-time-game/blob/main/lib/wot_game.dart"
    click Screens "https://github.com/wlcharlie/work-on-time-game/tree/main/lib/screen/"
    click Overlays "https://github.com/wlcharlie/work-on-time-game/tree/main/lib/overlays/"
    click Components "https://github.com/wlcharlie/work-on-time-game/tree/main/lib/components/"
    click State "https://github.com/wlcharlie/work-on-time-game/blob/main/lib/providers/global.dart"
    click State "https://github.com/wlcharlie/work-on-time-game/blob/main/lib/providers/global.g.dart"
    click State "https://github.com/wlcharlie/work-on-time-game/blob/main/lib/providers/inventory.dart"
    click State "https://github.com/wlcharlie/work-on-time-game/blob/main/lib/providers/inventory.g.dart"
    click Config "https://github.com/wlcharlie/work-on-time-game/tree/main/lib/config/"
    click Model "https://github.com/wlcharlie/work-on-time-game/tree/main/lib/models/"
    click Audio "https://github.com/wlcharlie/work-on-time-game/tree/main/assets/audio/"
    click Fonts "https://github.com/wlcharlie/work-on-time-game/tree/main/assets/fonts/"
    click Images "https://github.com/wlcharlie/work-on-time-game/tree/main/assets/images/"
```
