# seokpan/seokpan-hybrid-app architecture

> Architecture diagram of the GitHub repository seokpan/seokpan-hybrid-app, 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/seokpan/seokpan-hybrid-app
- Repository: https://github.com/seokpan/seokpan-hybrid-app

## Overview

Seokpan is a browser-based multiplayer room and voting game, with guest/member identity, lobby and room participation, live updates, game play, chat, presence, and rankings. The main user journey runs from authentication or guest entry through lobby/room participation and game voting, with WebSocket updates keeping views current. The backend separates HTTP/API routing, application use cases, and persistence providers. The README describes migration and deployment validation, but those are repository operations rather than runtime product components. Some feature paths are documented by the tree and index only; uncertain links are omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/App.tsx) (Route shell), [`backend/src/seokpan/app.py`](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/app.py) (Application assembly), [`frontend/src/room/RoomPage.tsx`](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/room/RoomPage.tsx) (Room view), [`backend/src/seokpan/game/application/service.py`](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/game/application/service.py) (Game resolution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_app["Route shell<br/>[App.tsx]"]
  node_auth["Authentication UI<br/>[AuthPage.tsx]"]
  node_sessionui["Session recovery<br/>[context.tsx]"]
  node_client["API client<br/>[client.ts]"]
  node_lobby["Lobby view<br/>[LobbyPage.tsx]"]
  node_roomui["Room view<br/>[RoomPage.tsx]"]
  node_gameui["Game and votes<br/>[GamePanel.tsx]"]
  node_chatui["Chat panel<br/>[ChatPanel.tsx]"]
  node_rankings["Rankings<br/>[RankingsPage.tsx]"]
  node_presenceui["Online presence<br/>[OnlineCount.tsx]"]
end

subgraph group_api["HTTP and realtime API"]
  node_backend["Application assembly<br/>[app.py]"]
  node_identityapi["Identity routes<br/>[identity.py]"]
  node_roomapi["Room routes<br/>[room.py]"]
  node_gameapi["Game routes<br/>[game.py]"]
  node_realtimeapi["Realtime delivery<br/>[realtime.py]"]
end

subgraph group_domain["Application use cases"]
  node_identity["Identity services<br/>[auth_session.py]"]
  node_rooms["Room lifecycle<br/>[lobby.py]"]
  node_games["Game resolution<br/>[service.py]"]
end

subgraph group_storage["Persistence and runtime state"]
  node_redis[("Redis state adapters<br/>[session_adapter.py]")]
  node_mariadb[("MariaDB adapters<br/>[game_adapter.py]")]
end

node_user(("Player"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_lobby
node_app -->|"renders"| node_roomui
node_app -->|"routes to"| node_rankings
node_app -->|"renders"| node_presenceui
node_auth -->|"uses"| node_sessionui
node_sessionui -->|"requests"| node_client
node_lobby -.->|"requests"| node_client
node_roomui -.->|"renders"| node_gameui
node_roomui -.->|"renders"| node_chatui
node_client -.->|"HTTP calls"| node_identityapi
node_backend -->|"registers"| node_identityapi
node_backend -->|"registers"| node_roomapi
node_backend -->|"registers"| node_gameapi
node_backend -.->|"registers"| node_realtimeapi
node_identityapi -->|"delegates"| node_identity
node_roomapi -->|"delegates"| node_rooms
node_gameapi -->|"delegates"| node_games
node_games -->|"reads room state"| node_rooms
node_identity -->|"session storage"| node_redis
node_games -.->|"game storage"| node_mariadb
node_realtimeapi -.->|"streams events"| node_roomui

click node_app "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/App.tsx"
click node_auth "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/auth/AuthPage.tsx"
click node_sessionui "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/session/context.tsx"
click node_client "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/api/client.ts"
click node_lobby "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/lobby/LobbyPage.tsx"
click node_roomui "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/room/RoomPage.tsx"
click node_gameui "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/game/GamePanel.tsx"
click node_chatui "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/chat/ChatPanel.tsx"
click node_rankings "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/statistics/RankingsPage.tsx"
click node_presenceui "https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/presence/OnlineCount.tsx"
click node_backend "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/app.py"
click node_identityapi "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/api/identity.py"
click node_roomapi "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/api/room.py"
click node_gameapi "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/api/game.py"
click node_realtimeapi "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/api/realtime.py"
click node_identity "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/identity/application/auth_session.py"
click node_rooms "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/room/application/lobby.py"
click node_games "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/game/application/service.py"
click node_redis "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/persistence/redis/session_adapter.py"
click node_mariadb "https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/persistence/mariadb/game_adapter.py"

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_app,node_auth,node_sessionui,node_client,node_lobby,node_roomui,node_gameui,node_chatui,node_rankings,node_presenceui toneBlue
class node_backend,node_identityapi,node_roomapi,node_gameapi,node_realtimeapi toneAmber
class node_identity,node_rooms,node_games toneMint
class node_redis,node_mariadb toneRose
class node_user toneIndigo
```

## Components

### Web client

- [Route shell](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication UI](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/auth/AuthPage.tsx): `frontend/src/auth/AuthPage.tsx`
- [Session recovery](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/session/context.tsx): `frontend/src/session/context.tsx`
- [API client](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Lobby view](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/lobby/LobbyPage.tsx): `frontend/src/lobby/LobbyPage.tsx`
- [Room view](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/room/RoomPage.tsx): `frontend/src/room/RoomPage.tsx`
- [Game and votes](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/game/GamePanel.tsx): `frontend/src/game/GamePanel.tsx`
- [Chat panel](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/chat/ChatPanel.tsx): `frontend/src/chat/ChatPanel.tsx`
- [Rankings](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/statistics/RankingsPage.tsx): `frontend/src/statistics/RankingsPage.tsx`
- [Online presence](https://github.com/seokpan/seokpan-hybrid-app/blob/main/frontend/src/presence/OnlineCount.tsx): `frontend/src/presence/OnlineCount.tsx`

### HTTP and realtime API

- [Application assembly](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/app.py): `backend/src/seokpan/app.py`
- [Identity routes](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/api/identity.py): `backend/src/seokpan/api/identity.py`
- [Room routes](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/api/room.py): `backend/src/seokpan/api/room.py`
- [Game routes](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/api/game.py): `backend/src/seokpan/api/game.py`
- [Realtime delivery](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/api/realtime.py): `backend/src/seokpan/api/realtime.py`

### Application use cases

- [Identity services](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/identity/application/auth_session.py): `backend/src/seokpan/identity/application/auth_session.py`
- [Room lifecycle](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/room/application/lobby.py): `backend/src/seokpan/room/application/lobby.py`
- [Game resolution](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/game/application/service.py): `backend/src/seokpan/game/application/service.py`

### Persistence and runtime state

- [Redis state adapters](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/persistence/redis/session_adapter.py): `backend/src/seokpan/persistence/redis/session_adapter.py`
- [MariaDB adapters](https://github.com/seokpan/seokpan-hybrid-app/blob/main/backend/src/seokpan/persistence/mariadb/game_adapter.py): `backend/src/seokpan/persistence/mariadb/game_adapter.py`

### Other components

- **Player**

## Connections

- Player → Route shell: opens (evidence: `frontend/src/App.tsx`)
- Route shell → Authentication UI: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Lobby view: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Room view: renders (evidence: `frontend/src/App.tsx`)
- Route shell → Rankings: routes to (evidence: `frontend/src/App.tsx`)
- Route shell → Online presence: renders (evidence: `frontend/src/App.tsx`)
- Authentication UI → Session recovery: uses (evidence: `frontend/src/auth/AuthPage.tsx`)
- Session recovery → API client: requests (evidence: `frontend/src/session/context.tsx`)
- Lobby view → API client: requests (evidence: `frontend/src/lobby/LobbyPage.tsx`)
- Room view → Game and votes: renders
- Room view → Chat panel: renders
- API client → Identity routes: HTTP calls
- Application assembly → Identity routes: registers (evidence: `backend/src/seokpan/app.py`)
- Application assembly → Room routes: registers (evidence: `backend/src/seokpan/app.py`)
- Application assembly → Game routes: registers (evidence: `backend/src/seokpan/app.py`)
- Application assembly → Realtime delivery: registers (evidence: `backend/src/seokpan/app.py`)
- Identity routes → Identity services: delegates (evidence: `backend/src/seokpan/api/identity.py`)
- Room routes → Room lifecycle: delegates (evidence: `backend/src/seokpan/api/room.py`)
- Game routes → Game resolution: delegates (evidence: `backend/src/seokpan/api/game.py`)
- Game resolution → Room lifecycle: reads room state (evidence: `backend/src/seokpan/game/application/service.py`)
- Identity services → Redis state adapters: session storage (evidence: `backend/src/seokpan/persistence/redis/session_adapter.py`)
- Game resolution → MariaDB adapters: game storage
- Realtime delivery → Room view: streams events
