# made-in-sanhak/coffee-station architecture

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

- Interactive diagram: https://gitdiagram.com/made-in-sanhak/coffee-station
- Repository: https://github.com/made-in-sanhak/coffee-station

## Overview

Coffee Station is a mobile coffee-discovery and price-comparison platform, with a Node/Express API and a separate FastAPI AI service. The visible app includes Kakao login, nearby-store exploration, recommendations, and review summaries; documented receipt/OCR, purchase, coupon, and community features are not present in this tree. The principal flow is app screens through API calls to backend routes and recommendation logic. The AI service also has agent-based recommendation and a mock review-summary path. Dashed edges mark documented or plausible links not established by the sampled implementation evidence.

Main entry points: [`frontend/src/api/client.ts`](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/client.ts) (API client), [`frontend/src/navigation/RootNavigator.tsx`](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/navigation/RootNavigator.tsx) (Navigation), [`frontend/src/api/endpoints/auth.ts`](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/endpoints/auth.ts) (Kakao auth API), [`frontend/src/screens/map/MapScreen.tsx`](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/screens/map/MapScreen.tsx) (Nearby map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_app["App shell<br/>[App.tsx]"]
  node_navigation["Navigation<br/>[RootNavigator.tsx]"]
  node_auth_screen["Login screens"]
  node_auth_api["Kakao auth API<br/>[auth.ts]"]
  node_auth_state["Auth state<br/>[authStore.ts]"]
  node_map_screen["Nearby map<br/>[MapScreen.tsx]"]
  node_map_view["Kakao map view<br/>[KakaoMapView.tsx]"]
  node_store_api["Store API<br/>[store.ts]"]
  node_recommend_screen["Recommendations"]
  node_review_screen["Review summary screen"]
  node_review_client["Review summary client<br/>[reviewSummary.ts]"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_backend["Core API"]
  node_express_app["Express routing<br/>[app.ts]"]
  node_recommend_route["Recommendation route<br/>[recommendations.ts]"]
  node_recommend_service["Recommendation service<br/>[recommendations.ts]"]
  node_review_route["Review summary route<br/>[reviewSummaries.ts]"]
  node_artifact["Review artifact validation<br/>[reviewArtifact.ts]"]
end

subgraph group_ai["AI services"]
  node_ai_api["FastAPI routers<br/>[main.py]"]
  node_ai_recommend["AI recommendation route<br/>[recommendations.py]"]
  node_agent_loop["Recommendation agent<br/>[loop.py]"]
  node_ai_review["Review summary route"]
  node_review_service["Summary service<br/>[review_summary.py]"]
end

subgraph group_data["Data and persistence"]
  node_menu_repo["MySQL menu search<br/>[mysqlRepository.ts]"]
  node_mysql[("MySQL<br/>[db.ts]")]
  node_review_repo["Review repository<br/>[reviews.py]"]
  node_summary_cache[("SQLite summary cache<br/>[review_summary.py]")]
end

node_user(("Coffee explorer"))
node_llm{{"External AI API"}}
node_kakao{{"Kakao services"}}

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_navigation -->|"routes to"| node_auth_screen
node_navigation -->|"routes to"| node_map_screen
node_auth_screen -.->|"requests login"| node_auth_api
node_auth_api -->|"calls"| node_api_client
node_auth_api -->|"updates"| node_auth_state
node_auth_state -->|"provides token"| node_api_client
node_map_screen -.->|"renders"| node_map_view
node_map_screen -.->|"loads stores"| node_store_api
node_store_api -->|"calls"| node_api_client
node_map_view -.->|"displays map"| node_kakao
node_user -.->|"requests options"| node_recommend_screen
node_recommend_screen -.->|"requests data"| node_api_client
node_user -.->|"views summary"| node_review_screen
node_review_screen -->|"loads summary"| node_review_client
node_review_client -->|"calls"| node_api_client
node_api_client -->|"sends API requests"| node_express_app
node_express_app -->|"routes requests"| node_recommend_route
node_express_app -->|"routes requests"| node_review_route
node_recommend_route -->|"calls"| node_recommend_service
node_recommend_service -.->|"searches prices"| node_menu_repo
node_menu_repo -.->|"reads prices"| node_mysql
node_review_route -->|"validates artifact"| node_artifact
node_ai_api -->|"registers router"| node_ai_recommend
node_ai_api -->|"registers router"| node_ai_review
node_ai_recommend -->|"dispatches"| node_agent_loop
node_ai_recommend -.->|"uses model"| node_llm
node_ai_review -->|"refreshes summary"| node_review_service
node_ai_review -->|"loads reviews"| node_review_repo
node_review_service -->|"reads and writes"| node_summary_cache

click node_app "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/App.tsx"
click node_navigation "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/navigation/RootNavigator.tsx"
click node_auth_screen "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/screens/auth/KakaoLoginScreen.tsx"
click node_auth_api "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/endpoints/auth.ts"
click node_auth_state "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/store/authStore.ts"
click node_map_screen "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/screens/map/MapScreen.tsx"
click node_map_view "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/components/map/KakaoMapView.tsx"
click node_store_api "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/endpoints/store.ts"
click node_recommend_screen "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/RecommendationScreen.tsx"
click node_review_screen "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/ReviewSummaryScreen.tsx"
click node_review_client "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/reviewSummary.ts"
click node_api_client "https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/client.ts"
click node_express_app "https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/app.ts"
click node_recommend_route "https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/routes/recommendations.ts"
click node_recommend_service "https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/services/recommendations.ts"
click node_review_route "https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/routes/reviewSummaries.ts"
click node_artifact "https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/recommendations/reviewArtifact.ts"
click node_menu_repo "https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/recommendations/mysqlRepository.ts"
click node_mysql "https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/config/db.ts"
click node_ai_api "https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/main.py"
click node_ai_recommend "https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/routers/recommendations.py"
click node_agent_loop "https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/agent/loop.py"
click node_ai_review "https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/routers/review_summaries.py"
click node_review_service "https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/review_summary.py"
click node_review_repo "https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/repositories/reviews.py"
click node_summary_cache "https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/review_summary.py"

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_navigation,node_auth_screen,node_auth_api,node_auth_state,node_map_screen,node_map_view,node_store_api,node_recommend_screen,node_review_screen,node_review_client,node_api_client toneBlue
class node_express_app,node_recommend_route,node_recommend_service,node_review_route,node_artifact toneAmber
class node_ai_api,node_ai_recommend,node_agent_loop,node_ai_review,node_review_service,node_llm toneMint
class node_menu_repo,node_mysql,node_review_repo,node_summary_cache toneRose
class node_user,node_kakao toneIndigo
```

## Components

### Mobile app

- [App shell](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/App.tsx): `frontend/App.tsx`
- [Navigation](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/navigation/RootNavigator.tsx): `frontend/src/navigation/RootNavigator.tsx`
- [Login screens](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/screens/auth/KakaoLoginScreen.tsx): `frontend/src/screens/auth/KakaoLoginScreen.tsx`
- [Kakao auth API](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/endpoints/auth.ts): `frontend/src/api/endpoints/auth.ts`
- [Auth state](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/store/authStore.ts): `frontend/src/store/authStore.ts`
- [Nearby map](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/screens/map/MapScreen.tsx): `frontend/src/screens/map/MapScreen.tsx`
- [Kakao map view](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/components/map/KakaoMapView.tsx): `frontend/src/components/map/KakaoMapView.tsx`
- [Store API](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/endpoints/store.ts): `frontend/src/api/endpoints/store.ts`
- [Recommendations](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/RecommendationScreen.tsx): `frontend/src/RecommendationScreen.tsx`
- [Review summary screen](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/ReviewSummaryScreen.tsx): `frontend/src/ReviewSummaryScreen.tsx`
- [Review summary client](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/reviewSummary.ts): `frontend/src/api/reviewSummary.ts`
- [API client](https://github.com/made-in-sanhak/coffee-station/blob/develop/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Core API

- [Express routing](https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/app.ts): `backend/src/app.ts`
- [Recommendation route](https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/routes/recommendations.ts): `backend/src/routes/recommendations.ts`
- [Recommendation service](https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/services/recommendations.ts): `backend/src/services/recommendations.ts`
- [Review summary route](https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/routes/reviewSummaries.ts): `backend/src/routes/reviewSummaries.ts`
- [Review artifact validation](https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/recommendations/reviewArtifact.ts): `backend/src/recommendations/reviewArtifact.ts`

### AI services

- [FastAPI routers](https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/main.py): `ai-server/app/main.py`
- [AI recommendation route](https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/routers/recommendations.py): `ai-server/app/routers/recommendations.py`
- [Recommendation agent](https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/agent/loop.py): `ai-server/app/agent/loop.py`
- [Review summary route](https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/routers/review_summaries.py): `ai-server/app/routers/review_summaries.py`
- [Summary service](https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/review_summary.py): `ai-server/app/review_summary.py`

### Data and persistence

- [MySQL menu search](https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/recommendations/mysqlRepository.ts): `backend/src/recommendations/mysqlRepository.ts`
- [MySQL](https://github.com/made-in-sanhak/coffee-station/blob/develop/backend/src/config/db.ts): `backend/src/config/db.ts`
- [Review repository](https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/repositories/reviews.py): `ai-server/app/repositories/reviews.py`
- [SQLite summary cache](https://github.com/made-in-sanhak/coffee-station/blob/develop/ai-server/app/review_summary.py): `ai-server/app/review_summary.py`

### Other components

- **Coffee explorer**
- **External AI API**
- **Kakao services**

## Connections

- Coffee explorer → App shell: uses
- App shell → Navigation: renders (evidence: `frontend/App.tsx`)
- Navigation → Login screens: routes to (evidence: `frontend/src/navigation/RootNavigator.tsx`)
- Navigation → Nearby map: routes to (evidence: `frontend/src/navigation/RootNavigator.tsx`)
- Login screens → Kakao auth API: requests login
- Kakao auth API → API client: calls (evidence: `frontend/src/api/endpoints/auth.ts`)
- Kakao auth API → Auth state: updates (evidence: `frontend/src/api/queries/useKakaoLogin.ts`)
- Auth state → API client: provides token (evidence: `frontend/src/store/authStore.ts`)
- Nearby map → Kakao map view: renders
- Nearby map → Store API: loads stores
- Store API → API client: calls (evidence: `frontend/src/api/endpoints/store.ts`)
- Kakao map view → Kakao services: displays map
- Coffee explorer → Recommendations: requests options
- Recommendations → API client: requests data
- Coffee explorer → Review summary screen: views summary
- Review summary screen → Review summary client: loads summary (evidence: `frontend/src/ReviewSummaryScreen.tsx`)
- Review summary client → API client: calls (evidence: `frontend/src/api/reviewSummary.ts`)
- API client → Express routing: sends API requests
- Express routing → Recommendation route: routes requests (evidence: `backend/src/app.ts`)
- Express routing → Review summary route: routes requests (evidence: `backend/src/app.ts`)
- Recommendation route → Recommendation service: calls (evidence: `backend/src/routes/recommendations.ts`)
- Recommendation service → MySQL menu search: searches prices
- MySQL menu search → MySQL: reads prices
- Review summary route → Review artifact validation: validates artifact (evidence: `backend/src/routes/reviewSummaries.ts`)
- FastAPI routers → AI recommendation route: registers router (evidence: `ai-server/app/main.py`)
- FastAPI routers → Review summary route: registers router (evidence: `ai-server/app/main.py`)
- AI recommendation route → Recommendation agent: dispatches (evidence: `ai-server/app/routers/recommendations.py`)
- AI recommendation route → External AI API: uses model
- Review summary route → Summary service: refreshes summary (evidence: `ai-server/app/routers/review_summaries.py`)
- Review summary route → Review repository: loads reviews (evidence: `ai-server/app/routers/review_summaries.py`)
- Summary service → SQLite summary cache: reads and writes (evidence: `ai-server/app/review_summary.py`)
