# keophlyna/yike-archive architecture

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

- Interactive diagram: https://gitdiagram.com/keophlyna/yike-archive
- Repository: https://github.com/keophlyna/yike-archive

## Overview

This is a bilingual community archive for Lakhon Yike. Visitors browse and search published entries; contributors sign up, submit or edit entries with photos, and track their submissions; reviewers approve or return pending entries. Supabase provides authentication, Postgres data and review operations, and photo storage. The graph includes the documented domain stages and sampled UI/data layers. Some backend policies and implementations are explicitly unknown in the README, so those internals are not expanded.

Main entry points: [`app/page.js`](https://github.com/keophlyna/yike-archive/blob/main/app/page.js) (Archive home), [`components/review/ReviewQueue.js`](https://github.com/keophlyna/yike-archive/blob/main/components/review/ReviewQueue.js) (Review queue), [`components/entry/EntryCard.js`](https://github.com/keophlyna/yike-archive/blob/main/components/entry/EntryCard.js) (Entry cards), [`components/auth/AuthForm.js`](https://github.com/keophlyna/yike-archive/blob/main/components/auth/AuthForm.js) (Sign in and signup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Browse and discover"]
  node_home["Archive home<br/>[page.js]"]
  node_suggestions["Search suggestions"]
  node_entrycard["Entry cards<br/>[EntryCard.js]"]
  node_entrydetail["Entry detail<br/>[EntryDetail.js]"]
  node_performance["Performance section"]
  node_costume["Costume section<br/>[CostumeSection.js]"]
end

subgraph group_contribution["Contribute and manage"]
  node_auth["Sign in and signup<br/>[AuthForm.js]"]
  node_contribute["Contribution page<br/>[page.js]"]
  node_contributeform["Contribution form<br/>[ContributeForm.js]"]
  node_fields["Entry fields"]
  node_validation["Entry validation<br/>[validateEntry.js]"]
  node_save["Save entry<br/>[saveEntry.js]"]
  node_upload["Photo upload<br/>[uploadPhoto.js]"]
  node_edit["Edit entry<br/>[EntryEditor.js]"]
  node_update["Update entry<br/>[updateEntry.js]"]
  node_myentries["My entries<br/>[page.js]"]
end

subgraph group_review["Editorial review"]
  node_reviewpage["Reviewer gate<br/>[page.js]"]
  node_queue["Review queue<br/>[ReviewQueue.js]"]
  node_reviewitem["Review item<br/>[ReviewItem.js]"]
end

subgraph group_shared["Shared services"]
  node_language["Language preference<br/>[useLanguage.js]"]
  node_config["Collection metadata"]
  node_browserdb["Supabase browser client<br/>[client.js]"]
  node_serverdb["Supabase server client<br/>[server.js]"]
end

node_visitor(("Visitor"))
node_supabase[("Supabase services")]
node_photos[("Supabase photo storage")]

node_visitor -->|"browses"| node_home
node_home -->|"loads published entries"| node_supabase
node_home -->|"renders"| node_entrycard
node_home -->|"uses search"| node_suggestions
node_entrydetail -->|"renders detail"| node_entrycard
node_entrycard -->|"renders phases"| node_performance
node_entrycard -->|"renders garments"| node_costume
node_home -->|"reads metadata"| node_config
node_visitor -->|"creates account"| node_auth
node_auth -->|"authenticates"| node_supabase
node_visitor -->|"submits entry"| node_contribute
node_contribute -.->|"presents form"| node_contributeform
node_contributeform -->|"renders fields"| node_fields
node_fields -->|"validates values"| node_validation
node_contributeform -->|"saves submission"| node_save
node_save -->|"inserts entry"| node_supabase
node_save -.->|"uploads photo"| node_upload
node_upload -->|"stores photo"| node_photos
node_edit -->|"saves changes"| node_update
node_update -->|"updates entry"| node_supabase
node_update -->|"replaces photo"| node_upload
node_myentries -->|"loads submissions"| node_supabase
node_visitor -->|"opens review"| node_reviewpage
node_reviewpage -->|"checks reviewer"| node_supabase
node_reviewpage -->|"loads pending entries"| node_queue
node_queue -->|"renders entries"| node_reviewitem
node_queue -->|"submits decision"| node_supabase
node_entrydetail -->|"fetches entry"| node_supabase
node_auth -->|"reads preference"| node_language
node_queue -->|"reads preference"| node_language

click node_home "https://github.com/keophlyna/yike-archive/blob/main/app/page.js"
click node_suggestions "https://github.com/keophlyna/yike-archive/blob/main/components/search/SearchSuggestions.js"
click node_entrycard "https://github.com/keophlyna/yike-archive/blob/main/components/entry/EntryCard.js"
click node_entrydetail "https://github.com/keophlyna/yike-archive/blob/main/components/entry/EntryDetail.js"
click node_performance "https://github.com/keophlyna/yike-archive/blob/main/components/entry/PerformanceSection.js"
click node_costume "https://github.com/keophlyna/yike-archive/blob/main/components/entry/CostumeSection.js"
click node_auth "https://github.com/keophlyna/yike-archive/blob/main/components/auth/AuthForm.js"
click node_contribute "https://github.com/keophlyna/yike-archive/blob/main/app/contribute/page.js"
click node_contributeform "https://github.com/keophlyna/yike-archive/blob/main/components/form/ContributeForm.js"
click node_fields "https://github.com/keophlyna/yike-archive/blob/main/components/form/ContributeFields.js"
click node_validation "https://github.com/keophlyna/yike-archive/blob/main/utils/form/validateEntry.js"
click node_save "https://github.com/keophlyna/yike-archive/blob/main/utils/entries/saveEntry.js"
click node_upload "https://github.com/keophlyna/yike-archive/blob/main/utils/entries/uploadPhoto.js"
click node_edit "https://github.com/keophlyna/yike-archive/blob/main/components/form/EntryEditor.js"
click node_update "https://github.com/keophlyna/yike-archive/blob/main/utils/entries/updateEntry.js"
click node_myentries "https://github.com/keophlyna/yike-archive/blob/main/app/my-entries/page.js"
click node_reviewpage "https://github.com/keophlyna/yike-archive/blob/main/app/review/page.js"
click node_queue "https://github.com/keophlyna/yike-archive/blob/main/components/review/ReviewQueue.js"
click node_reviewitem "https://github.com/keophlyna/yike-archive/blob/main/components/review/ReviewItem.js"
click node_language "https://github.com/keophlyna/yike-archive/blob/main/components/hooks/useLanguage.js"
click node_config "https://github.com/keophlyna/yike-archive/blob/main/collection.config.js"
click node_browserdb "https://github.com/keophlyna/yike-archive/blob/main/utils/supabase/client.js"
click node_serverdb "https://github.com/keophlyna/yike-archive/blob/main/utils/supabase/server.js"

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_suggestions,node_entrycard,node_entrydetail,node_performance,node_costume toneBlue
class node_auth,node_contribute,node_contributeform,node_fields,node_validation,node_save,node_upload,node_edit,node_update,node_myentries,node_supabase,node_photos toneAmber
class node_reviewpage,node_queue,node_reviewitem toneMint
class node_language,node_config,node_browserdb,node_serverdb toneRose
class node_visitor toneIndigo
```

## Components

### Browse and discover

- [Archive home](https://github.com/keophlyna/yike-archive/blob/main/app/page.js): `app/page.js`
- [Search suggestions](https://github.com/keophlyna/yike-archive/blob/main/components/search/SearchSuggestions.js): `components/search/SearchSuggestions.js`
- [Entry cards](https://github.com/keophlyna/yike-archive/blob/main/components/entry/EntryCard.js): `components/entry/EntryCard.js`
- [Entry detail](https://github.com/keophlyna/yike-archive/blob/main/components/entry/EntryDetail.js): `components/entry/EntryDetail.js`
- [Performance section](https://github.com/keophlyna/yike-archive/blob/main/components/entry/PerformanceSection.js): `components/entry/PerformanceSection.js`
- [Costume section](https://github.com/keophlyna/yike-archive/blob/main/components/entry/CostumeSection.js): `components/entry/CostumeSection.js`

### Contribute and manage

- [Sign in and signup](https://github.com/keophlyna/yike-archive/blob/main/components/auth/AuthForm.js): `components/auth/AuthForm.js`
- [Contribution page](https://github.com/keophlyna/yike-archive/blob/main/app/contribute/page.js): `app/contribute/page.js`
- [Contribution form](https://github.com/keophlyna/yike-archive/blob/main/components/form/ContributeForm.js): `components/form/ContributeForm.js`
- [Entry fields](https://github.com/keophlyna/yike-archive/blob/main/components/form/ContributeFields.js): `components/form/ContributeFields.js`
- [Entry validation](https://github.com/keophlyna/yike-archive/blob/main/utils/form/validateEntry.js): `utils/form/validateEntry.js`
- [Save entry](https://github.com/keophlyna/yike-archive/blob/main/utils/entries/saveEntry.js): `utils/entries/saveEntry.js`
- [Photo upload](https://github.com/keophlyna/yike-archive/blob/main/utils/entries/uploadPhoto.js): `utils/entries/uploadPhoto.js`
- [Edit entry](https://github.com/keophlyna/yike-archive/blob/main/components/form/EntryEditor.js): `components/form/EntryEditor.js`
- [Update entry](https://github.com/keophlyna/yike-archive/blob/main/utils/entries/updateEntry.js): `utils/entries/updateEntry.js`
- [My entries](https://github.com/keophlyna/yike-archive/blob/main/app/my-entries/page.js): `app/my-entries/page.js`

### Editorial review

- [Reviewer gate](https://github.com/keophlyna/yike-archive/blob/main/app/review/page.js): `app/review/page.js`
- [Review queue](https://github.com/keophlyna/yike-archive/blob/main/components/review/ReviewQueue.js): `components/review/ReviewQueue.js`
- [Review item](https://github.com/keophlyna/yike-archive/blob/main/components/review/ReviewItem.js): `components/review/ReviewItem.js`

### Shared services

- [Language preference](https://github.com/keophlyna/yike-archive/blob/main/components/hooks/useLanguage.js): `components/hooks/useLanguage.js`
- [Collection metadata](https://github.com/keophlyna/yike-archive/blob/main/collection.config.js): `collection.config.js`
- [Supabase browser client](https://github.com/keophlyna/yike-archive/blob/main/utils/supabase/client.js): `utils/supabase/client.js`
- [Supabase server client](https://github.com/keophlyna/yike-archive/blob/main/utils/supabase/server.js): `utils/supabase/server.js`

### Other components

- **Visitor**
- **Supabase services**
- **Supabase photo storage**

## Connections

- Visitor → Archive home: browses
- Archive home → Supabase services: loads published entries
- Archive home → Entry cards: renders (evidence: `app/page.js`)
- Archive home → Search suggestions: uses search (evidence: `app/page.js`)
- Entry detail → Entry cards: renders detail (evidence: `components/entry/EntryDetail.js`)
- Entry cards → Performance section: renders phases (evidence: `components/entry/EntryCard.js`)
- Entry cards → Costume section: renders garments (evidence: `components/entry/EntryCard.js`)
- Archive home → Collection metadata: reads metadata (evidence: `app/page.js`)
- Visitor → Sign in and signup: creates account
- Sign in and signup → Supabase services: authenticates (evidence: `components/auth/AuthForm.js`)
- Visitor → Contribution page: submits entry
- Contribution page → Contribution form: presents form
- Contribution form → Entry fields: renders fields (evidence: `components/form/ContributeFields.js`)
- Entry fields → Entry validation: validates values (evidence: `components/form/ContributeFields.js`)
- Contribution form → Save entry: saves submission
- Save entry → Supabase services: inserts entry
- Save entry → Photo upload: uploads photo
- Photo upload → Supabase photo storage: stores photo
- Edit entry → Update entry: saves changes (evidence: `components/form/EntryEditor.js`)
- Update entry → Supabase services: updates entry
- Update entry → Photo upload: replaces photo (evidence: `utils/entries/updateEntry.js`)
- My entries → Supabase services: loads submissions
- Visitor → Reviewer gate: opens review
- Reviewer gate → Supabase services: checks reviewer
- Reviewer gate → Review queue: loads pending entries (evidence: `app/review/page.js`)
- Review queue → Review item: renders entries (evidence: `components/review/ReviewQueue.js`)
- Review queue → Supabase services: submits decision (evidence: `components/review/ReviewQueue.js`)
- Entry detail → Supabase services: fetches entry (evidence: `components/entry/EntryDetail.js`)
- Sign in and signup → Language preference: reads preference (evidence: `components/auth/AuthForm.js`)
- Review queue → Language preference: reads preference (evidence: `components/review/ReviewQueue.js`)
