# ayeon-3029/samgakpd architecture

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

- Interactive diagram: https://gitdiagram.com/ayeon-3029/samgakpd
- Repository: https://github.com/ayeon-3029/samgakpd

## Overview

삼각편대 is a Korean convenience-store rice-ball review, ranking, and recommendation web service. Visitors browse and filter products, inspect ratings and tags, and can submit reviews; review changes trigger product score, tier, and tag recalculation. Separate workflows support account sessions and community posts, comments, and likes. The map includes the documented allergen and image-upload capabilities, though some implementing routes and page details were not sampled; those connections are shown only where the README or source index supports them.

Main entry points: [`app/lib/supabase.ts`](https://github.com/ayeon-3029/samgakpd/blob/main/app/lib/supabase.ts) (Client data and uploads), [`backend/prisma.ts`](https://github.com/ayeon-3029/samgakpd/blob/main/backend/prisma.ts) (Prisma client), [`backend/product.service.ts`](https://github.com/ayeon-3029/samgakpd/blob/main/backend/product.service.ts) (Product catalog), [`app/api/community/route.ts`](https://github.com/ayeon-3029/samgakpd/blob/main/app/api/community/route.ts) (Community endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_home["Product ranking<br/>[page.tsx]"]
  node_search["Product search<br/>[page.tsx]"]
  node_product_page["Product details<br/>[page.tsx]"]
  node_review_page["Review form<br/>[page.tsx]"]
  node_allergen["Allergen filter<br/>[AllergenFilter.tsx]"]
  node_community_page["Community pages<br/>[page.tsx]"]
  node_community_detail["Community post<br/>[page.tsx]"]
  node_client_data["Client data and uploads<br/>[supabase.ts]"]
end

subgraph group_catalog["Products and reviews"]
  node_product_api["Product endpoints<br/>[route.ts]"]
  node_product_service["Product catalog<br/>[product.service.ts]"]
  node_review_api["Review endpoint<br/>[route.ts]"]
  node_review_service["Review operations<br/>[review.service.ts]"]
  node_scoring["Tier and tag scoring<br/>[scoring.ts]"]
end

subgraph group_identity["Accounts and community"]
  node_auth_api["Auth endpoints<br/>[route.ts]"]
  node_auth["Session and users<br/>[auth.ts]"]
  node_community_api["Community endpoints<br/>[route.ts]"]
  node_community_service["Community operations"]
end

subgraph group_infra["Data and storage"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_postgres[("PostgreSQL")]
  node_storage[("Supabase Storage")]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_home
node_visitor -->|"searches"| node_search
node_visitor -->|"visits"| node_community_page
node_home -->|"loads products"| node_client_data
node_home -->|"renders filter"| node_allergen
node_search -->|"loads products"| node_client_data
node_product_page -->|"loads product and reviews"| node_client_data
node_review_page -->|"submits review"| node_client_data
node_client_data -->|"fetches products"| node_product_api
node_client_data -->|"posts review"| node_review_api
node_client_data -->|"uploads images"| node_storage
node_community_page -.->|"loads and creates posts"| node_community_api
node_community_detail -.->|"uses post actions"| node_community_api
node_product_api -->|"calls"| node_product_service
node_review_api -->|"calls"| node_review_service
node_review_api -->|"checks user"| node_auth
node_community_api -->|"calls"| node_community_service
node_community_api -->|"checks user"| node_auth
node_auth_api -->|"uses session services"| node_auth
node_review_service -->|"recalculates product"| node_product_service
node_product_service -->|"calculates tiers and tags"| node_scoring
node_auth -->|"reads and writes users"| node_prisma
node_community_service -->|"reads and writes posts"| node_prisma
node_product_service -->|"reads and writes products"| node_prisma
node_review_service -->|"reads and writes reviews"| node_prisma
node_prisma -->|"persists application data"| node_postgres

click node_home "https://github.com/ayeon-3029/samgakpd/blob/main/app/page.tsx"
click node_search "https://github.com/ayeon-3029/samgakpd/blob/main/app/search/page.tsx"
click node_product_page "https://github.com/ayeon-3029/samgakpd/blob/main/app/products/%5Bid%5D/page.tsx"
click node_review_page "https://github.com/ayeon-3029/samgakpd/blob/main/app/products/%5Bid%5D/review/page.tsx"
click node_allergen "https://github.com/ayeon-3029/samgakpd/blob/main/app/components/AllergenFilter.tsx"
click node_community_page "https://github.com/ayeon-3029/samgakpd/blob/main/app/community/page.tsx"
click node_community_detail "https://github.com/ayeon-3029/samgakpd/blob/main/app/community/%5Bid%5D/page.tsx"
click node_client_data "https://github.com/ayeon-3029/samgakpd/blob/main/app/lib/supabase.ts"
click node_auth_api "https://github.com/ayeon-3029/samgakpd/blob/main/app/api/auth/login/route.ts"
click node_auth "https://github.com/ayeon-3029/samgakpd/blob/main/backend/auth.ts"
click node_community_api "https://github.com/ayeon-3029/samgakpd/blob/main/app/api/community/route.ts"
click node_community_service "https://github.com/ayeon-3029/samgakpd/blob/main/backend/community.service.ts"
click node_product_api "https://github.com/ayeon-3029/samgakpd/blob/main/app/api/products/route.ts"
click node_product_service "https://github.com/ayeon-3029/samgakpd/blob/main/backend/product.service.ts"
click node_review_api "https://github.com/ayeon-3029/samgakpd/blob/main/app/api/products/%5BproductId%5D/reviews/route.ts"
click node_review_service "https://github.com/ayeon-3029/samgakpd/blob/main/backend/review.service.ts"
click node_scoring "https://github.com/ayeon-3029/samgakpd/blob/main/backend/scoring.ts"
click node_prisma "https://github.com/ayeon-3029/samgakpd/blob/main/backend/prisma.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_product_page,node_review_page,node_allergen,node_community_page,node_community_detail,node_client_data toneBlue
class node_product_api,node_product_service,node_review_api,node_review_service,node_scoring toneAmber
class node_auth_api,node_auth,node_community_api,node_community_service toneMint
class node_prisma,node_postgres,node_storage toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Product ranking](https://github.com/ayeon-3029/samgakpd/blob/main/app/page.tsx): `app/page.tsx`
- [Product search](https://github.com/ayeon-3029/samgakpd/blob/main/app/search/page.tsx): `app/search/page.tsx`
- [Product details](https://github.com/ayeon-3029/samgakpd/blob/main/app/products/%5Bid%5D/page.tsx): `app/products/[id]/page.tsx`
- [Review form](https://github.com/ayeon-3029/samgakpd/blob/main/app/products/%5Bid%5D/review/page.tsx): `app/products/[id]/review/page.tsx`
- [Allergen filter](https://github.com/ayeon-3029/samgakpd/blob/main/app/components/AllergenFilter.tsx): `app/components/AllergenFilter.tsx`
- [Community pages](https://github.com/ayeon-3029/samgakpd/blob/main/app/community/page.tsx): `app/community/page.tsx`
- [Community post](https://github.com/ayeon-3029/samgakpd/blob/main/app/community/%5Bid%5D/page.tsx): `app/community/[id]/page.tsx`
- [Client data and uploads](https://github.com/ayeon-3029/samgakpd/blob/main/app/lib/supabase.ts): `app/lib/supabase.ts`

### Products and reviews

- [Product endpoints](https://github.com/ayeon-3029/samgakpd/blob/main/app/api/products/route.ts): `app/api/products/route.ts`
- [Product catalog](https://github.com/ayeon-3029/samgakpd/blob/main/backend/product.service.ts): `backend/product.service.ts`
- [Review endpoint](https://github.com/ayeon-3029/samgakpd/blob/main/app/api/products/%5BproductId%5D/reviews/route.ts): `app/api/products/[productId]/reviews/route.ts`
- [Review operations](https://github.com/ayeon-3029/samgakpd/blob/main/backend/review.service.ts): `backend/review.service.ts`
- [Tier and tag scoring](https://github.com/ayeon-3029/samgakpd/blob/main/backend/scoring.ts): `backend/scoring.ts`

### Accounts and community

- [Auth endpoints](https://github.com/ayeon-3029/samgakpd/blob/main/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [Session and users](https://github.com/ayeon-3029/samgakpd/blob/main/backend/auth.ts): `backend/auth.ts`
- [Community endpoints](https://github.com/ayeon-3029/samgakpd/blob/main/app/api/community/route.ts): `app/api/community/route.ts`
- [Community operations](https://github.com/ayeon-3029/samgakpd/blob/main/backend/community.service.ts): `backend/community.service.ts`

### Data and storage

- [Prisma client](https://github.com/ayeon-3029/samgakpd/blob/main/backend/prisma.ts): `backend/prisma.ts`
- **PostgreSQL**
- **Supabase Storage**

### Other components

- **Visitor**

## Connections

- Visitor → Product ranking: browses (evidence: `README.md`)
- Visitor → Product search: searches (evidence: `README.md`)
- Visitor → Community pages: visits (evidence: `README.md`)
- Product ranking → Client data and uploads: loads products (evidence: `app/page.tsx`)
- Product ranking → Allergen filter: renders filter (evidence: `app/page.tsx`)
- Product search → Client data and uploads: loads products (evidence: `app/search/page.tsx`)
- Product details → Client data and uploads: loads product and reviews (evidence: `app/products/[id]/page.tsx`)
- Review form → Client data and uploads: submits review (evidence: `README.md`)
- Client data and uploads → Product endpoints: fetches products (evidence: `app/lib/supabase.ts`)
- Client data and uploads → Review endpoint: posts review (evidence: `app/lib/supabase.ts`)
- Client data and uploads → Supabase Storage: uploads images (evidence: `app/lib/supabase.ts`)
- Community pages → Community endpoints: loads and creates posts
- Community post → Community endpoints: uses post actions
- Product endpoints → Product catalog: calls (evidence: `app/api/products/route.ts`)
- Review endpoint → Review operations: calls (evidence: `app/api/products/[productId]/reviews/route.ts`)
- Review endpoint → Session and users: checks user (evidence: `app/api/products/[productId]/reviews/route.ts`)
- Community endpoints → Community operations: calls (evidence: `app/api/community/route.ts`)
- Community endpoints → Session and users: checks user (evidence: `app/api/community/route.ts`)
- Auth endpoints → Session and users: uses session services (evidence: `app/api/auth/login/route.ts`)
- Review operations → Product catalog: recalculates product (evidence: `backend/review.service.ts`)
- Product catalog → Tier and tag scoring: calculates tiers and tags (evidence: `backend/product.service.ts`)
- Session and users → Prisma client: reads and writes users (evidence: `backend/auth.ts`)
- Community operations → Prisma client: reads and writes posts (evidence: `backend/community.service.ts`)
- Product catalog → Prisma client: reads and writes products (evidence: `backend/product.service.ts`)
- Review operations → Prisma client: reads and writes reviews (evidence: `backend/review.service.ts`)
- Prisma client → PostgreSQL: persists application data (evidence: `README.md`)
