# ssabii/baegop-web architecture

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

- Interactive diagram: https://gitdiagram.com/ssabii/baegop-web
- Repository: https://github.com/ssabii/baegop-web

## Overview

Baegop is a restaurant-discovery and recommendation service centered on finding nearby or interesting places, viewing place details, and contributing reviews. Users can also manage favorites, profile data, feedback, and rankings. The README documents Supabase-backed auth and data, Naver search/map integrations, and protected account routes; sampled source confirms selected API-to-query and review-action relationships. Several unsampled route families are retained as documented product capabilities, but their internal calls are not inferred.

Main entry points: [`src/app/(main)/mypage/page.tsx`](https://github.com/ssabii/baegop-web/blob/main/src/app/(main)/mypage/page.tsx) (Account dashboard), [`src/components/place-detail/review-card.tsx`](https://github.com/ssabii/baegop-web/blob/main/src/components/place-detail/review-card.tsx) (Review card), [`src/components/place-search/place-search.tsx`](https://github.com/ssabii/baegop-web/blob/main/src/components/place-search/place-search.tsx) (Place search), [`src/app/api/places/route.ts`](https://github.com/ssabii/baegop-web/blob/main/src/app/api/places/route.ts) (Place listings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Place discovery"]
  node_home["Home recommendations<br/>[page.tsx]"]
  node_search["Place search<br/>[place-search.tsx]"]
  node_placeslist["Place listings<br/>[route.ts]"]
  node_map["Map exploration<br/>[map-view.tsx]"]
  node_random["Random picker<br/>[page.tsx]"]
end

subgraph group_place["Place details"]
  node_placepage["Place detail<br/>[page.tsx]"]
  node_placeactions["Place actions<br/>[actions.ts]"]
  node_reviews["Review experience<br/>[review-section.tsx]"]
  node_reviewcard["Review card<br/>[review-card.tsx]"]
  node_reviewimages["Review images<br/>[review-images.tsx]"]
end

subgraph group_account["Account and community"]
  node_mypage["Account dashboard<br/>[page.tsx]"]
  node_feedback["Feedback management<br/>[actions.ts]"]
  node_myplaces["Saved places<br/>[page.tsx]"]
  node_myreviews["My reviews<br/>[page.tsx]"]
  node_ranking["Community ranking<br/>[page.tsx]"]
end

subgraph group_platform["Services and data"]
  node_searchapi["Naver search proxy<br/>[route.ts]"]
  node_auth["Auth callback<br/>[route.ts]"]
  node_middleware["Session middleware<br/>[middleware.ts]"]
  node_queryplaces["Place queries<br/>[places.ts]"]
  node_supabase[("Supabase")]
end

node_visitor(("Visitor"))
node_naver["Naver APIs"]

node_visitor -->|"explores"| node_home
node_visitor -->|"searches"| node_search
node_visitor -->|"explores map"| node_map
node_visitor -.->|"requests pick"| node_random
node_visitor -.->|"opens place"| node_placepage
node_visitor -->|"manages account"| node_mypage
node_search -.->|"requests results"| node_searchapi
node_searchapi -->|"proxies search"| node_naver
node_visitor -.->|"browses places"| node_placeslist
node_placeslist -->|"fetches places"| node_queryplaces
node_queryplaces -->|"reads place data"| node_supabase
node_placepage -.->|"shows reviews"| node_reviews
node_reviews -->|"renders reviews"| node_reviewcard
node_reviewcard -->|"deletes review"| node_placeactions
node_reviewcard -->|"renders images"| node_reviewimages
node_placeactions -->|"updates records"| node_supabase
node_mypage -.->|"opens saved places"| node_myplaces
node_mypage -.->|"opens reviews"| node_myreviews
node_mypage -.->|"manages feedback"| node_feedback
node_mypage -.->|"views ranking"| node_ranking
node_visitor -->|"completes sign-in"| node_auth
node_auth -->|"exchanges session"| node_supabase
node_middleware -->|"refreshes session"| node_supabase

click node_home "https://github.com/ssabii/baegop-web/blob/main/src/app/(main)/(with-search-bar)/page.tsx"
click node_search "https://github.com/ssabii/baegop-web/blob/main/src/components/place-search/place-search.tsx"
click node_searchapi "https://github.com/ssabii/baegop-web/blob/main/src/app/api/naver-search/route.ts"
click node_placeslist "https://github.com/ssabii/baegop-web/blob/main/src/app/api/places/route.ts"
click node_map "https://github.com/ssabii/baegop-web/blob/main/src/app/(main)/map/map-view.tsx"
click node_random "https://github.com/ssabii/baegop-web/blob/main/src/app/(main)/(with-search-bar)/random/page.tsx"
click node_placepage "https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/places/%5Bid%5D/page.tsx"
click node_placeactions "https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/places/%5Bid%5D/actions.ts"
click node_reviews "https://github.com/ssabii/baegop-web/blob/main/src/components/place-detail/review-section.tsx"
click node_reviewcard "https://github.com/ssabii/baegop-web/blob/main/src/components/place-detail/review-card.tsx"
click node_reviewimages "https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/places/%5Bid%5D/review-images.tsx"
click node_mypage "https://github.com/ssabii/baegop-web/blob/main/src/app/(main)/mypage/page.tsx"
click node_feedback "https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/mypage/feedback/actions.ts"
click node_myplaces "https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/mypage/places/page.tsx"
click node_myreviews "https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/mypage/reviews/page.tsx"
click node_ranking "https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/mypage/ranking/page.tsx"
click node_auth "https://github.com/ssabii/baegop-web/blob/main/src/app/auth/callback/route.ts"
click node_middleware "https://github.com/ssabii/baegop-web/blob/main/src/lib/supabase/middleware.ts"
click node_queryplaces "https://github.com/ssabii/baegop-web/blob/main/src/lib/queries/places.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_home,node_search,node_placeslist,node_map,node_random toneBlue
class node_placepage,node_placeactions,node_reviews,node_reviewcard,node_reviewimages toneAmber
class node_mypage,node_feedback,node_myplaces,node_myreviews,node_ranking,node_naver toneMint
class node_searchapi,node_auth,node_middleware,node_queryplaces,node_supabase toneRose
class node_visitor toneIndigo
```

## Components

### Place discovery

- [Home recommendations](https://github.com/ssabii/baegop-web/blob/main/src/app/(main)/(with-search-bar)/page.tsx): `src/app/(main)/(with-search-bar)/page.tsx`
- [Place search](https://github.com/ssabii/baegop-web/blob/main/src/components/place-search/place-search.tsx): `src/components/place-search/place-search.tsx`
- [Place listings](https://github.com/ssabii/baegop-web/blob/main/src/app/api/places/route.ts): `src/app/api/places/route.ts`
- [Map exploration](https://github.com/ssabii/baegop-web/blob/main/src/app/(main)/map/map-view.tsx): `src/app/(main)/map/map-view.tsx`
- [Random picker](https://github.com/ssabii/baegop-web/blob/main/src/app/(main)/(with-search-bar)/random/page.tsx): `src/app/(main)/(with-search-bar)/random/page.tsx`

### Place details

- [Place detail](https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/places/%5Bid%5D/page.tsx): `src/app/(sub)/places/[id]/page.tsx`
- [Place actions](https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/places/%5Bid%5D/actions.ts): `src/app/(sub)/places/[id]/actions.ts`
- [Review experience](https://github.com/ssabii/baegop-web/blob/main/src/components/place-detail/review-section.tsx): `src/components/place-detail/review-section.tsx`
- [Review card](https://github.com/ssabii/baegop-web/blob/main/src/components/place-detail/review-card.tsx): `src/components/place-detail/review-card.tsx`
- [Review images](https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/places/%5Bid%5D/review-images.tsx): `src/app/(sub)/places/[id]/review-images.tsx`

### Account and community

- [Account dashboard](https://github.com/ssabii/baegop-web/blob/main/src/app/(main)/mypage/page.tsx): `src/app/(main)/mypage/page.tsx`
- [Feedback management](https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/mypage/feedback/actions.ts): `src/app/(sub)/mypage/feedback/actions.ts`
- [Saved places](https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/mypage/places/page.tsx): `src/app/(sub)/mypage/places/page.tsx`
- [My reviews](https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/mypage/reviews/page.tsx): `src/app/(sub)/mypage/reviews/page.tsx`
- [Community ranking](https://github.com/ssabii/baegop-web/blob/main/src/app/(sub)/mypage/ranking/page.tsx): `src/app/(sub)/mypage/ranking/page.tsx`

### Services and data

- [Naver search proxy](https://github.com/ssabii/baegop-web/blob/main/src/app/api/naver-search/route.ts): `src/app/api/naver-search/route.ts`
- [Auth callback](https://github.com/ssabii/baegop-web/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`
- [Session middleware](https://github.com/ssabii/baegop-web/blob/main/src/lib/supabase/middleware.ts): `src/lib/supabase/middleware.ts`
- [Place queries](https://github.com/ssabii/baegop-web/blob/main/src/lib/queries/places.ts): `src/lib/queries/places.ts`
- **Supabase**

### Other components

- **Visitor**
- **Naver APIs**

## Connections

- Visitor → Home recommendations: explores
- Visitor → Place search: searches
- Visitor → Map exploration: explores map
- Visitor → Random picker: requests pick
- Visitor → Place detail: opens place
- Visitor → Account dashboard: manages account
- Place search → Naver search proxy: requests results
- Naver search proxy → Naver APIs: proxies search (evidence: `src/app/api/naver-search/route.ts`)
- Visitor → Place listings: browses places
- Place listings → Place queries: fetches places (evidence: `src/app/api/places/route.ts`)
- Place queries → Supabase: reads place data (evidence: `src/lib/queries/places.ts`)
- Place detail → Review experience: shows reviews
- Review experience → Review card: renders reviews (evidence: `src/components/place-detail/review-section.tsx`)
- Review card → Place actions: deletes review (evidence: `src/components/place-detail/review-card.tsx`)
- Review card → Review images: renders images (evidence: `src/components/place-detail/review-card.tsx`)
- Place actions → Supabase: updates records (evidence: `src/app/(sub)/places/[id]/actions.ts`)
- Account dashboard → Saved places: opens saved places
- Account dashboard → My reviews: opens reviews
- Account dashboard → Feedback management: manages feedback
- Account dashboard → Community ranking: views ranking
- Visitor → Auth callback: completes sign-in (evidence: `src/app/auth/callback/route.ts`)
- Auth callback → Supabase: exchanges session (evidence: `src/app/auth/callback/route.ts`)
- Session middleware → Supabase: refreshes session
