# yeon-sik/pricetrace architecture

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

- Interactive diagram: https://gitdiagram.com/yeon-sik/pricetrace
- Repository: https://github.com/yeon-sik/pricetrace

## Overview

PriceTrace는 출처와 관측 시점이 있는 영수증 가격 및 공식 판매채널 등재를 탐색하는 웹 앱입니다. 주 흐름은 공개 영수증·공식 카탈로그 로드, 상품 관측 그룹화, 상품·매장·식당 탐색, 출처가 표시된 장바구니 관리입니다. 별도 기능으로 관리자 검토, 영양 정보 연결, 인증 사용자 관측, 영수증 입력 계약을 포함했습니다. 관계는 발췌된 page.tsx·SOURCE INDEX 참조 또는 README 설명에 근거하며, 세부 저장소 동작은 일부만 확인됐습니다.

Main entry points: [`src/app/page.tsx`](https://github.com/yeon-sik/pricetrace/blob/main/src/app/page.tsx) (앱 진입 및 라우팅), [`src/domain/product-browser.ts`](https://github.com/yeon-sik/pricetrace/blob/main/src/domain/product-browser.ts) (상품 관측 그룹화), [`src/repositories/public-official-channel-catalog.repository.ts`](https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/public-official-channel-catalog.repository.ts) (공식 채널 카탈로그), [`src/features/product-browser/use-authenticated-product-observations.ts`](https://github.com/yeon-sik/pricetrace/blob/main/src/features/product-browser/use-authenticated-product-observations.ts) (사용자 구매 관측)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_explore["탐색 및 관측"]
  node_app["앱 진입 및 라우팅<br/>[page.tsx]"]
  node_public_receipts["공개 영수증 읽기"]
  node_receipt_model["영수증 관측 모델<br/>[receipt.ts]"]
  node_product_groups["상품 관측 그룹화<br/>[product-browser.ts]"]
  node_product_view["상품 탐색<br/>[ProductBrowser.tsx]"]
  node_market_view["매장·가격 탐색<br/>[MarketBrowser.tsx]"]
  node_restaurant_view["식당 탐색"]
  node_menu_model["식당 메뉴 도메인<br/>[restaurant-menu.ts]"]
end

subgraph group_catalog["상품 식별 및 검토"]
  node_official_catalog["공식 채널 카탈로그"]
  node_official_model["공식 상품 식별"]
  node_name_review["PX 이름 검토"]
  node_review_model["이름 검토 규칙"]
  node_nutrition["영양 정보 연결"]
end

subgraph group_user["사용자 기능"]
  node_auth["인증 UI<br/>[AuthPanel.tsx]"]
  node_private_observations["사용자 구매 관측"]
  node_observation_repo["관측 저장소"]
  node_supabase["Supabase 연결<br/>[client.ts]"]
  node_cart_view["장바구니 화면<br/>[CartPage.tsx]"]
  node_cart_store["장바구니 상태<br/>[cart.store.ts]"]
  node_cart_repo["장바구니 저장<br/>[cart.repository.ts]"]
end

subgraph group_operations["운영 및 입력"]
  node_admin["관리자 검토<br/>[AdminPage.tsx]"]
  node_approval["상품 승인 UI"]
  node_receipt_contract["영수증 계약 검증<br/>[receipt.ts]"]
  node_verified_ingestion["검증 영수증 입력"]
end

node_visitor(("방문자"))

node_visitor -->|"탐색 요청"| node_app
node_app -->|"영수증 로드"| node_public_receipts
node_app -->|"관측 그룹화"| node_product_groups
node_public_receipts -.->|"관측 데이터"| node_receipt_model
node_app -->|"카탈로그 로드"| node_official_catalog
node_app -->|"검토 항목 로드"| node_name_review
node_name_review -->|"검증 위임"| node_review_model
node_review_model -->|"등재 일치 확인"| node_official_catalog
node_app -->|"상품 화면 표시"| node_product_view
node_app -->|"매장 화면 표시"| node_market_view
node_app -->|"식당 화면 표시"| node_restaurant_view
node_restaurant_view -.->|"메뉴 탐색"| node_menu_model
node_product_groups -->|"영수증 규칙 사용"| node_receipt_model
node_product_groups -->|"공식 상품 참조"| node_official_model
node_official_catalog -.->|"공식 등재 데이터"| node_official_model
node_app -->|"관리자 화면 표시"| node_admin
node_admin -->|"승인 패널 표시"| node_approval
node_product_view -.->|"영양 정보 제공"| node_nutrition
node_visitor -.->|"인증 조작"| node_auth
node_private_observations -->|"클라이언트 요청"| node_supabase
node_private_observations -->|"관측 로드"| node_observation_repo
node_app -->|"장바구니 표시"| node_cart_view
node_cart_view -.->|"수량 변경"| node_cart_store
node_cart_store -->|"상태 저장"| node_cart_repo
node_receipt_contract -.->|"입력 계약 기반"| node_verified_ingestion

click node_app "https://github.com/yeon-sik/pricetrace/blob/main/src/app/page.tsx"
click node_public_receipts "https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/public-receipt.repository.ts"
click node_receipt_model "https://github.com/yeon-sik/pricetrace/blob/main/src/domain/receipt.ts"
click node_product_groups "https://github.com/yeon-sik/pricetrace/blob/main/src/domain/product-browser.ts"
click node_product_view "https://github.com/yeon-sik/pricetrace/blob/main/src/app/ProductBrowser.tsx"
click node_market_view "https://github.com/yeon-sik/pricetrace/blob/main/src/app/MarketBrowser.tsx"
click node_restaurant_view "https://github.com/yeon-sik/pricetrace/blob/main/src/app/RestaurantBrowser.tsx"
click node_menu_model "https://github.com/yeon-sik/pricetrace/blob/main/src/domain/restaurant-menu.ts"
click node_official_catalog "https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/public-official-channel-catalog.repository.ts"
click node_official_model "https://github.com/yeon-sik/pricetrace/blob/main/src/domain/official-product.ts"
click node_name_review "https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/px-product-name-review.repository.ts"
click node_review_model "https://github.com/yeon-sik/pricetrace/blob/main/src/domain/px-product-name-review.ts"
click node_admin "https://github.com/yeon-sik/pricetrace/blob/main/src/app/AdminPage.tsx"
click node_approval "https://github.com/yeon-sik/pricetrace/blob/main/src/app/AdminApprovalExecutionPanel.tsx"
click node_nutrition "https://github.com/yeon-sik/pricetrace/blob/main/src/features/product-nutrition/ProductNutritionPanel.tsx"
click node_auth "https://github.com/yeon-sik/pricetrace/blob/main/src/app/AuthPanel.tsx"
click node_private_observations "https://github.com/yeon-sik/pricetrace/blob/main/src/features/product-browser/use-authenticated-product-observations.ts"
click node_observation_repo "https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/authenticated-product-observation.repository.ts"
click node_supabase "https://github.com/yeon-sik/pricetrace/blob/main/src/lib/supabase/client.ts"
click node_cart_view "https://github.com/yeon-sik/pricetrace/blob/main/src/app/CartPage.tsx"
click node_cart_store "https://github.com/yeon-sik/pricetrace/blob/main/src/stores/cart.store.ts"
click node_cart_repo "https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/cart.repository.ts"
click node_receipt_contract "https://github.com/yeon-sik/pricetrace/blob/main/chatgpt-project-sources/receipt-contract/receipt.ts"
click node_verified_ingestion "https://github.com/yeon-sik/pricetrace/blob/main/src/domain/verified-receipt-ingestion.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_app,node_public_receipts,node_receipt_model,node_product_groups,node_product_view,node_market_view,node_restaurant_view,node_menu_model toneBlue
class node_official_catalog,node_official_model,node_name_review,node_review_model,node_nutrition toneAmber
class node_auth,node_private_observations,node_observation_repo,node_supabase,node_cart_view,node_cart_store,node_cart_repo toneMint
class node_admin,node_approval,node_receipt_contract,node_verified_ingestion toneRose
class node_visitor toneIndigo
```

## Components

### 탐색 및 관측

- [앱 진입 및 라우팅](https://github.com/yeon-sik/pricetrace/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [공개 영수증 읽기](https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/public-receipt.repository.ts): `src/repositories/public-receipt.repository.ts`
- [영수증 관측 모델](https://github.com/yeon-sik/pricetrace/blob/main/src/domain/receipt.ts): `src/domain/receipt.ts`
- [상품 관측 그룹화](https://github.com/yeon-sik/pricetrace/blob/main/src/domain/product-browser.ts): `src/domain/product-browser.ts`
- [상품 탐색](https://github.com/yeon-sik/pricetrace/blob/main/src/app/ProductBrowser.tsx): `src/app/ProductBrowser.tsx`
- [매장·가격 탐색](https://github.com/yeon-sik/pricetrace/blob/main/src/app/MarketBrowser.tsx): `src/app/MarketBrowser.tsx`
- [식당 탐색](https://github.com/yeon-sik/pricetrace/blob/main/src/app/RestaurantBrowser.tsx): `src/app/RestaurantBrowser.tsx`
- [식당 메뉴 도메인](https://github.com/yeon-sik/pricetrace/blob/main/src/domain/restaurant-menu.ts): `src/domain/restaurant-menu.ts`

### 상품 식별 및 검토

- [공식 채널 카탈로그](https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/public-official-channel-catalog.repository.ts): `src/repositories/public-official-channel-catalog.repository.ts`
- [공식 상품 식별](https://github.com/yeon-sik/pricetrace/blob/main/src/domain/official-product.ts): `src/domain/official-product.ts`
- [PX 이름 검토](https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/px-product-name-review.repository.ts): `src/repositories/px-product-name-review.repository.ts`
- [이름 검토 규칙](https://github.com/yeon-sik/pricetrace/blob/main/src/domain/px-product-name-review.ts): `src/domain/px-product-name-review.ts`
- [영양 정보 연결](https://github.com/yeon-sik/pricetrace/blob/main/src/features/product-nutrition/ProductNutritionPanel.tsx): `src/features/product-nutrition/ProductNutritionPanel.tsx`

### 사용자 기능

- [인증 UI](https://github.com/yeon-sik/pricetrace/blob/main/src/app/AuthPanel.tsx): `src/app/AuthPanel.tsx`
- [사용자 구매 관측](https://github.com/yeon-sik/pricetrace/blob/main/src/features/product-browser/use-authenticated-product-observations.ts): `src/features/product-browser/use-authenticated-product-observations.ts`
- [관측 저장소](https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/authenticated-product-observation.repository.ts): `src/repositories/authenticated-product-observation.repository.ts`
- [Supabase 연결](https://github.com/yeon-sik/pricetrace/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [장바구니 화면](https://github.com/yeon-sik/pricetrace/blob/main/src/app/CartPage.tsx): `src/app/CartPage.tsx`
- [장바구니 상태](https://github.com/yeon-sik/pricetrace/blob/main/src/stores/cart.store.ts): `src/stores/cart.store.ts`
- [장바구니 저장](https://github.com/yeon-sik/pricetrace/blob/main/src/repositories/cart.repository.ts): `src/repositories/cart.repository.ts`

### 운영 및 입력

- [관리자 검토](https://github.com/yeon-sik/pricetrace/blob/main/src/app/AdminPage.tsx): `src/app/AdminPage.tsx`
- [상품 승인 UI](https://github.com/yeon-sik/pricetrace/blob/main/src/app/AdminApprovalExecutionPanel.tsx): `src/app/AdminApprovalExecutionPanel.tsx`
- [영수증 계약 검증](https://github.com/yeon-sik/pricetrace/blob/main/chatgpt-project-sources/receipt-contract/receipt.ts): `chatgpt-project-sources/receipt-contract/receipt.ts`
- [검증 영수증 입력](https://github.com/yeon-sik/pricetrace/blob/main/src/domain/verified-receipt-ingestion.ts): `src/domain/verified-receipt-ingestion.ts`

### Other components

- **방문자**

## Connections

- 방문자 → 앱 진입 및 라우팅: 탐색 요청 (evidence: `src/app/page.tsx`)
- 앱 진입 및 라우팅 → 공개 영수증 읽기: 영수증 로드 (evidence: `src/app/page.tsx`)
- 앱 진입 및 라우팅 → 상품 관측 그룹화: 관측 그룹화 (evidence: `src/app/page.tsx`)
- 공개 영수증 읽기 → 영수증 관측 모델: 관측 데이터
- 앱 진입 및 라우팅 → 공식 채널 카탈로그: 카탈로그 로드 (evidence: `src/app/page.tsx`)
- 앱 진입 및 라우팅 → PX 이름 검토: 검토 항목 로드 (evidence: `src/app/page.tsx`)
- PX 이름 검토 → 이름 검토 규칙: 검증 위임 (evidence: `src/repositories/px-product-name-review.repository.ts`)
- 이름 검토 규칙 → 공식 채널 카탈로그: 등재 일치 확인 (evidence: `src/domain/px-product-name-review.ts`)
- 앱 진입 및 라우팅 → 상품 탐색: 상품 화면 표시 (evidence: `src/app/page.tsx`)
- 앱 진입 및 라우팅 → 매장·가격 탐색: 매장 화면 표시 (evidence: `src/app/page.tsx`)
- 앱 진입 및 라우팅 → 식당 탐색: 식당 화면 표시 (evidence: `src/app/page.tsx`)
- 식당 탐색 → 식당 메뉴 도메인: 메뉴 탐색
- 상품 관측 그룹화 → 영수증 관측 모델: 영수증 규칙 사용 (evidence: `src/domain/product-browser.ts`)
- 상품 관측 그룹화 → 공식 상품 식별: 공식 상품 참조 (evidence: `src/domain/product-browser.ts`)
- 공식 채널 카탈로그 → 공식 상품 식별: 공식 등재 데이터
- 앱 진입 및 라우팅 → 관리자 검토: 관리자 화면 표시 (evidence: `src/app/page.tsx`)
- 관리자 검토 → 상품 승인 UI: 승인 패널 표시 (evidence: `src/app/AdminPage.tsx`)
- 상품 탐색 → 영양 정보 연결: 영양 정보 제공
- 방문자 → 인증 UI: 인증 조작
- 사용자 구매 관측 → Supabase 연결: 클라이언트 요청 (evidence: `src/features/product-browser/use-authenticated-product-observations.ts`)
- 사용자 구매 관측 → 관측 저장소: 관측 로드 (evidence: `src/features/product-browser/use-authenticated-product-observations.ts`)
- 앱 진입 및 라우팅 → 장바구니 화면: 장바구니 표시 (evidence: `src/app/page.tsx`)
- 장바구니 화면 → 장바구니 상태: 수량 변경
- 장바구니 상태 → 장바구니 저장: 상태 저장 (evidence: `src/stores/cart.store.ts`)
- 영수증 계약 검증 → 검증 영수증 입력: 입력 계약 기반
