# jjontteok/dondon architecture

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

## Overview

돈돈 가계부는 개인 예산·거래 관리 앱으로, 브라우저에서 설정과 거래를 입력하면 API가 검증·처리하고 카테고리별로 저장합니다. 사용자는 월급날 기준 기간을 달력에서 살펴보고 날짜별 거래 및 기간 합계를 확인합니다. README에 명시된 시트/메모리 저장소 선택, 설정 가능한 카테고리와 급여일, 차트 기능도 포함했습니다. 관계는 발췌 소스·SOURCE INDEX 참조·README로 확인되는 범위에 한정했습니다. 일부 화면·저장소 구현은 발췌되지 않아 세부 내부 동작 연결은 표시하지 않았습니다.

Main entry points: [`src/components/BudgetApp.tsx`](https://github.com/jjontteok/dondon/blob/main/src/components/BudgetApp.tsx) (가계부 화면), [`src/application/container.ts`](https://github.com/jjontteok/dondon/blob/main/src/application/container.ts) (서비스 구성), [`src/application/BudgetService.ts`](https://github.com/jjontteok/dondon/blob/main/src/application/BudgetService.ts) (예산 유스케이스), [`src/application/repositories.ts`](https://github.com/jjontteok/dondon/blob/main/src/application/repositories.ts) (리포지토리)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["사용자 화면"]
  node_budgetapp["가계부 화면<br/>[BudgetApp.tsx]"]
  node_calendar["기간 달력<br/>[Calendar.tsx]"]
  node_daypanel["날짜 내역<br/>[DayPanel.tsx]"]
  node_summary["기간 요약<br/>[PeriodSummary.tsx]"]
  node_donut["도넛 차트<br/>[DonutChart.tsx]"]
  node_transactionform["거래 입력"]
  node_settingsui["설정 화면<br/>[SettingsDialog.tsx]"]
  node_loginui["로그인 화면<br/>[LoginForm.tsx]"]
  node_clientapi["브라우저 API<br/>[api.ts]"]
  node_hooks["데이터 훅"]
end

subgraph group_api["API·인증"]
  node_routes["가계부 API 라우트"]
  node_authroutes["인증 라우트"]
  node_http["HTTP 응답 처리<br/>[http.ts]"]
  node_session["세션 인증<br/>[session.ts]"]
end

subgraph group_application["유스케이스"]
  node_service["예산 유스케이스<br/>[BudgetService.ts]"]
  node_container["서비스 구성<br/>[container.ts]"]
  node_repositories["리포지토리<br/>[repositories.ts]"]
end

subgraph group_domain["예산 도메인"]
  node_period["급여일 기간<br/>[period.ts]"]
  node_transaction["거래 검증<br/>[transaction.ts]"]
  node_category["카테고리 카탈로그<br/>[category.ts]"]
  node_ledger["거래 집계<br/>[ledger.ts]"]
  node_settings["가계부 설정<br/>[settings.ts]"]
end

subgraph group_persistence["저장소"]
  node_table["테이블 추상화<br/>[Table.ts]"]
  node_sheets["시트 테이블<br/>[SheetTable.ts]"]
  node_sheetsclient["Google Sheets REST<br/>[SheetsClient.ts]"]
  node_memory["메모리 테이블<br/>[MemoryTable.ts]"]
  node_schemas["시트 스키마<br/>[schemas.ts]"]
end

node_user(("가계부 사용자"))
node_google[("Google Sheets")]

node_user -->|"사용"| node_budgetapp
node_budgetapp -->|"표시"| node_calendar
node_budgetapp -->|"표시"| node_daypanel
node_budgetapp -->|"표시"| node_summary
node_budgetapp -->|"표시"| node_settingsui
node_daypanel -->|"렌더링"| node_donut
node_summary -->|"렌더링"| node_donut
node_daypanel -->|"렌더링"| node_transactionform
node_budgetapp -->|"사용"| node_hooks
node_hooks -->|"호출"| node_clientapi
node_settingsui -->|"호출"| node_clientapi
node_loginui -.->|"호출"| node_clientapi
node_clientapi -->|"HTTP 요청"| node_routes
node_routes -->|"공통 처리"| node_http
node_routes -->|"서비스 획득"| node_container
node_authroutes -->|"세션 처리"| node_session
node_user -->|"로그인"| node_loginui
node_service -->|"저장소 위임"| node_repositories
node_container -->|"생성"| node_service
node_container -->|"구성"| node_repositories
node_container -->|"선택 구성"| node_sheets
node_container -->|"구성"| node_sheetsclient
node_container -->|"대체 구성"| node_memory
node_repositories -->|"추상화 사용"| node_table
node_repositories -->|"스키마 사용"| node_schemas
node_sheets -.->|"REST 호출"| node_sheetsclient
node_sheetsclient -.->|"시트 접근"| node_google
node_memory -->|"구현"| node_table
node_service -->|"입력 검증"| node_transaction
node_service -->|"카탈로그 규칙"| node_category
node_service -->|"설정 검증"| node_settings
node_budgetapp -->|"집계 생성"| node_ledger
node_budgetapp -->|"기간 계산"| node_period
node_calendar -->|"일별 집계"| node_ledger
node_calendar -->|"기간 표시"| node_period
node_ledger -->|"카탈로그 참조"| node_category
node_period -->|"시작일 검증"| node_settings

click node_budgetapp "https://github.com/jjontteok/dondon/blob/main/src/components/BudgetApp.tsx"
click node_calendar "https://github.com/jjontteok/dondon/blob/main/src/components/Calendar.tsx"
click node_daypanel "https://github.com/jjontteok/dondon/blob/main/src/components/DayPanel.tsx"
click node_summary "https://github.com/jjontteok/dondon/blob/main/src/components/PeriodSummary.tsx"
click node_donut "https://github.com/jjontteok/dondon/blob/main/src/components/DonutChart.tsx"
click node_transactionform "https://github.com/jjontteok/dondon/blob/main/src/components/TransactionForm.tsx"
click node_settingsui "https://github.com/jjontteok/dondon/blob/main/src/components/SettingsDialog.tsx"
click node_loginui "https://github.com/jjontteok/dondon/blob/main/src/components/LoginForm.tsx"
click node_clientapi "https://github.com/jjontteok/dondon/blob/main/src/client/api.ts"
click node_hooks "https://github.com/jjontteok/dondon/tree/main/src/client/hooks"
click node_routes "https://github.com/jjontteok/dondon/tree/main/src/app/api"
click node_authroutes "https://github.com/jjontteok/dondon/tree/main/src/app/api/auth"
click node_http "https://github.com/jjontteok/dondon/blob/main/src/lib/http.ts"
click node_session "https://github.com/jjontteok/dondon/blob/main/src/lib/session.ts"
click node_service "https://github.com/jjontteok/dondon/blob/main/src/application/BudgetService.ts"
click node_container "https://github.com/jjontteok/dondon/blob/main/src/application/container.ts"
click node_repositories "https://github.com/jjontteok/dondon/blob/main/src/application/repositories.ts"
click node_period "https://github.com/jjontteok/dondon/blob/main/src/domain/period.ts"
click node_transaction "https://github.com/jjontteok/dondon/blob/main/src/domain/transaction.ts"
click node_category "https://github.com/jjontteok/dondon/blob/main/src/domain/category.ts"
click node_ledger "https://github.com/jjontteok/dondon/blob/main/src/domain/ledger.ts"
click node_settings "https://github.com/jjontteok/dondon/blob/main/src/domain/settings.ts"
click node_table "https://github.com/jjontteok/dondon/blob/main/src/infrastructure/storage/Table.ts"
click node_sheets "https://github.com/jjontteok/dondon/blob/main/src/infrastructure/sheets/SheetTable.ts"
click node_sheetsclient "https://github.com/jjontteok/dondon/blob/main/src/infrastructure/sheets/SheetsClient.ts"
click node_memory "https://github.com/jjontteok/dondon/blob/main/src/infrastructure/storage/MemoryTable.ts"
click node_schemas "https://github.com/jjontteok/dondon/blob/main/src/infrastructure/storage/schemas.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_budgetapp,node_calendar,node_daypanel,node_summary,node_donut,node_transactionform,node_settingsui,node_loginui,node_clientapi,node_hooks toneBlue
class node_routes,node_authroutes,node_http,node_session,node_google toneAmber
class node_service,node_container,node_repositories toneMint
class node_period,node_transaction,node_category,node_ledger,node_settings toneRose
class node_table,node_sheets,node_sheetsclient,node_memory,node_schemas,node_user toneIndigo
```

## Components

### 사용자 화면

- [가계부 화면](https://github.com/jjontteok/dondon/blob/main/src/components/BudgetApp.tsx): `src/components/BudgetApp.tsx`
- [기간 달력](https://github.com/jjontteok/dondon/blob/main/src/components/Calendar.tsx): `src/components/Calendar.tsx`
- [날짜 내역](https://github.com/jjontteok/dondon/blob/main/src/components/DayPanel.tsx): `src/components/DayPanel.tsx`
- [기간 요약](https://github.com/jjontteok/dondon/blob/main/src/components/PeriodSummary.tsx): `src/components/PeriodSummary.tsx`
- [도넛 차트](https://github.com/jjontteok/dondon/blob/main/src/components/DonutChart.tsx): `src/components/DonutChart.tsx`
- [거래 입력](https://github.com/jjontteok/dondon/blob/main/src/components/TransactionForm.tsx): `src/components/TransactionForm.tsx`
- [설정 화면](https://github.com/jjontteok/dondon/blob/main/src/components/SettingsDialog.tsx): `src/components/SettingsDialog.tsx`
- [로그인 화면](https://github.com/jjontteok/dondon/blob/main/src/components/LoginForm.tsx): `src/components/LoginForm.tsx`
- [브라우저 API](https://github.com/jjontteok/dondon/blob/main/src/client/api.ts): `src/client/api.ts`
- [데이터 훅](https://github.com/jjontteok/dondon/tree/main/src/client/hooks): `src/client/hooks`

### API·인증

- [가계부 API 라우트](https://github.com/jjontteok/dondon/tree/main/src/app/api): `src/app/api`
- [인증 라우트](https://github.com/jjontteok/dondon/tree/main/src/app/api/auth): `src/app/api/auth`
- [HTTP 응답 처리](https://github.com/jjontteok/dondon/blob/main/src/lib/http.ts): `src/lib/http.ts`
- [세션 인증](https://github.com/jjontteok/dondon/blob/main/src/lib/session.ts): `src/lib/session.ts`

### 유스케이스

- [예산 유스케이스](https://github.com/jjontteok/dondon/blob/main/src/application/BudgetService.ts): `src/application/BudgetService.ts`
- [서비스 구성](https://github.com/jjontteok/dondon/blob/main/src/application/container.ts): `src/application/container.ts`
- [리포지토리](https://github.com/jjontteok/dondon/blob/main/src/application/repositories.ts): `src/application/repositories.ts`

### 예산 도메인

- [급여일 기간](https://github.com/jjontteok/dondon/blob/main/src/domain/period.ts): `src/domain/period.ts`
- [거래 검증](https://github.com/jjontteok/dondon/blob/main/src/domain/transaction.ts): `src/domain/transaction.ts`
- [카테고리 카탈로그](https://github.com/jjontteok/dondon/blob/main/src/domain/category.ts): `src/domain/category.ts`
- [거래 집계](https://github.com/jjontteok/dondon/blob/main/src/domain/ledger.ts): `src/domain/ledger.ts`
- [가계부 설정](https://github.com/jjontteok/dondon/blob/main/src/domain/settings.ts): `src/domain/settings.ts`

### 저장소

- [테이블 추상화](https://github.com/jjontteok/dondon/blob/main/src/infrastructure/storage/Table.ts): `src/infrastructure/storage/Table.ts`
- [시트 테이블](https://github.com/jjontteok/dondon/blob/main/src/infrastructure/sheets/SheetTable.ts): `src/infrastructure/sheets/SheetTable.ts`
- [Google Sheets REST](https://github.com/jjontteok/dondon/blob/main/src/infrastructure/sheets/SheetsClient.ts): `src/infrastructure/sheets/SheetsClient.ts`
- [메모리 테이블](https://github.com/jjontteok/dondon/blob/main/src/infrastructure/storage/MemoryTable.ts): `src/infrastructure/storage/MemoryTable.ts`
- [시트 스키마](https://github.com/jjontteok/dondon/blob/main/src/infrastructure/storage/schemas.ts): `src/infrastructure/storage/schemas.ts`

### Other components

- **가계부 사용자**
- **Google Sheets**

## Connections

- 가계부 사용자 → 가계부 화면: 사용
- 가계부 화면 → 기간 달력: 표시 (evidence: `src/components/BudgetApp.tsx`)
- 가계부 화면 → 날짜 내역: 표시 (evidence: `src/components/BudgetApp.tsx`)
- 가계부 화면 → 기간 요약: 표시 (evidence: `src/components/BudgetApp.tsx`)
- 가계부 화면 → 설정 화면: 표시 (evidence: `src/components/BudgetApp.tsx`)
- 날짜 내역 → 도넛 차트: 렌더링 (evidence: `src/components/DayPanel.tsx`)
- 기간 요약 → 도넛 차트: 렌더링 (evidence: `src/components/PeriodSummary.tsx`)
- 날짜 내역 → 거래 입력: 렌더링 (evidence: `src/components/DayPanel.tsx`)
- 가계부 화면 → 데이터 훅: 사용 (evidence: `src/components/BudgetApp.tsx`)
- 데이터 훅 → 브라우저 API: 호출 (evidence: `src/client/hooks/useTransactions.ts`)
- 설정 화면 → 브라우저 API: 호출 (evidence: `src/components/SettingsDialog.tsx`)
- 로그인 화면 → 브라우저 API: 호출
- 브라우저 API → 가계부 API 라우트: HTTP 요청 (evidence: `src/client/api.ts`)
- 가계부 API 라우트 → HTTP 응답 처리: 공통 처리 (evidence: `src/app/api/transactions/route.ts`)
- 가계부 API 라우트 → 서비스 구성: 서비스 획득 (evidence: `src/app/api/transactions/route.ts`)
- 인증 라우트 → 세션 인증: 세션 처리 (evidence: `src/app/api/auth/login/route.ts`)
- 가계부 사용자 → 로그인 화면: 로그인
- 예산 유스케이스 → 리포지토리: 저장소 위임 (evidence: `src/application/BudgetService.ts`)
- 서비스 구성 → 예산 유스케이스: 생성 (evidence: `src/application/container.ts`)
- 서비스 구성 → 리포지토리: 구성 (evidence: `src/application/container.ts`)
- 서비스 구성 → 시트 테이블: 선택 구성 (evidence: `src/application/container.ts`)
- 서비스 구성 → Google Sheets REST: 구성 (evidence: `src/application/container.ts`)
- 서비스 구성 → 메모리 테이블: 대체 구성 (evidence: `src/application/container.ts`)
- 리포지토리 → 테이블 추상화: 추상화 사용 (evidence: `src/application/repositories.ts`)
- 리포지토리 → 시트 스키마: 스키마 사용 (evidence: `src/application/repositories.ts`)
- 시트 테이블 → Google Sheets REST: REST 호출
- Google Sheets REST → Google Sheets: 시트 접근
- 메모리 테이블 → 테이블 추상화: 구현 (evidence: `src/infrastructure/storage/MemoryTable.ts`)
- 예산 유스케이스 → 거래 검증: 입력 검증 (evidence: `src/application/BudgetService.ts`)
- 예산 유스케이스 → 카테고리 카탈로그: 카탈로그 규칙 (evidence: `src/application/BudgetService.ts`)
- 예산 유스케이스 → 가계부 설정: 설정 검증 (evidence: `src/application/BudgetService.ts`)
- 가계부 화면 → 거래 집계: 집계 생성 (evidence: `src/components/BudgetApp.tsx`)
- 가계부 화면 → 급여일 기간: 기간 계산 (evidence: `src/components/BudgetApp.tsx`)
- 기간 달력 → 거래 집계: 일별 집계 (evidence: `src/components/Calendar.tsx`)
- 기간 달력 → 급여일 기간: 기간 표시 (evidence: `src/components/Calendar.tsx`)
- 거래 집계 → 카테고리 카탈로그: 카탈로그 참조 (evidence: `src/domain/ledger.ts`)
- 급여일 기간 → 가계부 설정: 시작일 검증 (evidence: `src/domain/settings.ts`)
