# boostcampwm2025/web08-jamstack architecture

> Architecture diagram of the GitHub repository boostcampwm2025/web08-jamstack, 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/boostcampwm2025/web08-jamstack
- Repository: https://github.com/boostcampwm2025/web08-jamstack

## Overview

CodeJam is a login-free, real-time collaborative coding platform. Users create or join a room, then collaborate in a shared editor with file management, participant roles, chat, and code execution. The graph shows the documented product capabilities and the sampled room, collaboration, and document-persistence layers. Some client/server and optional persistence relationships are documented or indexed rather than fully shown in excerpts; those links are marked accordingly.

Main entry points: [`apps/server/src/modules/room/room.service.ts`](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/room/room.service.ts) (Room lifecycle), [`apps/server/src/modules/file/file.service.ts`](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/file/file.service.ts) (Document sync), [`apps/server/src/modules/collaboration/collaboration.service.ts`](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/collaboration/collaboration.service.ts) (Collaboration rules), [`apps/client/src/shared/api/room.ts`](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/shared/api/room.ts) (Room API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Room entry"]
  node_home["Room creation<br/>[HomePage.tsx]"]
  node_router["Client routing<br/>[App.tsx]"]
  node_roomapi["Room API<br/>[room.ts]"]
end

subgraph group_client["Collaboration client"]
  node_collabpage["Shared room view<br/>[RoomPage.tsx]"]
  node_editor["Collaborative editor"]
  node_filemanager["Shared file model<br/>[file-manager.ts]"]
  node_filestore["File state<br/>[file.ts]"]
  node_chat["Room chat<br/>[chat.ts]"]
end

subgraph group_realtime["Realtime services"]
  node_gateway["Socket collaboration"]
  node_collabservice["Collaboration rules"]
  node_fileservice["Document sync<br/>[file.service.ts]"]
end

subgraph group_domain["Room services"]
  node_roomcontroller["Room endpoints<br/>[room.controller.ts]"]
  node_roomservice["Room lifecycle<br/>[room.service.ts]"]
  node_participants["Participant roles<br/>[pt.service.ts]"]
  node_codeexec["Code execution"]
  node_cleanup["Room expiry<br/>[cleanup.service.ts]"]
end

subgraph group_storage["Persistence"]
  node_roomstore[("Room records<br/>[room.entity.ts]")]
  node_docservice["Document snapshots"]
  node_docdb[("Document records<br/>[document.entity.ts]")]
  node_yredis["Yjs persistence<br/>[y-redis.service.ts]"]
end

node_user(("Participant"))
node_redis[("Redis")]

node_user -->|"creates room"| node_home
node_home -.->|"requests room"| node_roomapi
node_roomapi -.->|"HTTP requests"| node_roomcontroller
node_roomcontroller -->|"delegates"| node_roomservice
node_roomservice -->|"reads and writes"| node_roomstore
node_roomservice -->|"manages participants"| node_participants
node_roomservice -->|"initializes documents"| node_fileservice
node_router -->|"checks joinability"| node_roomapi
node_router -->|"routes room"| node_collabpage
node_user -->|"joins room"| node_collabpage
node_collabpage -.->|"presents editor"| node_editor
node_editor -.->|"edits shared text"| node_filemanager
node_filemanager -.->|"updates file state"| node_filestore
node_user -.->|"sends messages"| node_chat
node_gateway -.->|"dispatches events"| node_collabservice
node_collabservice -->|"updates roles"| node_participants
node_collabservice -.->|"coordinates sync"| node_fileservice
node_fileservice -->|"persists updates"| node_yredis
node_fileservice -->|"loads snapshots"| node_docservice
node_docservice -->|"reads and writes"| node_docdb
node_yredis -.->|"stores updates"| node_redis
node_user -.->|"runs code"| node_codeexec
node_cleanup -.->|"expires rooms"| node_roomservice

click node_home "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/pages/home/HomePage.tsx"
click node_router "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/App.tsx"
click node_roomapi "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/shared/api/room.ts"
click node_roomcontroller "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/room/room.controller.ts"
click node_roomservice "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/room/room.service.ts"
click node_roomstore "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/room/room.entity.ts"
click node_collabpage "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/pages/room/RoomPage.tsx"
click node_editor "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/widgets/code-editor/hooks/useEditorExtensions.ts"
click node_filemanager "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/shared/lib/collaboration/file-manager.ts"
click node_filestore "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/stores/file.ts"
click node_chat "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/stores/chat.ts"
click node_participants "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/pt/pt.service.ts"
click node_gateway "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/collaboration/collaboration.gateway.ts"
click node_collabservice "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/collaboration/collaboration.service.ts"
click node_fileservice "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/file/file.service.ts"
click node_docservice "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/document/document.service.ts"
click node_docdb "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/document/document.entity.ts"
click node_yredis "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/y-redis/y-redis.service.ts"
click node_codeexec "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/code-execution/code-execution.service.ts"
click node_cleanup "https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/cleanup/cleanup.service.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_home,node_router,node_roomapi toneBlue
class node_collabpage,node_editor,node_filemanager,node_filestore,node_chat,node_redis toneAmber
class node_gateway,node_collabservice,node_fileservice toneMint
class node_roomcontroller,node_roomservice,node_participants,node_codeexec,node_cleanup toneRose
class node_roomstore,node_docservice,node_docdb,node_yredis,node_user toneIndigo
```

## Components

### Room entry

- [Room creation](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/pages/home/HomePage.tsx): `apps/client/src/pages/home/HomePage.tsx`
- [Client routing](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/App.tsx): `apps/client/src/App.tsx`
- [Room API](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/shared/api/room.ts): `apps/client/src/shared/api/room.ts`

### Collaboration client

- [Shared room view](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/pages/room/RoomPage.tsx): `apps/client/src/pages/room/RoomPage.tsx`
- [Collaborative editor](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/widgets/code-editor/hooks/useEditorExtensions.ts): `apps/client/src/widgets/code-editor/hooks/useEditorExtensions.ts`
- [Shared file model](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/shared/lib/collaboration/file-manager.ts): `apps/client/src/shared/lib/collaboration/file-manager.ts`
- [File state](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/stores/file.ts): `apps/client/src/stores/file.ts`
- [Room chat](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/client/src/stores/chat.ts): `apps/client/src/stores/chat.ts`

### Realtime services

- [Socket collaboration](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/collaboration/collaboration.gateway.ts): `apps/server/src/modules/collaboration/collaboration.gateway.ts`
- [Collaboration rules](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/collaboration/collaboration.service.ts): `apps/server/src/modules/collaboration/collaboration.service.ts`
- [Document sync](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/file/file.service.ts): `apps/server/src/modules/file/file.service.ts`

### Room services

- [Room endpoints](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/room/room.controller.ts): `apps/server/src/modules/room/room.controller.ts`
- [Room lifecycle](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/room/room.service.ts): `apps/server/src/modules/room/room.service.ts`
- [Participant roles](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/pt/pt.service.ts): `apps/server/src/modules/pt/pt.service.ts`
- [Code execution](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/code-execution/code-execution.service.ts): `apps/server/src/modules/code-execution/code-execution.service.ts`
- [Room expiry](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/cleanup/cleanup.service.ts): `apps/server/src/modules/cleanup/cleanup.service.ts`

### Persistence

- [Room records](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/room/room.entity.ts): `apps/server/src/modules/room/room.entity.ts`
- [Document snapshots](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/document/document.service.ts): `apps/server/src/modules/document/document.service.ts`
- [Document records](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/document/document.entity.ts): `apps/server/src/modules/document/document.entity.ts`
- [Yjs persistence](https://github.com/boostcampwm2025/web08-jamstack/blob/main/apps/server/src/modules/y-redis/y-redis.service.ts): `apps/server/src/modules/y-redis/y-redis.service.ts`

### Other components

- **Participant**
- **Redis**

## Connections

- Participant → Room creation: creates room
- Room creation → Room API: requests room
- Room API → Room endpoints: HTTP requests
- Room endpoints → Room lifecycle: delegates (evidence: `apps/server/src/modules/room/room.controller.ts`)
- Room lifecycle → Room records: reads and writes (evidence: `apps/server/src/modules/room/room.service.ts`)
- Room lifecycle → Participant roles: manages participants (evidence: `apps/server/src/modules/room/room.service.ts`)
- Room lifecycle → Document sync: initializes documents (evidence: `apps/server/src/modules/room/room.service.ts`)
- Client routing → Room API: checks joinability (evidence: `apps/client/src/App.tsx`)
- Client routing → Shared room view: routes room (evidence: `apps/client/src/App.tsx`)
- Participant → Shared room view: joins room
- Shared room view → Collaborative editor: presents editor
- Collaborative editor → Shared file model: edits shared text
- Shared file model → File state: updates file state
- Participant → Room chat: sends messages
- Socket collaboration → Collaboration rules: dispatches events
- Collaboration rules → Participant roles: updates roles (evidence: `apps/server/src/modules/collaboration/collaboration.service.ts`)
- Collaboration rules → Document sync: coordinates sync (evidence: `apps/server/src/modules/collaboration/collaboration.service.ts`)
- Document sync → Yjs persistence: persists updates (evidence: `apps/server/src/modules/file/file.service.ts`)
- Document sync → Document snapshots: loads snapshots (evidence: `apps/server/src/modules/file/file.service.ts`)
- Document snapshots → Document records: reads and writes (evidence: `apps/server/src/modules/document/document.service.ts`)
- Yjs persistence → Redis: stores updates
- Participant → Code execution: runs code
- Room expiry → Room lifecycle: expires rooms
