# kkutuio/kkutu-web architecture

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

- Interactive diagram: https://gitdiagram.com/kkutuio/kkutu-web
- Repository: https://github.com/kkutuio/kkutu-web

## Overview

KKuTuIO-Web is the web application and service layer for the KKuTu word game, paired with Svelte frontends and a Spring/Kotlin backend. A typical user flow enters through the portal, authenticates, establishes a game session, and connects to a game server; the repository also covers account security, rankings, records, moderation, shop, and Academy practice. The README establishes compatibility with the game server. Several frontend routes and backend subsystems are represented by their exact directories because their implementation was not sampled; their connections are therefore omitted or marked unverified.

Main entry points: [`src/main/kotlin/me/kkutuio/kkutuweb/game/GameClientManager.kt`](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/game/GameClientManager.kt) (Game clients), [`src/main/kotlin/me/kkutuio/kkutuweb/login/LoginService.kt`](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/login/LoginService.kt) (Login flow), [`src/main/kotlin/me/kkutuio/kkutuweb/oauth`](https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/oauth) (OAuth providers), [`Frontpage/src/lib/academy/EnginePanel.svelte`](https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/EnginePanel.svelte) (Academy panels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_portal["Game portal"]
  node_webapp["Web pages"]
  node_entry["App entry<br/>[App.jsx]"]
  node_loginui["Login UI<br/>[Login.jsx]"]
  node_setupui["Setup UI<br/>[Setup.jsx]"]
end

subgraph group_identity["Identity"]
  node_login["Login flow<br/>[LoginService.kt]"]
  node_oauth["OAuth providers"]
  node_oauthbase["OAuth service<br/>[OAuthService.kt]"]
  node_account["Account security"]
  node_identitydb[("Identity data<br/>[IdentityDao.kt]")]
end

subgraph group_game["Game services"]
  node_backend["Web API"]
  node_sessions["Game sessions<br/>[SessionService.kt]"]
  node_gameclients["Game clients"]
  node_gameclient["Game client<br/>[GameClient.kt]"]
  node_records["Game records"]
  node_ranking["Rankings"]
end

subgraph group_academy["Academy"]
  node_academyui["Academy panels<br/>[EnginePanel.svelte]"]
  node_academycl["Academy client<br/>[academyClient.js]"]
  node_academyapi["Academy API<br/>[api.js]"]
  node_academyworker["Academy worker<br/>[academy.worker.js]"]
  node_academyengine["Word game engine"]
end

subgraph group_operations["Operations"]
  node_moderation["Moderation"]
  node_policies["Moderation policy"]
  node_shop["Shop services"]
end

node_player(("Player"))
node_gamehost{{"KKuTu game server"}}
node_provider{{"OAuth provider"}}

node_player -.->|"opens"| node_portal
node_player -.->|"uses"| node_webapp
node_entry -->|"routes to"| node_portal
node_loginui -.->|"submits login"| node_login
node_setupui -.->|"submits setup"| node_backend
node_login -->|"authenticates with"| node_oauth
node_oauth -->|"extends"| node_oauthbase
node_oauth -->|"requests identity"| node_provider
node_login -->|"uses account security"| node_account
node_account -->|"reads and writes"| node_identitydb
node_backend -.->|"provides sessions"| node_sessions
node_sessions -.->|"issues game access"| node_gameclients
node_gameclients -->|"manages"| node_gameclient
node_gameclients -->|"uses record bridge"| node_records
node_gamehost -.->|"compatible connection"| node_gameclients
node_academyui -->|"uses"| node_academycl
node_academyui -->|"requests"| node_academyapi
node_academycl -.->|"dispatches"| node_academyworker
node_academyworker -->|"runs"| node_academyengine
node_moderation -->|"evaluates"| node_policies
node_moderation -->|"disconnects players"| node_gameclients

click node_webapp "https://github.com/kkutuio/kkutu-web/tree/kkutuio/Frontpage/src/routes"
click node_entry "https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/static/js/App.jsx"
click node_loginui "https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/static/js/pages/login/Login.jsx"
click node_setupui "https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/static/js/pages/setup/Setup.jsx"
click node_backend "https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb"
click node_login "https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/login/LoginService.kt"
click node_oauth "https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/oauth"
click node_oauthbase "https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/oauth/OAuthService.kt"
click node_account "https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/identity/AccountSecurityService.kt"
click node_identitydb "https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/identity/IdentityDao.kt"
click node_sessions "https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/session/SessionService.kt"
click node_gameclients "https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/game/GameClientManager.kt"
click node_gameclient "https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/game/GameClient.kt"
click node_records "https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/record"
click node_ranking "https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/ranking"
click node_academyui "https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/EnginePanel.svelte"
click node_academycl "https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/academyClient.js"
click node_academyapi "https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/api.js"
click node_academyworker "https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/academy.worker.js"
click node_academyengine "https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/academy-engine-core.js"
click node_moderation "https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/moderation/ModerationService.kt"
click node_policies "https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/moderation/policy/ModerationPolicyEngine.kt"
click node_shop "https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/shop"

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_portal,node_webapp,node_entry,node_loginui,node_setupui toneBlue
class node_login,node_oauth,node_oauthbase,node_account,node_identitydb toneAmber
class node_backend,node_sessions,node_gameclients,node_gameclient,node_records,node_ranking,node_gamehost toneMint
class node_academyui,node_academycl,node_academyapi,node_academyworker,node_academyengine toneRose
class node_moderation,node_policies,node_shop,node_player,node_provider toneIndigo
```

## Components

### Web experience

- **Game portal**
- [Web pages](https://github.com/kkutuio/kkutu-web/tree/kkutuio/Frontpage/src/routes): `Frontpage/src/routes`
- [App entry](https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/static/js/App.jsx): `Frontpage/static/js/App.jsx`
- [Login UI](https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/static/js/pages/login/Login.jsx): `Frontpage/static/js/pages/login/Login.jsx`
- [Setup UI](https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/static/js/pages/setup/Setup.jsx): `Frontpage/static/js/pages/setup/Setup.jsx`

### Identity

- [Login flow](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/login/LoginService.kt): `src/main/kotlin/me/kkutuio/kkutuweb/login/LoginService.kt`
- [OAuth providers](https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/oauth): `src/main/kotlin/me/kkutuio/kkutuweb/oauth`
- [OAuth service](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/oauth/OAuthService.kt): `src/main/kotlin/me/kkutuio/kkutuweb/oauth/OAuthService.kt`
- [Account security](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/identity/AccountSecurityService.kt): `src/main/kotlin/me/kkutuio/kkutuweb/identity/AccountSecurityService.kt`
- [Identity data](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/identity/IdentityDao.kt): `src/main/kotlin/me/kkutuio/kkutuweb/identity/IdentityDao.kt`

### Game services

- [Web API](https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb): `src/main/kotlin/me/kkutuio/kkutuweb`
- [Game sessions](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/session/SessionService.kt): `src/main/kotlin/me/kkutuio/kkutuweb/session/SessionService.kt`
- [Game clients](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/game/GameClientManager.kt): `src/main/kotlin/me/kkutuio/kkutuweb/game/GameClientManager.kt`
- [Game client](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/game/GameClient.kt): `src/main/kotlin/me/kkutuio/kkutuweb/game/GameClient.kt`
- [Game records](https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/record): `src/main/kotlin/me/kkutuio/kkutuweb/record`
- [Rankings](https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/ranking): `src/main/kotlin/me/kkutuio/kkutuweb/ranking`

### Academy

- [Academy panels](https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/EnginePanel.svelte): `Frontpage/src/lib/academy/EnginePanel.svelte`
- [Academy client](https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/academyClient.js): `Frontpage/src/lib/academy/academyClient.js`
- [Academy API](https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/api.js): `Frontpage/src/lib/academy/api.js`
- [Academy worker](https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/academy.worker.js): `Frontpage/src/lib/academy/academy.worker.js`
- [Word game engine](https://github.com/kkutuio/kkutu-web/blob/kkutuio/Frontpage/src/lib/academy/academy-engine-core.js): `Frontpage/src/lib/academy/academy-engine-core.js`

### Operations

- [Moderation](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/moderation/ModerationService.kt): `src/main/kotlin/me/kkutuio/kkutuweb/moderation/ModerationService.kt`
- [Moderation policy](https://github.com/kkutuio/kkutu-web/blob/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/moderation/policy/ModerationPolicyEngine.kt): `src/main/kotlin/me/kkutuio/kkutuweb/moderation/policy/ModerationPolicyEngine.kt`
- [Shop services](https://github.com/kkutuio/kkutu-web/tree/kkutuio/src/main/kotlin/me/kkutuio/kkutuweb/shop): `src/main/kotlin/me/kkutuio/kkutuweb/shop`

### Other components

- **Player**
- **KKuTu game server**
- **OAuth provider**

## Connections

- Player → Game portal: opens
- Player → Web pages: uses
- App entry → Game portal: routes to
- Login UI → Login flow: submits login
- Setup UI → Web API: submits setup
- Login flow → OAuth providers: authenticates with (evidence: `src/main/kotlin/me/kkutuio/kkutuweb/login/LoginService.kt`)
- OAuth providers → OAuth service: extends (evidence: `src/main/kotlin/me/kkutuio/kkutuweb/oauth/facebook/FacebookOAuthService.kt`)
- OAuth providers → OAuth provider: requests identity (evidence: `src/main/kotlin/me/kkutuio/kkutuweb/oauth/facebook/FacebookOAuthService.kt`)
- Login flow → Account security: uses account security (evidence: `src/main/kotlin/me/kkutuio/kkutuweb/login/LoginService.kt`)
- Account security → Identity data: reads and writes
- Web API → Game sessions: provides sessions (evidence: `src/main/kotlin/me/kkutuio/kkutuweb/session/SessionService.kt`)
- Game sessions → Game clients: issues game access
- Game clients → Game client: manages (evidence: `src/main/kotlin/me/kkutuio/kkutuweb/game/GameClientManager.kt`)
- Game clients → Game records: uses record bridge (evidence: `src/main/kotlin/me/kkutuio/kkutuweb/game/GameClientManager.kt`)
- KKuTu game server → Game clients: compatible connection (evidence: `README.md`)
- Academy panels → Academy client: uses (evidence: `Frontpage/src/lib/academy/EnginePanel.svelte`)
- Academy panels → Academy API: requests (evidence: `Frontpage/src/lib/academy/EnginePanel.svelte`)
- Academy client → Academy worker: dispatches
- Academy worker → Word game engine: runs (evidence: `Frontpage/src/lib/academy/academy.worker.js`)
- Moderation → Moderation policy: evaluates (evidence: `src/main/kotlin/me/kkutuio/kkutuweb/moderation/ModerationService.kt`)
- Moderation → Game clients: disconnects players (evidence: `src/main/kotlin/me/kkutuio/kkutuweb/moderation/ModerationService.kt`)
