# ts825360/newchatbot architecture

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

- Interactive diagram: https://gitdiagram.com/ts825360/newchatbot
- Repository: https://github.com/ts825360/newchatbot

## Overview

행사비서는 교회 담당자가 행사방에서 일정·준비·참가 및 이동 계획과 자료를 관리하고, 행사별 AI 대화로 저장 상태를 조회하거나 검토용 초안을 만드는 웹 서비스입니다. 지도는 브라우저 화면에서 인증된 API와 서버 도메인 처리로 이어지는 주 흐름, 그리고 주요 일정·준비, 설문·Google 연동, 이동 배정 기능을 분리했습니다. 근거는 README와 제공된 SOURCE INDEX 및 발췌에 한정됩니다. 일부 화면과 API의 실제 호출 세부는 발췌되지 않아 관계를 생략했습니다.

Main entry points: [`app/workspace/page.tsx`](https://github.com/ts825360/newchatbot/blob/main/app/workspace/page.tsx) (행사 작업공간), [`lib/server/auth.ts`](https://github.com/ts825360/newchatbot/blob/main/lib/server/auth.ts) (인증 권한), [`lib/backend-client.ts`](https://github.com/ts825360/newchatbot/blob/main/lib/backend-client.ts) (브라우저 데이터 클라이언트), [`components/preparation-progress-review.tsx`](https://github.com/ts825360/newchatbot/blob/main/components/preparation-progress-review.tsx) (준비 진행 검토)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["화면과 계정"]
  node_auth_ui["로그인 가입<br/>[auth-screen.tsx]"]
  node_membership["구성원 관리"]
  node_room_ui["행사방 탐색<br/>[room-lobby.tsx]"]
  node_workspace["행사 작업공간<br/>[page.tsx]"]
end

subgraph group_event_work["행사 작업"]
  node_calendar_ui["공동 일정"]
  node_timetable["당일 시간표<br/>[timetable.ts]"]
  node_prep_review["준비 진행 검토"]
  node_prep_api["준비 진행 API<br/>[route.ts]"]
  node_retreat_prep["준비 자료"]
  node_survey_ui["참가 설문"]
  node_transport_ui["이동 배정 화면"]
  node_transport_api["이동 배정 API<br/>[route.ts]"]
  node_transport_rules["이동 검증<br/>[transport.ts]"]
end

subgraph group_assistant["AI 행사비서"]
  node_chat_ui["AI 대화 화면<br/>[chat-panel.tsx]"]
  node_chat_api["대화 API<br/>[route.ts]"]
  node_chat_engine["대화 처리<br/>[chat.ts]"]
  node_proposal["제안 승인 반영"]
end

subgraph group_platform["서버와 저장"]
  node_backend_client["브라우저 데이터 클라이언트<br/>[backend-client.ts]"]
  node_data_api["기록 API<br/>[route.ts]"]
  node_records["기록 처리<br/>[records.ts]"]
  node_auth_server["인증 권한<br/>[auth.ts]"]
  node_database[("SQLite 저장소<br/>[database.ts]")]
end

subgraph group_integrations["외부 연동"]
  node_google_forms["Google Forms 초안"]
  node_forms_api["Forms 초안 API<br/>[route.ts]"]
  node_google_calendar["Google 일정 연결<br/>[google-calendar.ts]"]
  node_google_export["Google 내보내기<br/>[google-export.ts]"]
end

node_user(("담당자"))
node_google["Google 서비스"]
node_ai_service["AI 제공자"]

node_user -->|"로그인 요청"| node_auth_ui
node_user -->|"행사방 선택"| node_room_ui
node_user -->|"행사 관리"| node_workspace
node_auth_ui -->|"인증 사용"| node_backend_client
node_auth_ui -.->|"계정 요청"| node_auth_server
node_membership -->|"계정 데이터 사용"| node_backend_client
node_room_ui -->|"행사방 데이터 사용"| node_backend_client
node_workspace -.->|"대화 제공"| node_chat_ui
node_workspace -.->|"일정 제공"| node_calendar_ui
node_workspace -.->|"시간표 제공"| node_timetable
node_workspace -.->|"준비 검토 제공"| node_prep_review
node_prep_review -->|"기록 조회"| node_backend_client
node_prep_review -->|"진행도 제출"| node_prep_api
node_prep_api -->|"사용자 확인"| node_auth_server
node_prep_review -->|"검토 기준 사용"| node_retreat_prep
node_workspace -.->|"설문 관리 제공"| node_survey_ui
node_workspace -.->|"이동 관리 제공"| node_transport_ui
node_transport_ui -.->|"배정 요청"| node_transport_api
node_transport_api -->|"권한 확인"| node_auth_server
node_transport_api -->|"입력 검증"| node_transport_rules
node_chat_ui -.->|"대화送信"| node_chat_api
node_chat_api -->|"사용자 확인"| node_auth_server
node_chat_api -->|"대화 위임"| node_chat_engine
node_chat_engine -.->|"응답 요청"| node_ai_service
node_chat_ui -->|"승인 후 반영"| node_proposal
node_backend_client -.->|"기록 동기화"| node_data_api
node_data_api -->|"사용자 확인"| node_auth_server
node_data_api -->|"기록 읽기쓰기"| node_records
node_records -.->|"저장소 사용"| node_database
node_forms_api -->|"사용자 확인"| node_auth_server
node_forms_api -->|"Google 세션 조회"| node_google_calendar
node_forms_api -->|"초안 생성"| node_google_forms
node_google_forms -.->|"초안 작성"| node_google
node_google_calendar -.->|"일정 연동"| node_google
node_data_api -->|"내보내기 예약"| node_google_export
node_google_export -.->|"자료 내보내기"| node_google

click node_auth_ui "https://github.com/ts825360/newchatbot/blob/main/components/auth-screen.tsx"
click node_membership "https://github.com/ts825360/newchatbot/blob/main/components/membership-screen.tsx"
click node_room_ui "https://github.com/ts825360/newchatbot/blob/main/components/room-lobby.tsx"
click node_workspace "https://github.com/ts825360/newchatbot/blob/main/app/workspace/page.tsx"
click node_calendar_ui "https://github.com/ts825360/newchatbot/blob/main/components/event-workspace.tsx"
click node_timetable "https://github.com/ts825360/newchatbot/blob/main/lib/timetable.ts"
click node_prep_review "https://github.com/ts825360/newchatbot/blob/main/components/preparation-progress-review.tsx"
click node_prep_api "https://github.com/ts825360/newchatbot/blob/main/app/api/preparation-progress/route.ts"
click node_retreat_prep "https://github.com/ts825360/newchatbot/blob/main/lib/retreat-preparation.ts"
click node_survey_ui "https://github.com/ts825360/newchatbot/blob/main/components/retreat-preparation-panel.tsx"
click node_transport_ui "https://github.com/ts825360/newchatbot/blob/main/components/transport-panel.tsx"
click node_transport_api "https://github.com/ts825360/newchatbot/blob/main/app/api/transport/route.ts"
click node_transport_rules "https://github.com/ts825360/newchatbot/blob/main/lib/transport.ts"
click node_chat_ui "https://github.com/ts825360/newchatbot/blob/main/components/chat-panel.tsx"
click node_chat_api "https://github.com/ts825360/newchatbot/blob/main/app/api/chat/route.ts"
click node_chat_engine "https://github.com/ts825360/newchatbot/blob/main/lib/server/chat.ts"
click node_proposal "https://github.com/ts825360/newchatbot/blob/main/lib/proposal-application.ts"
click node_backend_client "https://github.com/ts825360/newchatbot/blob/main/lib/backend-client.ts"
click node_data_api "https://github.com/ts825360/newchatbot/blob/main/app/api/data/route.ts"
click node_records "https://github.com/ts825360/newchatbot/blob/main/lib/server/records.ts"
click node_auth_server "https://github.com/ts825360/newchatbot/blob/main/lib/server/auth.ts"
click node_database "https://github.com/ts825360/newchatbot/blob/main/lib/server/database.ts"
click node_google_forms "https://github.com/ts825360/newchatbot/blob/main/lib/server/google-form-drafts.ts"
click node_forms_api "https://github.com/ts825360/newchatbot/blob/main/app/api/integrations/google-form-drafts/route.ts"
click node_google_calendar "https://github.com/ts825360/newchatbot/blob/main/lib/server/google-calendar.ts"
click node_google_export "https://github.com/ts825360/newchatbot/blob/main/lib/server/google-export.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_auth_ui,node_membership,node_room_ui,node_workspace toneBlue
class node_calendar_ui,node_timetable,node_prep_review,node_prep_api,node_retreat_prep,node_survey_ui,node_transport_ui,node_transport_api,node_transport_rules toneAmber
class node_chat_ui,node_chat_api,node_chat_engine,node_proposal toneMint
class node_backend_client,node_data_api,node_records,node_auth_server,node_database toneRose
class node_google_forms,node_forms_api,node_google_calendar,node_google_export,node_user,node_google,node_ai_service toneIndigo
```

## Components

### 화면과 계정

- [로그인 가입](https://github.com/ts825360/newchatbot/blob/main/components/auth-screen.tsx): `components/auth-screen.tsx`
- [구성원 관리](https://github.com/ts825360/newchatbot/blob/main/components/membership-screen.tsx): `components/membership-screen.tsx`
- [행사방 탐색](https://github.com/ts825360/newchatbot/blob/main/components/room-lobby.tsx): `components/room-lobby.tsx`
- [행사 작업공간](https://github.com/ts825360/newchatbot/blob/main/app/workspace/page.tsx): `app/workspace/page.tsx`

### 행사 작업

- [공동 일정](https://github.com/ts825360/newchatbot/blob/main/components/event-workspace.tsx): `components/event-workspace.tsx`
- [당일 시간표](https://github.com/ts825360/newchatbot/blob/main/lib/timetable.ts): `lib/timetable.ts`
- [준비 진행 검토](https://github.com/ts825360/newchatbot/blob/main/components/preparation-progress-review.tsx): `components/preparation-progress-review.tsx`
- [준비 진행 API](https://github.com/ts825360/newchatbot/blob/main/app/api/preparation-progress/route.ts): `app/api/preparation-progress/route.ts`
- [준비 자료](https://github.com/ts825360/newchatbot/blob/main/lib/retreat-preparation.ts): `lib/retreat-preparation.ts`
- [참가 설문](https://github.com/ts825360/newchatbot/blob/main/components/retreat-preparation-panel.tsx): `components/retreat-preparation-panel.tsx`
- [이동 배정 화면](https://github.com/ts825360/newchatbot/blob/main/components/transport-panel.tsx): `components/transport-panel.tsx`
- [이동 배정 API](https://github.com/ts825360/newchatbot/blob/main/app/api/transport/route.ts): `app/api/transport/route.ts`
- [이동 검증](https://github.com/ts825360/newchatbot/blob/main/lib/transport.ts): `lib/transport.ts`

### AI 행사비서

- [AI 대화 화면](https://github.com/ts825360/newchatbot/blob/main/components/chat-panel.tsx): `components/chat-panel.tsx`
- [대화 API](https://github.com/ts825360/newchatbot/blob/main/app/api/chat/route.ts): `app/api/chat/route.ts`
- [대화 처리](https://github.com/ts825360/newchatbot/blob/main/lib/server/chat.ts): `lib/server/chat.ts`
- [제안 승인 반영](https://github.com/ts825360/newchatbot/blob/main/lib/proposal-application.ts): `lib/proposal-application.ts`

### 서버와 저장

- [브라우저 데이터 클라이언트](https://github.com/ts825360/newchatbot/blob/main/lib/backend-client.ts): `lib/backend-client.ts`
- [기록 API](https://github.com/ts825360/newchatbot/blob/main/app/api/data/route.ts): `app/api/data/route.ts`
- [기록 처리](https://github.com/ts825360/newchatbot/blob/main/lib/server/records.ts): `lib/server/records.ts`
- [인증 권한](https://github.com/ts825360/newchatbot/blob/main/lib/server/auth.ts): `lib/server/auth.ts`
- [SQLite 저장소](https://github.com/ts825360/newchatbot/blob/main/lib/server/database.ts): `lib/server/database.ts`

### 외부 연동

- [Google Forms 초안](https://github.com/ts825360/newchatbot/blob/main/lib/server/google-form-drafts.ts): `lib/server/google-form-drafts.ts`
- [Forms 초안 API](https://github.com/ts825360/newchatbot/blob/main/app/api/integrations/google-form-drafts/route.ts): `app/api/integrations/google-form-drafts/route.ts`
- [Google 일정 연결](https://github.com/ts825360/newchatbot/blob/main/lib/server/google-calendar.ts): `lib/server/google-calendar.ts`
- [Google 내보내기](https://github.com/ts825360/newchatbot/blob/main/lib/server/google-export.ts): `lib/server/google-export.ts`

### Other components

- **담당자**
- **Google 서비스**
- **AI 제공자**

## Connections

- 담당자 → 로그인 가입: 로그인 요청 (evidence: `README.md`)
- 담당자 → 행사방 탐색: 행사방 선택 (evidence: `README.md`)
- 담당자 → 행사 작업공간: 행사 관리 (evidence: `README.md`)
- 로그인 가입 → 브라우저 데이터 클라이언트: 인증 사용 (evidence: `components/auth-screen.tsx`)
- 로그인 가입 → 인증 권한: 계정 요청
- 구성원 관리 → 브라우저 데이터 클라이언트: 계정 데이터 사용 (evidence: `components/membership-screen.tsx`)
- 행사방 탐색 → 브라우저 데이터 클라이언트: 행사방 데이터 사용 (evidence: `components/room-lobby.tsx`)
- 행사 작업공간 → AI 대화 화면: 대화 제공
- 행사 작업공간 → 공동 일정: 일정 제공
- 행사 작업공간 → 당일 시간표: 시간표 제공
- 행사 작업공간 → 준비 진행 검토: 준비 검토 제공
- 준비 진행 검토 → 브라우저 데이터 클라이언트: 기록 조회 (evidence: `components/preparation-progress-review.tsx`)
- 준비 진행 검토 → 준비 진행 API: 진행도 제출 (evidence: `components/preparation-progress-review.tsx`)
- 준비 진행 API → 인증 권한: 사용자 확인 (evidence: `app/api/preparation-progress/route.ts`)
- 준비 진행 검토 → 준비 자료: 검토 기준 사용 (evidence: `components/preparation-progress-review.tsx`)
- 행사 작업공간 → 참가 설문: 설문 관리 제공
- 행사 작업공간 → 이동 배정 화면: 이동 관리 제공
- 이동 배정 화면 → 이동 배정 API: 배정 요청
- 이동 배정 API → 인증 권한: 권한 확인 (evidence: `app/api/transport/route.ts`)
- 이동 배정 API → 이동 검증: 입력 검증 (evidence: `app/api/transport/route.ts`)
- AI 대화 화면 → 대화 API: 대화送信
- 대화 API → 인증 권한: 사용자 확인 (evidence: `app/api/chat/route.ts`)
- 대화 API → 대화 처리: 대화 위임 (evidence: `app/api/chat/route.ts`)
- 대화 처리 → AI 제공자: 응답 요청
- AI 대화 화면 → 제안 승인 반영: 승인 후 반영 (evidence: `README.md`)
- 브라우저 데이터 클라이언트 → 기록 API: 기록 동기화
- 기록 API → 인증 권한: 사용자 확인 (evidence: `app/api/data/route.ts`)
- 기록 API → 기록 처리: 기록 읽기쓰기 (evidence: `app/api/data/route.ts`)
- 기록 처리 → SQLite 저장소: 저장소 사용
- Forms 초안 API → 인증 권한: 사용자 확인 (evidence: `app/api/integrations/google-form-drafts/route.ts`)
- Forms 초안 API → Google 일정 연결: Google 세션 조회 (evidence: `app/api/integrations/google-form-drafts/route.ts`)
- Forms 초안 API → Google Forms 초안: 초안 생성 (evidence: `app/api/integrations/google-form-drafts/route.ts`)
- Google Forms 초안 → Google 서비스: 초안 작성
- Google 일정 연결 → Google 서비스: 일정 연동
- 기록 API → Google 내보내기: 내보내기 예약 (evidence: `app/api/data/route.ts`)
- Google 내보내기 → Google 서비스: 자료 내보내기
