# conka8/ui architecture

> Architecture diagram of the GitHub repository conka8/ui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/conka8/ui
- Repository: https://github.com/conka8/ui

## Overview

##### Project type and purpose
- This is a mono-repo hosting two React/Vite web clients (“pure-poker” and “zk-poker”) for an online poker game.
- It provides a shared component library and domain modules (admin, clans, table, tournament, user) consumed by both apps.
- Storybook is used to develop and document UI components in isolation.

##### File structure
- Top-level “apps/” folder contains two SPA entrypoints:
- apps/pure-poker
- apps/zk-poker
- “src/” holds the shared code:
- src/components – generic UI components (avatar, chat, sidebar, etc.)
- src/context & src/hooks – React Contexts and custom hooks for state, theming, service‐worker registration, actor mutations, etc.
- src/lib – domain packages (admin, clans, table, tournament, user) each with pages, components, context, and hooks.
- Config and tooling: vite.config.ts, tailwind.config.ts, eslint.config.js, jest.config.js, Storybook settings.

##### README
- Minimal (“poker game”). All architectural cues must come from folder names and file groupings.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "apps"
        PurePoker["Pure-Poker SPA"]:::blue
        ZKPoker["ZK-Poker SPA"]:::blue
    end

    Root["Root Application Entry & Routing"]:::green

    subgraph "Shared UI Layer"
        CommonUI["Shared UI Components"]:::green
        ProfileUI["Profile & Modal Components"]:::green
        RegionModal["Region Block Modal Component"]:::green
        Storybook["Storybook Configuration"]:::gray
    end

    subgraph "Domain Modules"
        Admin["Admin Domain Module"]:::green
        Clans["Clans Domain Module"]:::green
        TableMod["Table Domain Module"]:::green
        Tournament["Tournament Domain Module"]:::green
        UserMod["User Domain Module"]:::green
    end

    subgraph "Context & Hooks"
        Context["React Context Providers"]:::yellow
        Hooks["Custom Hooks"]:::yellow
    end

    Env["Environment Constants & Helpers"]:::green
    Utils["Utility Functions & Actor Helpers"]:::yellow

    subgraph "External Canisters & Services"
        Identity["Identity Canister"]:::red
        Game["Game & Tournament Canisters"]:::red
        Analytics["Analytics Backend"]:::red
    end

    Assets["Static Assets (public/)"]:::gray

    %% Connections
    PurePoker --> Root
    ZKPoker --> Root

    Root --> Context
    Root --> Hooks
    Root --> CommonUI
    Root --> Admin
    Root --> Clans
    Root --> TableMod
    Root --> Tournament
    Root --> UserMod

    Context --> Utils
    Hooks --> Utils
    Hooks --> Identity
    Hooks --> Game
    Hooks --> Analytics

    CommonUI --> ProfileUI
    CommonUI --> RegionModal
    CommonUI --> Storybook

    PurePoker -->|"requests assets"| Assets
    ZKPoker -->|"requests assets"| Assets

    %% Click Events
    click PurePoker "https://github.com/conka8/ui/tree/main/apps/pure-poker"
    click ZKPoker "https://github.com/conka8/ui/tree/main/apps/zk-poker"
    click CommonUI "https://github.com/conka8/ui/tree/main/src/components/common"
    click ProfileUI "https://github.com/conka8/ui/tree/main/src/components/profile"
    click RegionModal "https://github.com/conka8/ui/blob/main/src/components/region-block-modal/region-block-modal.component.tsx"
    click Storybook "https://github.com/conka8/ui/blob/main/.storybook"
    click Admin "https://github.com/conka8/ui/tree/main/src/lib/admin"
    click Clans "https://github.com/conka8/ui/tree/main/src/lib/clans"
    click TableMod "https://github.com/conka8/ui/tree/main/src/lib/table"
    click Tournament "https://github.com/conka8/ui/tree/main/src/lib/tournament"
    click UserMod "https://github.com/conka8/ui/tree/main/src/lib/user"
    click Context "https://github.com/conka8/ui/tree/main/src/context"
    click Hooks "https://github.com/conka8/ui/tree/main/src/hooks"
    click Env "https://github.com/conka8/ui/blob/main/src/lib/env/constants.ts"
    click Utils "https://github.com/conka8/ui/blob/main/src/lib/utils/call-actor-mutation.ts"
    click Assets "https://github.com/conka8/ui/tree/main/public"
    click Root "https://github.com/conka8/ui/blob/main/src/App.tsx"

    %% Styles
    classDef blue fill:#cce5ff,stroke:#3399ff,stroke-width:2px
    classDef green fill:#d4edda,stroke:#28a745,stroke-width:2px
    classDef yellow fill:#fff3cd,stroke:#ffcd39,stroke-width:2px
    classDef red fill:#f8d7da,stroke:#dc3545,stroke-width:2px
    classDef gray fill:#e2e3e5,stroke:#6c757d,stroke-width:2px
```
