# adityadev00/skribbl.io-clone architecture

> Architecture diagram of the GitHub repository adityadev00/skribbl.io-clone, 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/adityadev00/skribbl.io-clone
- Repository: https://github.com/adityadev00/skribbl.io-clone

## Overview

Doodle Dash is a real-time multiplayer drawing-and-guessing game. Players create or join a room, configure a lobby, then play timed drawing rounds with word choices, hints, chat/guesses, scoring, and a final leaderboard. The frontend owns the socket-backed client state and renders the experience; the backend routes socket actions through handlers into room and game domain logic. README capabilities fill in unsampled UI branches; relationships below otherwise rely on the shown excerpts and SOURCE INDEX references.

Main entry points: [`frontend/src/pages/GamePage.tsx`](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/pages/GamePage.tsx) (Game page), [`backend/src/handlers/index.ts`](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/index.ts) (Socket handlers), [`backend/src/handlers/context.ts`](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/context.ts) (Handler context), [`backend/src/server.ts`](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/server.ts) (Socket server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Game client"]
  node_app["App routing<br/>[App.tsx]"]
  node_home["Home page<br/>[HomePage.tsx]"]
  node_roompage["Room routing<br/>[RoomPage.tsx]"]
  node_provider["Game provider<br/>[GameContext.tsx]"]
  node_reducer["Client state<br/>[gameReducer.ts]"]
  node_socket["Socket client<br/>[socket.ts]"]
end

subgraph group_lobby["Room and lobby"]
  node_lobbypage["Lobby page<br/>[LobbyPage.tsx]"]
  node_lobbyforms["Room controls<br/>[CreateRoomForm.tsx]"]
  node_playerlist["Player list<br/>[PlayerList.tsx]"]
end

subgraph group_play["Round gameplay"]
  node_gamepage["Game page<br/>[GamePage.tsx]"]
  node_canvas["Drawing canvas<br/>[Canvas.tsx]"]
  node_chat["Chat and guesses<br/>[ChatPanel.tsx]"]
  node_roundui["Round displays"]
  node_scoreui["Scores and results<br/>[Scoreboard.tsx]"]
end

subgraph group_server["Realtime server"]
  node_backend["Socket server<br/>[server.ts]"]
  node_handlers["Socket handlers<br/>[index.ts]"]
  node_lobbyhandlers["Lobby actions<br/>[lobbyHandlers.ts]"]
  node_gamehandlers["Game actions<br/>[gameHandlers.ts]"]
  node_drawinghandlers["Drawing actions<br/>[drawingHandlers.ts]"]
  node_chathandlers["Chat actions<br/>[chatHandlers.ts]"]
  node_context["Handler context<br/>[context.ts]"]
  node_sessions[("Session identity<br/>[SessionStore.ts]")]
  node_broadcast["Socket broadcaster"]
end

subgraph group_domain["Game domain"]
  node_roommanager["Room registry<br/>[RoomManager.ts]"]
  node_room["Room and lobby state<br/>[Room.ts]"]
  node_game["Round engine<br/>[Game.ts]"]
  node_playerstate["Player state<br/>[Player.ts]"]
  node_words["Word selection<br/>[WordService.ts]"]
end

node_player(("Player"))

node_player -->|"uses"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_roompage
node_roompage -->|"selects"| node_lobbypage
node_lobbypage -.->|"renders"| node_lobbyforms
node_lobbypage -.->|"renders"| node_playerlist
node_roompage -.->|"selects"| node_gamepage
node_gamepage -->|"renders"| node_canvas
node_gamepage -->|"renders"| node_chat
node_gamepage -->|"renders"| node_roundui
node_gamepage -->|"renders"| node_scoreui
node_gamepage -->|"reads state"| node_provider
node_provider -->|"emits and listens"| node_socket
node_provider -->|"dispatches"| node_reducer
node_backend -->|"resolves identity"| node_sessions
node_backend -->|"manages rooms"| node_roommanager
node_backend -->|"configures"| node_broadcast
node_backend -->|"registers"| node_handlers
node_handlers -.->|"dispatches"| node_lobbyhandlers
node_handlers -.->|"dispatches"| node_gamehandlers
node_handlers -.->|"dispatches"| node_drawinghandlers
node_handlers -.->|"dispatches"| node_chathandlers
node_lobbyhandlers -->|"uses"| node_context
node_gamehandlers -->|"uses"| node_context
node_drawinghandlers -->|"uses"| node_context
node_chathandlers -->|"uses"| node_context
node_context -->|"queries"| node_roommanager
node_roommanager -->|"creates and manages"| node_room
node_room -->|"starts"| node_game
node_room -->|"tracks"| node_playerstate
node_room -->|"passes service"| node_words
node_game -->|"chooses words"| node_words

click node_app "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/App.tsx"
click node_home "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/pages/HomePage.tsx"
click node_roompage "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/pages/RoomPage.tsx"
click node_lobbypage "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/pages/LobbyPage.tsx"
click node_lobbyforms "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/lobby/CreateRoomForm.tsx"
click node_playerlist "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/lobby/PlayerList.tsx"
click node_gamepage "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/pages/GamePage.tsx"
click node_canvas "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/game/Canvas.tsx"
click node_chat "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/game/ChatPanel.tsx"
click node_roundui "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/game/WordChoiceModal.tsx"
click node_scoreui "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/game/Scoreboard.tsx"
click node_provider "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/context/GameContext.tsx"
click node_reducer "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/context/gameReducer.ts"
click node_socket "https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/lib/socket.ts"
click node_backend "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/server.ts"
click node_handlers "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/index.ts"
click node_lobbyhandlers "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/lobbyHandlers.ts"
click node_gamehandlers "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/gameHandlers.ts"
click node_drawinghandlers "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/drawingHandlers.ts"
click node_chathandlers "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/chatHandlers.ts"
click node_context "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/context.ts"
click node_roommanager "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/services/RoomManager.ts"
click node_room "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/models/Room.ts"
click node_game "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/models/Game.ts"
click node_playerstate "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/models/Player.ts"
click node_words "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/services/WordService.ts"
click node_sessions "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/services/SessionStore.ts"
click node_broadcast "https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/services/SocketBroadcaster.ts"

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_home,node_roompage,node_provider,node_reducer,node_socket toneBlue
class node_lobbypage,node_lobbyforms,node_playerlist toneAmber
class node_gamepage,node_canvas,node_chat,node_roundui,node_scoreui toneMint
class node_backend,node_handlers,node_lobbyhandlers,node_gamehandlers,node_drawinghandlers,node_chathandlers,node_context,node_sessions,node_broadcast toneRose
class node_roommanager,node_room,node_game,node_playerstate,node_words,node_player toneIndigo
```

## Components

### Game client

- [App routing](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Home page](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/pages/HomePage.tsx): `frontend/src/pages/HomePage.tsx`
- [Room routing](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/pages/RoomPage.tsx): `frontend/src/pages/RoomPage.tsx`
- [Game provider](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/context/GameContext.tsx): `frontend/src/context/GameContext.tsx`
- [Client state](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/context/gameReducer.ts): `frontend/src/context/gameReducer.ts`
- [Socket client](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/lib/socket.ts): `frontend/src/lib/socket.ts`

### Room and lobby

- [Lobby page](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/pages/LobbyPage.tsx): `frontend/src/pages/LobbyPage.tsx`
- [Room controls](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/lobby/CreateRoomForm.tsx): `frontend/src/components/lobby/CreateRoomForm.tsx`
- [Player list](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/lobby/PlayerList.tsx): `frontend/src/components/lobby/PlayerList.tsx`

### Round gameplay

- [Game page](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/pages/GamePage.tsx): `frontend/src/pages/GamePage.tsx`
- [Drawing canvas](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/game/Canvas.tsx): `frontend/src/components/game/Canvas.tsx`
- [Chat and guesses](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/game/ChatPanel.tsx): `frontend/src/components/game/ChatPanel.tsx`
- [Round displays](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/game/WordChoiceModal.tsx): `frontend/src/components/game/WordChoiceModal.tsx`
- [Scores and results](https://github.com/adityadev00/skribbl.io-clone/blob/main/frontend/src/components/game/Scoreboard.tsx): `frontend/src/components/game/Scoreboard.tsx`

### Realtime server

- [Socket server](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Socket handlers](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/index.ts): `backend/src/handlers/index.ts`
- [Lobby actions](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/lobbyHandlers.ts): `backend/src/handlers/lobbyHandlers.ts`
- [Game actions](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/gameHandlers.ts): `backend/src/handlers/gameHandlers.ts`
- [Drawing actions](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/drawingHandlers.ts): `backend/src/handlers/drawingHandlers.ts`
- [Chat actions](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/chatHandlers.ts): `backend/src/handlers/chatHandlers.ts`
- [Handler context](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/handlers/context.ts): `backend/src/handlers/context.ts`
- [Session identity](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/services/SessionStore.ts): `backend/src/services/SessionStore.ts`
- [Socket broadcaster](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/services/SocketBroadcaster.ts): `backend/src/services/SocketBroadcaster.ts`

### Game domain

- [Room registry](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/services/RoomManager.ts): `backend/src/services/RoomManager.ts`
- [Room and lobby state](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/models/Room.ts): `backend/src/models/Room.ts`
- [Round engine](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/models/Game.ts): `backend/src/models/Game.ts`
- [Player state](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/models/Player.ts): `backend/src/models/Player.ts`
- [Word selection](https://github.com/adityadev00/skribbl.io-clone/blob/main/backend/src/services/WordService.ts): `backend/src/services/WordService.ts`

### Other components

- **Player**

## Connections

- Player → App routing: uses
- App routing → Home page: routes (evidence: `frontend/src/App.tsx`)
- App routing → Room routing: routes (evidence: `frontend/src/App.tsx`)
- Room routing → Lobby page: selects
- Lobby page → Room controls: renders
- Lobby page → Player list: renders
- Room routing → Game page: selects
- Game page → Drawing canvas: renders (evidence: `frontend/src/pages/GamePage.tsx`)
- Game page → Chat and guesses: renders (evidence: `frontend/src/pages/GamePage.tsx`)
- Game page → Round displays: renders (evidence: `frontend/src/pages/GamePage.tsx`)
- Game page → Scores and results: renders (evidence: `frontend/src/pages/GamePage.tsx`)
- Game page → Game provider: reads state (evidence: `frontend/src/pages/GamePage.tsx`)
- Game provider → Socket client: emits and listens (evidence: `frontend/src/context/GameContext.tsx`)
- Game provider → Client state: dispatches (evidence: `frontend/src/context/GameContext.tsx`)
- Socket server → Session identity: resolves identity (evidence: `backend/src/server.ts`)
- Socket server → Room registry: manages rooms (evidence: `backend/src/server.ts`)
- Socket server → Socket broadcaster: configures (evidence: `backend/src/server.ts`)
- Socket server → Socket handlers: registers (evidence: `backend/src/server.ts`)
- Socket handlers → Lobby actions: dispatches
- Socket handlers → Game actions: dispatches
- Socket handlers → Drawing actions: dispatches
- Socket handlers → Chat actions: dispatches
- Lobby actions → Handler context: uses (evidence: `backend/src/handlers/lobbyHandlers.ts`)
- Game actions → Handler context: uses (evidence: `backend/src/handlers/gameHandlers.ts`)
- Drawing actions → Handler context: uses (evidence: `backend/src/handlers/drawingHandlers.ts`)
- Chat actions → Handler context: uses (evidence: `backend/src/handlers/chatHandlers.ts`)
- Handler context → Room registry: queries (evidence: `backend/src/handlers/context.ts`)
- Room registry → Room and lobby state: creates and manages (evidence: `backend/src/services/RoomManager.ts`)
- Room and lobby state → Round engine: starts (evidence: `backend/src/models/Room.ts`)
- Room and lobby state → Player state: tracks (evidence: `backend/src/models/Room.ts`)
- Room and lobby state → Word selection: passes service (evidence: `backend/src/models/Room.ts`)
- Round engine → Word selection: chooses words (evidence: `backend/src/models/Game.ts`)
