# 79gun79/fcneunggok architecture

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

- Interactive diagram: https://gitdiagram.com/79gun79/fcneunggok
- Repository: https://github.com/79gun79/fcneunggok

## Overview

FC 능곡은 회원 커뮤니티 웹앱입니다. 방문자는 홈과 멤버 정보, 포인트, 채팅을 탐색하고, 로그인한 회원은 갤러리 사진 업로드·삭제·좋아요와 게시판·댓글 활동을 할 수 있습니다. App이 라우팅과 인증·쿼리 프로바이더를 설정하고 각 페이지가 섹션을 렌더링합니다. 인증, Supabase 데이터 접근, Firebase 푸시 알림이 주요 내부 기반입니다. README와 인덱스가 기능 범위를 뒷받침하지만, 일부 API·섹션 구현은 발췌되지 않아 관련 세부 연결은 생략했습니다.

Main entry points: [`src/lib/supabase.ts`](https://github.com/79gun79/fcneunggok/blob/main/src/lib/supabase.ts) (Supabase 클라이언트), [`src/App.tsx`](https://github.com/79gun79/fcneunggok/blob/main/src/App.tsx) (라우팅 앱), [`supabase/functions/_shared/cleanupFcmTokens.ts`](https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/_shared/cleanupFcmTokens.ts) (무효 토큰 정리), [`src/components/HomeHeader.tsx`](https://github.com/79gun79/fcneunggok/blob/main/src/components/HomeHeader.tsx) (내비게이션·알림 설정)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["앱과 탐색"]
  node_app["라우팅 앱<br/>[App.tsx]"]
  node_home["홈<br/>[Index.tsx]"]
  node_gallerypage["갤러리 페이지<br/>[Gallery.tsx]"]
  node_communitypage["게시판 페이지<br/>[Community.tsx]"]
  node_birthdaypage["생일 페이지<br/>[Birthday.tsx]"]
  node_pointpage["포인트 페이지<br/>[Point.tsx]"]
  node_chatpage["채팅 페이지<br/>[Chat.tsx]"]
  node_homecontent["홈 소개 섹션<br/>[HomeSection.tsx]"]
end

subgraph group_community["커뮤니티 기능"]
  node_gallery["사진 갤러리"]
  node_posts["게시글·댓글 기능"]
  node_birthday["생일 안내"]
  node_points["포인트·출석<br/>[PointSection.tsx]"]
  node_chat["채팅 화면<br/>[ChatSection.tsx]"]
end

subgraph group_identity["인증과 알림"]
  node_authbutton["로그인 조작부<br/>[AuthButton.tsx]"]
  node_auth["세션·OAuth 상태<br/>[AuthContext.tsx]"]
  node_header["내비게이션·알림 설정<br/>[HomeHeader.tsx]"]
  node_messaging["푸시 토큰 처리<br/>[messaging.ts]"]
  node_firebase["Firebase 메시징<br/>[firebase.ts]"]
end

subgraph group_backend["데이터와 서버"]
  node_galleryapi["사진·좋아요 API<br/>[photos.ts]"]
  node_postapi["게시글 API<br/>[posts.ts]"]
  node_commentsapi["댓글 API<br/>[comments.ts]"]
  node_attendanceapi["출석 API<br/>[attendance.ts]"]
  node_pointsapi["포인트 API<br/>[points.ts]"]
  node_chatapi["채팅 API<br/>[chat.ts]"]
  node_supabase["Supabase 클라이언트<br/>[supabase.ts]"]
  node_database[("Supabase 데이터·스토리지")]
  node_tokens["기기 토큰 저장<br/>[fcmTokens.ts]"]
  node_notify["푸시 알림 함수<br/>[index.ts]"]
  node_notifycomment["댓글 알림 함수<br/>[index.ts]"]
  node_notifylike["좋아요 알림 함수<br/>[index.ts]"]
  node_notifyscore["점수 변경 알림<br/>[index.ts]"]
  node_cleanup["무효 토큰 정리"]
  node_completion["채팅 완성 함수<br/>[index.ts]"]
end

node_member(("방문자·회원"))

node_member -->|"탐색"| node_app
node_app -->|"라우팅"| node_home
node_app -->|"라우팅"| node_gallerypage
node_app -->|"라우팅"| node_communitypage
node_app -->|"라우팅"| node_birthdaypage
node_app -->|"라우팅"| node_pointpage
node_app -->|"라우팅"| node_chatpage
node_home -->|"렌더링"| node_homecontent
node_gallerypage -->|"렌더링"| node_gallery
node_communitypage -->|"렌더링"| node_posts
node_birthdaypage -->|"렌더링"| node_birthday
node_pointpage -->|"렌더링"| node_points
node_chatpage -->|"렌더링"| node_chat
node_gallery -->|"호출"| node_galleryapi
node_galleryapi -->|"사용"| node_supabase
node_supabase -->|"접속"| node_database
node_posts -.->|"호출"| node_postapi
node_posts -.->|"호출"| node_commentsapi
node_postapi -->|"사용"| node_supabase
node_commentsapi -->|"사용"| node_supabase
node_points -.->|"호출"| node_attendanceapi
node_points -.->|"호출"| node_pointsapi
node_attendanceapi -.->|"사용"| node_supabase
node_pointsapi -.->|"사용"| node_supabase
node_chat -.->|"호출"| node_chatapi
node_chatapi -.->|"사용"| node_supabase
node_chat -.->|"요청"| node_completion
node_authbutton -->|"인증 조작"| node_auth
node_auth -->|"OAuth·세션"| node_supabase
node_header -->|"세션 사용"| node_auth
node_header -->|"토큰 요청"| node_messaging
node_header -->|"토큰 저장"| node_tokens
node_messaging -->|"초기화"| node_firebase
node_tokens -.->|"저장"| node_supabase
node_notify -->|"정리 위임"| node_cleanup
node_notifycomment -->|"정리 위임"| node_cleanup
node_notifylike -->|"정리 위임"| node_cleanup
node_notifyscore -->|"정리 위임"| node_cleanup

click node_app "https://github.com/79gun79/fcneunggok/blob/main/src/App.tsx"
click node_home "https://github.com/79gun79/fcneunggok/blob/main/src/pages/Index.tsx"
click node_gallerypage "https://github.com/79gun79/fcneunggok/blob/main/src/pages/Gallery.tsx"
click node_communitypage "https://github.com/79gun79/fcneunggok/blob/main/src/pages/Community.tsx"
click node_birthdaypage "https://github.com/79gun79/fcneunggok/blob/main/src/pages/Birthday.tsx"
click node_pointpage "https://github.com/79gun79/fcneunggok/blob/main/src/pages/Point.tsx"
click node_chatpage "https://github.com/79gun79/fcneunggok/blob/main/src/pages/Chat.tsx"
click node_homecontent "https://github.com/79gun79/fcneunggok/blob/main/src/components/HomeSection.tsx"
click node_gallery "https://github.com/79gun79/fcneunggok/blob/main/src/components/GallerySecction.tsx"
click node_galleryapi "https://github.com/79gun79/fcneunggok/blob/main/src/api/photos.ts"
click node_posts "https://github.com/79gun79/fcneunggok/blob/main/src/components/CommunitySection.tsx"
click node_postapi "https://github.com/79gun79/fcneunggok/blob/main/src/api/posts.ts"
click node_commentsapi "https://github.com/79gun79/fcneunggok/blob/main/src/api/comments.ts"
click node_birthday "https://github.com/79gun79/fcneunggok/blob/main/src/components/BirthdaySection.tsx"
click node_points "https://github.com/79gun79/fcneunggok/blob/main/src/components/PointSection.tsx"
click node_attendanceapi "https://github.com/79gun79/fcneunggok/blob/main/src/api/attendance.ts"
click node_pointsapi "https://github.com/79gun79/fcneunggok/blob/main/src/api/points.ts"
click node_chat "https://github.com/79gun79/fcneunggok/blob/main/src/components/ChatSection.tsx"
click node_chatapi "https://github.com/79gun79/fcneunggok/blob/main/src/api/chat.ts"
click node_authbutton "https://github.com/79gun79/fcneunggok/blob/main/src/components/AuthButton.tsx"
click node_auth "https://github.com/79gun79/fcneunggok/blob/main/src/contexts/AuthContext.tsx"
click node_supabase "https://github.com/79gun79/fcneunggok/blob/main/src/lib/supabase.ts"
click node_header "https://github.com/79gun79/fcneunggok/blob/main/src/components/HomeHeader.tsx"
click node_messaging "https://github.com/79gun79/fcneunggok/blob/main/src/lib/messaging.ts"
click node_firebase "https://github.com/79gun79/fcneunggok/blob/main/src/lib/firebase.ts"
click node_tokens "https://github.com/79gun79/fcneunggok/blob/main/src/api/fcmTokens.ts"
click node_notify "https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/notify-new-post/index.ts"
click node_notifycomment "https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/notify-new-comment/index.ts"
click node_notifylike "https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/notify-photo-like/index.ts"
click node_notifyscore "https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/notify-score-change/index.ts"
click node_cleanup "https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/_shared/cleanupFcmTokens.ts"
click node_completion "https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/chat-completion/index.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_home,node_gallerypage,node_communitypage,node_birthdaypage,node_pointpage,node_chatpage,node_homecontent toneBlue
class node_gallery,node_posts,node_birthday,node_points,node_chat toneAmber
class node_authbutton,node_auth,node_header,node_messaging,node_firebase toneMint
class node_galleryapi,node_postapi,node_commentsapi,node_attendanceapi,node_pointsapi,node_chatapi,node_supabase,node_database,node_tokens,node_notify,node_notifycomment,node_notifylike,node_notifyscore,node_cleanup,node_completion toneRose
class node_member toneIndigo
```

## Components

### 앱과 탐색

- [라우팅 앱](https://github.com/79gun79/fcneunggok/blob/main/src/App.tsx): `src/App.tsx`
- [홈](https://github.com/79gun79/fcneunggok/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [갤러리 페이지](https://github.com/79gun79/fcneunggok/blob/main/src/pages/Gallery.tsx): `src/pages/Gallery.tsx`
- [게시판 페이지](https://github.com/79gun79/fcneunggok/blob/main/src/pages/Community.tsx): `src/pages/Community.tsx`
- [생일 페이지](https://github.com/79gun79/fcneunggok/blob/main/src/pages/Birthday.tsx): `src/pages/Birthday.tsx`
- [포인트 페이지](https://github.com/79gun79/fcneunggok/blob/main/src/pages/Point.tsx): `src/pages/Point.tsx`
- [채팅 페이지](https://github.com/79gun79/fcneunggok/blob/main/src/pages/Chat.tsx): `src/pages/Chat.tsx`
- [홈 소개 섹션](https://github.com/79gun79/fcneunggok/blob/main/src/components/HomeSection.tsx): `src/components/HomeSection.tsx`

### 커뮤니티 기능

- [사진 갤러리](https://github.com/79gun79/fcneunggok/blob/main/src/components/GallerySecction.tsx): `src/components/GallerySecction.tsx`
- [게시글·댓글 기능](https://github.com/79gun79/fcneunggok/blob/main/src/components/CommunitySection.tsx): `src/components/CommunitySection.tsx`
- [생일 안내](https://github.com/79gun79/fcneunggok/blob/main/src/components/BirthdaySection.tsx): `src/components/BirthdaySection.tsx`
- [포인트·출석](https://github.com/79gun79/fcneunggok/blob/main/src/components/PointSection.tsx): `src/components/PointSection.tsx`
- [채팅 화면](https://github.com/79gun79/fcneunggok/blob/main/src/components/ChatSection.tsx): `src/components/ChatSection.tsx`

### 인증과 알림

- [로그인 조작부](https://github.com/79gun79/fcneunggok/blob/main/src/components/AuthButton.tsx): `src/components/AuthButton.tsx`
- [세션·OAuth 상태](https://github.com/79gun79/fcneunggok/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [내비게이션·알림 설정](https://github.com/79gun79/fcneunggok/blob/main/src/components/HomeHeader.tsx): `src/components/HomeHeader.tsx`
- [푸시 토큰 처리](https://github.com/79gun79/fcneunggok/blob/main/src/lib/messaging.ts): `src/lib/messaging.ts`
- [Firebase 메시징](https://github.com/79gun79/fcneunggok/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`

### 데이터와 서버

- [사진·좋아요 API](https://github.com/79gun79/fcneunggok/blob/main/src/api/photos.ts): `src/api/photos.ts`
- [게시글 API](https://github.com/79gun79/fcneunggok/blob/main/src/api/posts.ts): `src/api/posts.ts`
- [댓글 API](https://github.com/79gun79/fcneunggok/blob/main/src/api/comments.ts): `src/api/comments.ts`
- [출석 API](https://github.com/79gun79/fcneunggok/blob/main/src/api/attendance.ts): `src/api/attendance.ts`
- [포인트 API](https://github.com/79gun79/fcneunggok/blob/main/src/api/points.ts): `src/api/points.ts`
- [채팅 API](https://github.com/79gun79/fcneunggok/blob/main/src/api/chat.ts): `src/api/chat.ts`
- [Supabase 클라이언트](https://github.com/79gun79/fcneunggok/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase 데이터·스토리지**
- [기기 토큰 저장](https://github.com/79gun79/fcneunggok/blob/main/src/api/fcmTokens.ts): `src/api/fcmTokens.ts`
- [푸시 알림 함수](https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/notify-new-post/index.ts): `supabase/functions/notify-new-post/index.ts`
- [댓글 알림 함수](https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/notify-new-comment/index.ts): `supabase/functions/notify-new-comment/index.ts`
- [좋아요 알림 함수](https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/notify-photo-like/index.ts): `supabase/functions/notify-photo-like/index.ts`
- [점수 변경 알림](https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/notify-score-change/index.ts): `supabase/functions/notify-score-change/index.ts`
- [무효 토큰 정리](https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/_shared/cleanupFcmTokens.ts): `supabase/functions/_shared/cleanupFcmTokens.ts`
- [채팅 완성 함수](https://github.com/79gun79/fcneunggok/blob/main/supabase/functions/chat-completion/index.ts): `supabase/functions/chat-completion/index.ts`

### Other components

- **방문자·회원**

## Connections

- 방문자·회원 → 라우팅 앱: 탐색 (evidence: `src/App.tsx`)
- 라우팅 앱 → 홈: 라우팅 (evidence: `src/App.tsx`)
- 라우팅 앱 → 갤러리 페이지: 라우팅 (evidence: `src/App.tsx`)
- 라우팅 앱 → 게시판 페이지: 라우팅 (evidence: `src/App.tsx`)
- 라우팅 앱 → 생일 페이지: 라우팅 (evidence: `src/App.tsx`)
- 라우팅 앱 → 포인트 페이지: 라우팅 (evidence: `src/App.tsx`)
- 라우팅 앱 → 채팅 페이지: 라우팅 (evidence: `src/App.tsx`)
- 홈 → 홈 소개 섹션: 렌더링 (evidence: `src/pages/Index.tsx`)
- 갤러리 페이지 → 사진 갤러리: 렌더링 (evidence: `src/pages/Gallery.tsx`)
- 게시판 페이지 → 게시글·댓글 기능: 렌더링 (evidence: `src/pages/Community.tsx`)
- 생일 페이지 → 생일 안내: 렌더링 (evidence: `src/pages/Birthday.tsx`)
- 포인트 페이지 → 포인트·출석: 렌더링 (evidence: `src/pages/Point.tsx`)
- 채팅 페이지 → 채팅 화면: 렌더링
- 사진 갤러리 → 사진·좋아요 API: 호출 (evidence: `src/components/GallerySecction.tsx`)
- 사진·좋아요 API → Supabase 클라이언트: 사용 (evidence: `src/api/photos.ts`)
- Supabase 클라이언트 → Supabase 데이터·스토리지: 접속 (evidence: `src/lib/supabase.ts`)
- 게시글·댓글 기능 → 게시글 API: 호출
- 게시글·댓글 기능 → 댓글 API: 호출
- 게시글 API → Supabase 클라이언트: 사용 (evidence: `src/api/posts.ts`)
- 댓글 API → Supabase 클라이언트: 사용 (evidence: `src/api/comments.ts`)
- 포인트·출석 → 출석 API: 호출
- 포인트·출석 → 포인트 API: 호출
- 출석 API → Supabase 클라이언트: 사용
- 포인트 API → Supabase 클라이언트: 사용
- 채팅 화면 → 채팅 API: 호출
- 채팅 API → Supabase 클라이언트: 사용
- 채팅 화면 → 채팅 완성 함수: 요청
- 로그인 조작부 → 세션·OAuth 상태: 인증 조작 (evidence: `src/components/AuthButton.tsx`)
- 세션·OAuth 상태 → Supabase 클라이언트: OAuth·세션 (evidence: `src/contexts/AuthContext.tsx`)
- 내비게이션·알림 설정 → 세션·OAuth 상태: 세션 사용 (evidence: `src/components/HomeHeader.tsx`)
- 내비게이션·알림 설정 → 푸시 토큰 처리: 토큰 요청 (evidence: `src/components/HomeHeader.tsx`)
- 내비게이션·알림 설정 → 기기 토큰 저장: 토큰 저장 (evidence: `src/components/HomeHeader.tsx`)
- 푸시 토큰 처리 → Firebase 메시징: 초기화 (evidence: `src/lib/messaging.ts`)
- 기기 토큰 저장 → Supabase 클라이언트: 저장
- 푸시 알림 함수 → 무효 토큰 정리: 정리 위임 (evidence: `supabase/functions/notify-new-post/index.ts`)
- 댓글 알림 함수 → 무효 토큰 정리: 정리 위임 (evidence: `supabase/functions/notify-new-comment/index.ts`)
- 좋아요 알림 함수 → 무효 토큰 정리: 정리 위임 (evidence: `supabase/functions/notify-photo-like/index.ts`)
- 점수 변경 알림 → 무효 토큰 정리: 정리 위임 (evidence: `supabase/functions/notify-score-change/index.ts`)
