# 100-hours-a-week/ktb4-2nd-fe architecture

> Architecture diagram of the GitHub repository 100-hours-a-week/ktb4-2nd-fe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/100-hours-a-week/ktb4-2nd-fe
- Repository: https://github.com/100-hours-a-week/ktb4-2nd-fe

## Overview

여담은 여행 사진을 업로드·자동 정리해 여행 기록으로 만들고, 회원이 여행과 사진을 조회·관리하는 프런트엔드입니다. 주 흐름은 여행 생성 화면에서 정보와 사진을 제출하고, 처리 상태를 확인한 뒤 여행을 조회하는 것입니다. 로그인, 여행 목록·상세, 사진 관리, 계정 관리와 약관도 주요 기능입니다. 그래프는 확인된 호출과 README 설명을 구분해 표시했습니다. 일부 화면과 기능은 트리 및 SOURCE INDEX만 확인했으므로 관계를 추정해 연결하지 않았습니다.

Main entry points: [`app/(protected)`](https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/app/(protected)) (보호 경로), [`src/features/createTrip/model/useTripCreateSubmit.ts`](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/features/createTrip/model/useTripCreateSubmit.ts) (생성·사진 제출), [`app/(public)`](https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/app/(public)) (공개 경로), [`src/shared/api/browser/apiClient.ts`](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/shared/api/browser/apiClient.ts) (브라우저 API 클라이언트)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["화면과 라우팅"]
  node_protected_routes["보호 경로"]
  node_public_routes["공개 경로"]
  node_home["홈 화면<br/>[homePage.tsx]"]
  node_login["로그인 화면<br/>[loginPage.tsx]"]
  node_trip_create_screen["여행 생성 화면<br/>[tripCreatePage.tsx]"]
end

subgraph group_identity["로그인과 계정"]
  node_callback["로그인 콜백"]
  node_kakao["카카오 로그인"]
  node_signup["가입 완료"]
  node_account["계정 관리"]
  node_user["현재 사용자 조회<br/>[getCurrentUser.ts]"]
end

subgraph group_journeys["여행 기록"]
  node_trip_submit["생성·사진 제출"]
  node_trip_api["여행 생성 API<br/>[createTrip.ts]"]
  node_upload_api["초기 사진 업로드"]
  node_processing_api["처리 상태 조회"]
  node_trip_list["여행 목록<br/>[tripListPage.tsx]"]
  node_trip_list_feature["목록·즐겨찾기"]
  node_trip_detail["여행 상세<br/>[tripDetailPage.tsx]"]
  node_photo_list["장소별 사진<br/>[photoListPage.tsx]"]
  node_photo_feature["사진 조회·다운로드"]
end

subgraph group_platform["공통 기반"]
  node_api_client["브라우저 API 클라이언트<br/>[apiClient.ts]"]
  node_session_refresh["세션 갱신<br/>[refreshSession.ts]"]
  node_analytics["분석 이벤트<br/>[analytics.ts]"]
end

node_visitor(("방문자·회원"))

node_visitor -->|"탐색"| node_public_routes
node_visitor -->|"이용"| node_protected_routes
node_protected_routes -->|"연결"| node_home
node_protected_routes -->|"연결"| node_trip_create_screen
node_protected_routes -->|"연결"| node_trip_list
node_protected_routes -->|"연결"| node_trip_detail
node_public_routes -->|"연결"| node_login
node_public_routes -->|"연결"| node_callback
node_public_routes -->|"연결"| node_signup
node_callback -->|"교환 호출"| node_kakao
node_trip_create_screen -.->|"제출 요청"| node_trip_submit
node_trip_submit -->|"생성 호출"| node_trip_api
node_trip_submit -->|"사진 업로드"| node_upload_api
node_trip_submit -->|"상태 조회"| node_processing_api
node_trip_submit -->|"기록 전송"| node_analytics
node_trip_list -.->|"기능 사용"| node_trip_list_feature
node_trip_detail -->|"사진 화면 이동"| node_photo_list
node_photo_list -.->|"기능 사용"| node_photo_feature
node_trip_list_feature -.->|"API 요청"| node_api_client
node_photo_feature -.->|"API 요청"| node_api_client
node_api_client -->|"401 갱신"| node_session_refresh
node_account -.->|"API 요청"| node_api_client
node_account -->|"신원 초기화"| node_analytics
node_protected_routes -->|"사용자 조회"| node_user

