# chorockai-lab/gearmatch-ai-mvp architecture

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

- Interactive diagram: https://gitdiagram.com/chorockai-lab/gearmatch-ai-mvp
- Repository: https://github.com/chorockai-lab/gearmatch-ai-mvp

## Overview

GearMatch AI는 러너 테스트로 동물 러너 정체성을 만들고, 프로필·현재 러닝화를 설정한 뒤 러닝 기록과 통계를 관리하고 비슷한 러너의 신발을 탐색하는 모바일 웹 MVP입니다. README는 주요 사용자 흐름과 로컬/Supabase 저장 모드를 설명합니다. 샘플로 확인한 저장소·UI 연결을 중심으로 나타냈으며, ITEMS와 일부 온보딩 화면의 세부 연결은 인덱스 참조와 문서에 근거합니다.

Main entry points: [`src/components/onboarding/CurrentShoe.tsx`](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/onboarding/CurrentShoe.tsx) (프로필·신발 설정), [`src/lib/items/repository.ts`](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/items/repository.ts) (제품 데이터 저장소), [`src/lib/onboarding/repository.ts`](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/onboarding/repository.ts) (온보딩 저장소), [`src/lib/events/track.ts`](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/events/track.ts) (행동 이벤트)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["정체성 온보딩"]
  node_landing["랜딩·테스트<br/>[page.tsx]"]
  node_test["테스트·진행 UI<br/>[Flow.tsx]"]
  node_scoring["정체성 판정<br/>[scoring.ts]"]
  node_reveal["정체성 공개<br/>[RevealView.tsx]"]
  node_profile["프로필·신발 설정<br/>[CurrentShoe.tsx]"]
end

subgraph group_running["러닝 기록 분석"]
  node_running_home["RUNNING 홈"]
  node_run_form["기록 입력<br/>[RunForm.tsx]"]
  node_run_list["기록 목록·상세<br/>[RunViews.tsx]"]
  node_stats["통계 화면<br/>[StatsViews.tsx]"]
  node_runs_hook["기록 조회 훅<br/>[useRuns.ts]"]
end

subgraph group_items["러닝화 탐색"]
  node_items_ui["비슷한 러너·저장 신발<br/>[ItemsMain.tsx]"]
  node_items_repo["제품 데이터 저장소<br/>[repository.ts]"]
  node_aggregation["러너 제품 집계<br/>[aggregate.ts]"]
end

subgraph group_platform["공통 데이터 기반"]
  node_onboarding_repo["온보딩 저장소<br/>[repository.ts]"]
  node_runs_repo["기록 저장소<br/>[repository.ts]"]
  node_events["행동 이벤트<br/>[track.ts]"]
  node_config["저장 모드 설정<br/>[config.ts]"]
  node_supabase_client["Supabase 클라이언트<br/>[client.ts]"]
end

node_runner(("러너"))
node_supabase[("Supabase")]

node_runner -->|"시작"| node_landing
node_landing -->|"진행 UI 사용"| node_test
node_test -.->|"답변 판정"| node_scoring
node_scoring -.->|"결과 제공"| node_reveal
node_reveal -.->|"온보딩 진행"| node_profile
node_profile -->|"프로필 저장"| node_onboarding_repo
node_onboarding_repo -.->|"서버 저장"| node_supabase
node_onboarding_repo -.->|"로컬 임시 저장"| node_runner
node_profile -.->|"완료 후 이동"| node_running_home
node_running_home -.->|"기록 시작"| node_run_form
node_run_form -->|"기록 생성"| node_runs_repo
node_run_list -->|"기록 조회"| node_runs_hook
node_stats -->|"기록 조회"| node_runs_hook
node_runs_hook -->|"목록·상세 조회"| node_runs_repo
node_runs_repo -->|"서버 읽기·쓰기"| node_supabase
node_items_ui -->|"제품·저장 조회"| node_items_repo
node_items_repo -->|"로컬 집계 호출"| node_aggregation
node_items_repo -->|"서버 조회·저장"| node_supabase
node_items_ui -->|"행동 기록"| node_events
node_events -->|"모드 확인"| node_config
node_events -->|"이벤트 전송"| node_supabase_client
node_config -->|"클라이언트 참조"| node_supabase_client
node_supabase_client -->|"인증·데이터 연결"| node_supabase

