# izpew/tacoyaki-server architecture

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

- Interactive diagram: https://gitdiagram.com/izpew/tacoyaki-server
- Repository: https://github.com/izpew/tacoyaki-server

## Overview

타코야키 박스는 TRPG 세션을 위한 자가 호스팅 멀티플레이 서버이며, 브라우저판 정적 파일도 제공합니다. 주 흐름은 참가자가 서버에 접속하고, 계정 인증 후 세션방에서 채팅·주사위·자료를 공유하는 것입니다. 커뮤니티 게시판, 캐릭터·경제·게임 기능, 로비 게시글과 도트타운도 별도 제품 기능으로 포함했습니다. 파일 트리와 README, 제공된 소스 발췌 및 SOURCE INDEX를 근거로 했습니다. 일부 세부 호출은 발췌에 없어 연결을 생략했습니다.

Main entry points: [`src/relay.ts`](https://github.com/izpew/tacoyaki-server/blob/main/src/relay.ts) (실시간 릴레이), [`src/communityRoutes.ts`](https://github.com/izpew/tacoyaki-server/blob/main/src/communityRoutes.ts) (커뮤니티 라우트), [`src/index.ts`](https://github.com/izpew/tacoyaki-server/blob/main/src/index.ts) (HTTP 서버), [`src/protocol.ts`](https://github.com/izpew/tacoyaki-server/blob/main/src/protocol.ts) (와이어 프로토콜)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["서버 진입·실시간"]
  node_server["HTTP 서버<br/>[index.ts]"]
  node_realtime["실시간 릴레이<br/>[relay.ts]"]
  node_wire["와이어 프로토콜<br/>[protocol.ts]"]
  node_webclient["브라우저 앱<br/>[index.html]"]
end

subgraph group_sessions["세션 플레이"]
  node_rooms[("세션방 상태<br/>[rooms.ts]")]
  node_dice["주사위 판정<br/>[engine.ts]"]
  node_direct["귓속말·DM<br/>[dm.ts]"]
  node_sessionlogs[("세션 로그<br/>[sessionlogs.ts]")]
end

subgraph group_accounts["계정·자산"]
  node_accounts[("계정·세션<br/>[auth.ts]")]
  node_assets[("바이너리 자산<br/>[assets.ts]")]
  node_notifications["알림<br/>[notifications.ts]"]
end

subgraph group_community["커뮤니티 기능"]
  node_communitycore[("커뮤니티 권한<br/>[community.ts]")]
  node_communityroutes["커뮤니티 라우트<br/>[communityRoutes.ts]"]
  node_communityposts[("커뮤니티 게시글<br/>[communityPost.ts]")]
  node_characters[("커뮤니티 캐릭터<br/>[communityChar.ts]")]
  node_catalog[("아이템 도감")]
  node_economy[("커뮤니티 경제<br/>[communityEcon.ts]")]
  node_games[("퀘스트·조사<br/>[communityGame.ts]")]
end

subgraph group_world["로비·월드"]
  node_blog[("로비 게시글<br/>[posts.ts]")]
  node_plaza["광장<br/>[plaza.ts]"]
  node_dottown[("도트타운<br/>[dottown.ts]")]
  node_dot_economy[("도트타운 경제<br/>[dottownEconomy.ts]")]
  node_dot_estate[("도트타운 부동산<br/>[dottownEstate.ts]")]
  node_market[("장터<br/>[market.ts]")]
end

node_players(("플레이어"))

node_players -->|"접속"| node_server
node_webclient -->|"웹 접속"| node_server
node_server -->|"위임"| node_realtime
node_realtime -->|"인증 요청"| node_accounts
node_realtime -->|"방 처리"| node_rooms
node_realtime -->|"판정 처리"| node_dice
node_realtime -->|"DM 처리"| node_direct
node_realtime -->|"로그 처리"| node_sessionlogs
node_realtime -->|"프로토콜 참조"| node_wire
node_realtime -->|"알림 처리"| node_notifications
node_realtime -->|"커뮤니티 라우트"| node_communityroutes
node_communityroutes -->|"권한 확인"| node_communitycore
node_communityroutes -->|"게시글 처리"| node_communityposts
node_communityroutes -->|"캐릭터 처리"| node_characters
node_communityroutes -->|"도감 처리"| node_catalog
node_communityroutes -->|"경제 처리"| node_economy
node_communityroutes -->|"게임 처리"| node_games
node_realtime -->|"게시글 처리"| node_blog
node_realtime -->|"자산 처리"| node_assets
node_realtime -->|"광장 처리"| node_plaza
node_realtime -->|"월드 처리"| node_dottown
node_realtime -->|"경제 처리"| node_dot_economy
node_realtime -->|"부동산 처리"| node_dot_estate
node_realtime -->|"장터 처리"| node_market
node_rooms -->|"타입 사용"| node_wire
node_dice -->|"결과 형식"| node_wire

click node_server "https://github.com/izpew/tacoyaki-server/blob/main/src/index.ts"
click node_realtime "https://github.com/izpew/tacoyaki-server/blob/main/src/relay.ts"
click node_wire "https://github.com/izpew/tacoyaki-server/blob/main/src/protocol.ts"
click node_webclient "https://github.com/izpew/tacoyaki-server/blob/main/webdist/index.html"
click node_rooms "https://github.com/izpew/tacoyaki-server/blob/main/src/rooms.ts"
click node_dice "https://github.com/izpew/tacoyaki-server/blob/main/src/dice/engine.ts"
click node_direct "https://github.com/izpew/tacoyaki-server/blob/main/src/dm.ts"
click node_sessionlogs "https://github.com/izpew/tacoyaki-server/blob/main/src/sessionlogs.ts"
click node_accounts "https://github.com/izpew/tacoyaki-server/blob/main/src/auth.ts"
click node_assets "https://github.com/izpew/tacoyaki-server/blob/main/src/assets.ts"
click node_notifications "https://github.com/izpew/tacoyaki-server/blob/main/src/notifications.ts"
click node_communitycore "https://github.com/izpew/tacoyaki-server/blob/main/src/community.ts"
click node_communityroutes "https://github.com/izpew/tacoyaki-server/blob/main/src/communityRoutes.ts"
click node_communityposts "https://github.com/izpew/tacoyaki-server/blob/main/src/communityPost.ts"
click node_characters "https://github.com/izpew/tacoyaki-server/blob/main/src/communityChar.ts"
click node_catalog "https://github.com/izpew/tacoyaki-server/blob/main/src/communityCatalog.ts"
click node_economy "https://github.com/izpew/tacoyaki-server/blob/main/src/communityEcon.ts"
click node_games "https://github.com/izpew/tacoyaki-server/blob/main/src/communityGame.ts"
click node_blog "https://github.com/izpew/tacoyaki-server/blob/main/src/posts.ts"
click node_plaza "https://github.com/izpew/tacoyaki-server/blob/main/src/plaza.ts"
click node_dottown "https://github.com/izpew/tacoyaki-server/blob/main/src/dottown.ts"
click node_dot_economy "https://github.com/izpew/tacoyaki-server/blob/main/src/dottownEconomy.ts"
click node_dot_estate "https://github.com/izpew/tacoyaki-server/blob/main/src/dottownEstate.ts"
click node_market "https://github.com/izpew/tacoyaki-server/blob/main/src/market.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_server,node_realtime,node_wire,node_webclient toneBlue
class node_rooms,node_dice,node_direct,node_sessionlogs toneAmber
class node_accounts,node_assets,node_notifications toneMint
class node_communitycore,node_communityroutes,node_communityposts,node_characters,node_catalog,node_economy,node_games toneRose
class node_blog,node_plaza,node_dottown,node_dot_economy,node_dot_estate,node_market,node_players toneIndigo
```

## Components

### 서버 진입·실시간

- [HTTP 서버](https://github.com/izpew/tacoyaki-server/blob/main/src/index.ts): `src/index.ts`
- [실시간 릴레이](https://github.com/izpew/tacoyaki-server/blob/main/src/relay.ts): `src/relay.ts`
- [와이어 프로토콜](https://github.com/izpew/tacoyaki-server/blob/main/src/protocol.ts): `src/protocol.ts`
- [브라우저 앱](https://github.com/izpew/tacoyaki-server/blob/main/webdist/index.html): `webdist/index.html`

### 세션 플레이

- [세션방 상태](https://github.com/izpew/tacoyaki-server/blob/main/src/rooms.ts): `src/rooms.ts`
- [주사위 판정](https://github.com/izpew/tacoyaki-server/blob/main/src/dice/engine.ts): `src/dice/engine.ts`
- [귓속말·DM](https://github.com/izpew/tacoyaki-server/blob/main/src/dm.ts): `src/dm.ts`
- [세션 로그](https://github.com/izpew/tacoyaki-server/blob/main/src/sessionlogs.ts): `src/sessionlogs.ts`

### 계정·자산

- [계정·세션](https://github.com/izpew/tacoyaki-server/blob/main/src/auth.ts): `src/auth.ts`
- [바이너리 자산](https://github.com/izpew/tacoyaki-server/blob/main/src/assets.ts): `src/assets.ts`
- [알림](https://github.com/izpew/tacoyaki-server/blob/main/src/notifications.ts): `src/notifications.ts`

### 커뮤니티 기능

- [커뮤니티 권한](https://github.com/izpew/tacoyaki-server/blob/main/src/community.ts): `src/community.ts`
- [커뮤니티 라우트](https://github.com/izpew/tacoyaki-server/blob/main/src/communityRoutes.ts): `src/communityRoutes.ts`
- [커뮤니티 게시글](https://github.com/izpew/tacoyaki-server/blob/main/src/communityPost.ts): `src/communityPost.ts`
- [커뮤니티 캐릭터](https://github.com/izpew/tacoyaki-server/blob/main/src/communityChar.ts): `src/communityChar.ts`
- [아이템 도감](https://github.com/izpew/tacoyaki-server/blob/main/src/communityCatalog.ts): `src/communityCatalog.ts`
- [커뮤니티 경제](https://github.com/izpew/tacoyaki-server/blob/main/src/communityEcon.ts): `src/communityEcon.ts`
- [퀘스트·조사](https://github.com/izpew/tacoyaki-server/blob/main/src/communityGame.ts): `src/communityGame.ts`

### 로비·월드

- [로비 게시글](https://github.com/izpew/tacoyaki-server/blob/main/src/posts.ts): `src/posts.ts`
- [광장](https://github.com/izpew/tacoyaki-server/blob/main/src/plaza.ts): `src/plaza.ts`
- [도트타운](https://github.com/izpew/tacoyaki-server/blob/main/src/dottown.ts): `src/dottown.ts`
- [도트타운 경제](https://github.com/izpew/tacoyaki-server/blob/main/src/dottownEconomy.ts): `src/dottownEconomy.ts`
- [도트타운 부동산](https://github.com/izpew/tacoyaki-server/blob/main/src/dottownEstate.ts): `src/dottownEstate.ts`
- [장터](https://github.com/izpew/tacoyaki-server/blob/main/src/market.ts): `src/market.ts`

### Other components

- **플레이어**

## Connections

- 플레이어 → HTTP 서버: 접속 (evidence: `README.md`)
- 브라우저 앱 → HTTP 서버: 웹 접속 (evidence: `README.md`)
- HTTP 서버 → 실시간 릴레이: 위임 (evidence: `src/index.ts`)
- 실시간 릴레이 → 계정·세션: 인증 요청 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 세션방 상태: 방 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 주사위 판정: 판정 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 귓속말·DM: DM 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 세션 로그: 로그 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 와이어 프로토콜: 프로토콜 참조 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 알림: 알림 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 커뮤니티 라우트: 커뮤니티 라우트 (evidence: `src/relay.ts`)
- 커뮤니티 라우트 → 커뮤니티 권한: 권한 확인 (evidence: `src/communityRoutes.ts`)
- 커뮤니티 라우트 → 커뮤니티 게시글: 게시글 처리 (evidence: `src/communityRoutes.ts`)
- 커뮤니티 라우트 → 커뮤니티 캐릭터: 캐릭터 처리
- 커뮤니티 라우트 → 아이템 도감: 도감 처리
- 커뮤니티 라우트 → 커뮤니티 경제: 경제 처리
- 커뮤니티 라우트 → 퀘스트·조사: 게임 처리
- 실시간 릴레이 → 로비 게시글: 게시글 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 바이너리 자산: 자산 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 광장: 광장 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 도트타운: 월드 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 도트타운 경제: 경제 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 도트타운 부동산: 부동산 처리 (evidence: `src/relay.ts`)
- 실시간 릴레이 → 장터: 장터 처리 (evidence: `src/relay.ts`)
- 세션방 상태 → 와이어 프로토콜: 타입 사용 (evidence: `src/rooms.ts`)
- 주사위 판정 → 와이어 프로토콜: 결과 형식 (evidence: `src/protocol.ts`)