click node_protected_routes "https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/app/(protected)"
click node_public_routes "https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/app/(public)"
click node_home "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/home/ui/homePage.tsx"
click node_login "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/login/ui/loginPage.tsx"
click node_callback "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/authCallback/ui/authCallbackPage.tsx"
click node_kakao "https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/kakaoLogin"
click node_signup "https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/completeSignup"
click node_account "https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/manageAccount"
click node_trip_create_screen "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/tripCreate/ui/tripCreatePage.tsx"
click node_trip_submit "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/features/createTrip/model/useTripCreateSubmit.ts"
click node_trip_api "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/features/createTrip/api/createTrip.ts"
click node_upload_api "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/features/createTrip/api/uploadInitialAttachments.ts"
click node_processing_api "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/features/createTrip/api/getTripProcessingStatus.ts"
click node_trip_list "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/tripList/ui/tripListPage.tsx"
click node_trip_list_feature "https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/tripList"
click node_trip_detail "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/tripDetail/ui/tripDetailPage.tsx"
click node_photo_list "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/photoList/ui/photoListPage.tsx"
click node_photo_feature "https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/photoList"
click node_api_client "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/shared/api/browser/apiClient.ts"
click node_session_refresh "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/shared/api/browser/refreshSession.ts"
click node_user "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/entities/user/api/getCurrentUser.ts"
click node_analytics "https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/shared/lib/analytics/analytics.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_protected_routes,node_public_routes,node_home,node_login,node_trip_create_screen toneBlue
class node_callback,node_kakao,node_signup,node_account,node_user toneAmber
class node_trip_submit,node_trip_api,node_upload_api,node_processing_api,node_trip_list,node_trip_list_feature,node_trip_detail,node_photo_list,node_photo_feature toneMint
class node_api_client,node_session_refresh,node_analytics toneRose
class node_visitor toneIndigo
```

## Components

### 화면과 라우팅

- [보호 경로](https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/app/(protected)): `app/(protected)`
- [공개 경로](https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/app/(public)): `app/(public)`
- [홈 화면](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/home/ui/homePage.tsx): `src/_pages/home/ui/homePage.tsx`
- [로그인 화면](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/login/ui/loginPage.tsx): `src/_pages/login/ui/loginPage.tsx`
- [여행 생성 화면](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/tripCreate/ui/tripCreatePage.tsx): `src/_pages/tripCreate/ui/tripCreatePage.tsx`

### 로그인과 계정

- [로그인 콜백](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/authCallback/ui/authCallbackPage.tsx): `src/_pages/authCallback/ui/authCallbackPage.tsx`
- [카카오 로그인](https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/kakaoLogin): `src/features/kakaoLogin`
- [가입 완료](https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/completeSignup): `src/features/completeSignup`
- [계정 관리](https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/manageAccount): `src/features/manageAccount`
- [현재 사용자 조회](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/entities/user/api/getCurrentUser.ts): `src/entities/user/api/getCurrentUser.ts`

### 여행 기록

- [생성·사진 제출](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/features/createTrip/model/useTripCreateSubmit.ts): `src/features/createTrip/model/useTripCreateSubmit.ts`
- [여행 생성 API](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/features/createTrip/api/createTrip.ts): `src/features/createTrip/api/createTrip.ts`
- [초기 사진 업로드](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/features/createTrip/api/uploadInitialAttachments.ts): `src/features/createTrip/api/uploadInitialAttachments.ts`
- [처리 상태 조회](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/features/createTrip/api/getTripProcessingStatus.ts): `src/features/createTrip/api/getTripProcessingStatus.ts`
- [여행 목록](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/tripList/ui/tripListPage.tsx): `src/_pages/tripList/ui/tripListPage.tsx`
- [목록·즐겨찾기](https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/tripList): `src/features/tripList`
- [여행 상세](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/tripDetail/ui/tripDetailPage.tsx): `src/_pages/tripDetail/ui/tripDetailPage.tsx`
- [장소별 사진](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/_pages/photoList/ui/photoListPage.tsx): `src/_pages/photoList/ui/photoListPage.tsx`
- [사진 조회·다운로드](https://github.com/100-hours-a-week/ktb4-2nd-fe/tree/main/src/features/photoList): `src/features/photoList`

### 공통 기반

- [브라우저 API 클라이언트](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/shared/api/browser/apiClient.ts): `src/shared/api/browser/apiClient.ts`
- [세션 갱신](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/shared/api/browser/refreshSession.ts): `src/shared/api/browser/refreshSession.ts`
- [분석 이벤트](https://github.com/100-hours-a-week/ktb4-2nd-fe/blob/main/src/shared/lib/analytics/analytics.ts): `src/shared/lib/analytics/analytics.ts`

### Other components

- **방문자·회원**

## Connections

- 방문자·회원 → 공개 경로: 탐색
- 방문자·회원 → 보호 경로: 이용
- 보호 경로 → 홈 화면: 연결 (evidence: `app/(protected)/page.tsx`)
- 보호 경로 → 여행 생성 화면: 연결 (evidence: `app/(protected)/trips/create/page.tsx`)
- 보호 경로 → 여행 목록: 연결 (evidence: `app/(protected)/trips/page.tsx`)
- 보호 경로 → 여행 상세: 연결 (evidence: `app/(protected)/trips/[tripId]/page.tsx`)
- 공개 경로 → 로그인 화면: 연결 (evidence: `app/(public)/login/page.tsx`)
- 공개 경로 → 로그인 콜백: 연결 (evidence: `app/(public)/auth/callback/page.tsx`)
- 공개 경로 → 가입 완료: 연결 (evidence: `app/(public)/signup/page.tsx`)
- 로그인 콜백 → 카카오 로그인: 교환 호출 (evidence: `src/_pages/authCallback/ui/authCallbackPage.tsx`)
- 여행 생성 화면 → 생성·사진 제출: 제출 요청
- 생성·사진 제출 → 여행 생성 API: 생성 호출 (evidence: `src/features/createTrip/model/useTripCreateSubmit.ts`)
- 생성·사진 제출 → 초기 사진 업로드: 사진 업로드 (evidence: `src/features/createTrip/model/useTripCreateSubmit.ts`)
- 생성·사진 제출 → 처리 상태 조회: 상태 조회 (evidence: `src/features/createTrip/model/useTripCreateSubmit.ts`)
- 생성·사진 제출 → 분석 이벤트: 기록 전송 (evidence: `src/features/createTrip/model/useTripCreateSubmit.ts`)
- 여행 목록 → 목록·즐겨찾기: 기능 사용
- 여행 상세 → 장소별 사진: 사진 화면 이동
- 장소별 사진 → 사진 조회·다운로드: 기능 사용
- 목록·즐겨찾기 → 브라우저 API 클라이언트: API 요청
- 사진 조회·다운로드 → 브라우저 API 클라이언트: API 요청
- 브라우저 API 클라이언트 → 세션 갱신: 401 갱신 (evidence: `src/shared/api/browser/apiClient.ts`)
- 계정 관리 → 브라우저 API 클라이언트: API 요청
- 계정 관리 → 분석 이벤트: 신원 초기화 (evidence: `src/features/manageAccount/model/useWithdraw.ts`)
- 보호 경로 → 현재 사용자 조회: 사용자 조회 (evidence: `app/(protected)/trips/create/page.tsx`)