click node_landing "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/app/page.tsx"
click node_test "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/onboarding/Flow.tsx"
click node_scoring "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/identity/scoring.ts"
click node_reveal "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/onboarding/RevealView.tsx"
click node_profile "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/onboarding/CurrentShoe.tsx"
click node_onboarding_repo "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/onboarding/repository.ts"
click node_running_home "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/running/RunningMainView.tsx"
click node_run_form "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/running/RunForm.tsx"
click node_run_list "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/running/RunViews.tsx"
click node_stats "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/running/StatsViews.tsx"
click node_runs_hook "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/running/useRuns.ts"
click node_runs_repo "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/running/repository.ts"
click node_items_ui "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/items/ItemsMain.tsx"
click node_items_repo "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/items/repository.ts"
click node_aggregation "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/items/aggregate.ts"
click node_events "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/events/track.ts"
click node_config "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/config.ts"
click node_supabase_client "https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/supabase/client.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_landing,node_test,node_scoring,node_reveal,node_profile toneBlue
class node_running_home,node_run_form,node_run_list,node_stats,node_runs_hook,node_supabase toneAmber
class node_items_ui,node_items_repo,node_aggregation toneMint
class node_onboarding_repo,node_runs_repo,node_events,node_config,node_supabase_client toneRose
class node_runner toneIndigo
```

## Components

### 정체성 온보딩

- [랜딩·테스트](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [테스트·진행 UI](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/onboarding/Flow.tsx): `src/components/onboarding/Flow.tsx`
- [정체성 판정](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/identity/scoring.ts): `src/lib/identity/scoring.ts`
- [정체성 공개](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/onboarding/RevealView.tsx): `src/components/onboarding/RevealView.tsx`
- [프로필·신발 설정](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/onboarding/CurrentShoe.tsx): `src/components/onboarding/CurrentShoe.tsx`

### 러닝 기록 분석

- [RUNNING 홈](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/running/RunningMainView.tsx): `src/components/running/RunningMainView.tsx`
- [기록 입력](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/running/RunForm.tsx): `src/components/running/RunForm.tsx`
- [기록 목록·상세](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/running/RunViews.tsx): `src/components/running/RunViews.tsx`
- [통계 화면](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/running/StatsViews.tsx): `src/components/running/StatsViews.tsx`
- [기록 조회 훅](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/running/useRuns.ts): `src/lib/running/useRuns.ts`

### 러닝화 탐색

- [비슷한 러너·저장 신발](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/components/items/ItemsMain.tsx): `src/components/items/ItemsMain.tsx`
- [제품 데이터 저장소](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/items/repository.ts): `src/lib/items/repository.ts`
- [러너 제품 집계](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/items/aggregate.ts): `src/lib/items/aggregate.ts`

### 공통 데이터 기반

- [온보딩 저장소](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/onboarding/repository.ts): `src/lib/onboarding/repository.ts`
- [기록 저장소](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/running/repository.ts): `src/lib/running/repository.ts`
- [행동 이벤트](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/events/track.ts): `src/lib/events/track.ts`
- [저장 모드 설정](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/config.ts): `src/lib/config.ts`
- [Supabase 클라이언트](https://github.com/chorockai-lab/gearmatch-ai-mvp/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`

### Other components

- **러너**
- **Supabase**

## Connections

- 러너 → 랜딩·테스트: 시작
- 랜딩·테스트 → 테스트·진행 UI: 진행 UI 사용 (evidence: `src/app/page.tsx`)
- 테스트·진행 UI → 정체성 판정: 답변 판정
- 정체성 판정 → 정체성 공개: 결과 제공
- 정체성 공개 → 프로필·신발 설정: 온보딩 진행
- 프로필·신발 설정 → 온보딩 저장소: 프로필 저장 (evidence: `src/components/onboarding/CurrentShoe.tsx`)
- 온보딩 저장소 → Supabase: 서버 저장
- 온보딩 저장소 → 러너: 로컬 임시 저장
- 프로필·신발 설정 → RUNNING 홈: 완료 후 이동
- RUNNING 홈 → 기록 입력: 기록 시작
- 기록 입력 → 기록 저장소: 기록 생성 (evidence: `src/components/running/RunForm.tsx`)
- 기록 목록·상세 → 기록 조회 훅: 기록 조회 (evidence: `src/app/runs/page.tsx`)
- 통계 화면 → 기록 조회 훅: 기록 조회 (evidence: `src/app/stats/page.tsx`)
- 기록 조회 훅 → 기록 저장소: 목록·상세 조회 (evidence: `src/lib/running/useRuns.ts`)
- 기록 저장소 → Supabase: 서버 읽기·쓰기 (evidence: `src/lib/running/repository.ts`)
- 비슷한 러너·저장 신발 → 제품 데이터 저장소: 제품·저장 조회 (evidence: `src/components/items/ItemsMain.tsx`)
- 제품 데이터 저장소 → 러너 제품 집계: 로컬 집계 호출 (evidence: `src/lib/items/repository.ts`)
- 제품 데이터 저장소 → Supabase: 서버 조회·저장 (evidence: `src/lib/items/repository.ts`)
- 비슷한 러너·저장 신발 → 행동 이벤트: 행동 기록 (evidence: `src/components/items/ItemsMain.tsx`)
- 행동 이벤트 → 저장 모드 설정: 모드 확인 (evidence: `src/lib/events/track.ts`)
- 행동 이벤트 → Supabase 클라이언트: 이벤트 전송 (evidence: `src/lib/events/track.ts`)
- 저장 모드 설정 → Supabase 클라이언트: 클라이언트 참조 (evidence: `src/lib/config.ts`)
- Supabase 클라이언트 → Supabase: 인증·데이터 연결 (evidence: `src/lib/supabase/client.ts`)
