# ycnekkkkkk/web-glocalielts architecture

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

- Interactive diagram: https://gitdiagram.com/ycnekkkkkk/web-glocalielts
- Repository: https://github.com/ycnekkkkkk/web-glocalielts

## Overview

This is a multi-role IELTS learning and academy-management application: public course discovery and practice sit alongside student learning, teacher tools, and administrative/organization operations. A distinct mock-skill exam lifecycle covers exam content, browser-side drafts and speaking audio, submission, automated Listening/Reading scoring, Drive storage, and staff grading with Gemini. The sampled enrollment hook also creates invoices directly in Supabase. The README is only the Next.js starter README; unsampled pages are represented as capabilities from the tree, without asserting their internal wiring.

Main entry points: [`app/api/mock-skill/submit/route.ts`](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/mock-skill/submit/route.ts) (Exam submission), [`lib/supabase/server.ts`](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/supabase/server.ts) (Supabase services), [`app/api/admin/mock-skill-submissions/[id]/grade/route.ts`](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/admin/mock-skill-submissions/%5Bid%5D/grade/route.ts) (Staff grading), [`app/api/admin/create-student-account/route.ts`](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/admin/create-student-account/route.ts) (Student account setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning"]
  node_public["Public discovery<br/>[page.tsx]"]
  node_courselearn["Course learning<br/>[page.tsx]"]
  node_student["Student workspace<br/>[page.tsx]"]
  node_course_requests["Course purchase requests<br/>[route.ts]"]
end

subgraph group_academy["Academy Operations"]
  node_admin["Administration<br/>[page.tsx]"]
  node_accounts["Student account setup<br/>[route.ts]"]
  node_academic["Academic management<br/>[page.tsx]"]
  node_teacher["Teacher workspace<br/>[page.tsx]"]
  node_organization["Organization workspace<br/>[page.tsx]"]
  node_enrollments["Class enrollment<br/>[useEnrollments.ts]"]
end

subgraph group_exam["Mock Skill Exams"]
  node_mockui["Mock exam experience<br/>[page.tsx]"]
  node_drafts[("Local exam drafts")]
  node_submit["Exam submission<br/>[route.ts]"]
  node_content["Exam content resolution<br/>[resolve-content.ts]"]
  node_lrscore["Listening/reading scoring<br/>[score.ts]"]
  node_band["Band conversion<br/>[band-mapping.ts]"]
  node_grading["Staff grading<br/>[route.ts]"]
  node_gemini["Gemini scoring<br/>[score-writing.ts]"]
end

subgraph group_platform["Platform Services"]
  node_drive["Google Drive<br/>[drive.ts]"]
  node_supabase[("Supabase services<br/>[server.ts]")]
  node_indexeddb[("Browser IndexedDB")]
end

node_visitor(("Learner / visitor"))

node_visitor -->|"browses"| node_public
node_visitor -->|"takes exam"| node_mockui
node_visitor -->|"learns"| node_courselearn
node_mockui -->|"saves drafts"| node_drafts
node_drafts -->|"reads/writes"| node_indexeddb
node_submit -->|"resolves content"| node_content
node_submit -->|"scores answers"| node_lrscore
node_submit -->|"converts scores"| node_band
node_submit -->|"stores submission"| node_supabase
node_submit -.->|"uploads artifacts"| node_drive
node_grading -->|"loads and updates"| node_supabase
node_grading -->|"requests grading"| node_gemini
node_grading -.->|"reads audio"| node_drive
node_admin -->|"manages accounts"| node_accounts
node_accounts -->|"creates and links"| node_supabase
node_enrollments -->|"reads and writes"| node_supabase
node_course_requests -->|"reads and writes"| node_supabase

click node_public "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(public)/courses/page.tsx"
click node_courselearn "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(public)/courses/%5Bslug%5D/learn/page.tsx"
click node_student "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(student)/student/dashboard/page.tsx"
click node_mockui "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(public)/thi-thu/%5Bslug%5D/page.tsx"
click node_drafts "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/storage-indexeddb.ts"
click node_submit "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/mock-skill/submit/route.ts"
click node_content "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/resolve-content.ts"
click node_lrscore "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/score.ts"
click node_band "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/band-mapping.ts"
click node_grading "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/admin/mock-skill-submissions/%5Bid%5D/grade/route.ts"
click node_gemini "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/gemini/score-writing.ts"
click node_drive "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/google/drive.ts"
click node_admin "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(admin)/admin/dashboard/page.tsx"
click node_accounts "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/admin/create-student-account/route.ts"
click node_academic "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(academic-manager)/academic-manager/classes/page.tsx"
click node_teacher "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(teacher)/teacher/dashboard/page.tsx"
click node_organization "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(organization)/organization/dashboard/page.tsx"
click node_enrollments "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/hooks/useEnrollments.ts"
click node_course_requests "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/student/course-requests/route.ts"
click node_supabase "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/supabase/server.ts"
click node_indexeddb "https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/storage-indexeddb.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_public,node_courselearn,node_student,node_course_requests toneBlue
class node_admin,node_accounts,node_academic,node_teacher,node_organization,node_enrollments toneAmber
class node_mockui,node_drafts,node_submit,node_content,node_lrscore,node_band,node_grading,node_gemini toneMint
class node_drive,node_supabase,node_indexeddb toneRose
class node_visitor toneIndigo
```

## Components

### Learning

- [Public discovery](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(public)/courses/page.tsx): `app/(public)/courses/page.tsx`
- [Course learning](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(public)/courses/%5Bslug%5D/learn/page.tsx): `app/(public)/courses/[slug]/learn/page.tsx`
- [Student workspace](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(student)/student/dashboard/page.tsx): `app/(student)/student/dashboard/page.tsx`
- [Course purchase requests](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/student/course-requests/route.ts): `app/api/student/course-requests/route.ts`

### Academy Operations

- [Administration](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(admin)/admin/dashboard/page.tsx): `app/(admin)/admin/dashboard/page.tsx`
- [Student account setup](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/admin/create-student-account/route.ts): `app/api/admin/create-student-account/route.ts`
- [Academic management](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(academic-manager)/academic-manager/classes/page.tsx): `app/(academic-manager)/academic-manager/classes/page.tsx`
- [Teacher workspace](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(teacher)/teacher/dashboard/page.tsx): `app/(teacher)/teacher/dashboard/page.tsx`
- [Organization workspace](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(organization)/organization/dashboard/page.tsx): `app/(organization)/organization/dashboard/page.tsx`
- [Class enrollment](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/hooks/useEnrollments.ts): `hooks/useEnrollments.ts`

### Mock Skill Exams

- [Mock exam experience](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/(public)/thi-thu/%5Bslug%5D/page.tsx): `app/(public)/thi-thu/[slug]/page.tsx`
- [Local exam drafts](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/storage-indexeddb.ts): `lib/mock-skill/storage-indexeddb.ts`
- [Exam submission](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/mock-skill/submit/route.ts): `app/api/mock-skill/submit/route.ts`
- [Exam content resolution](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/resolve-content.ts): `lib/mock-skill/resolve-content.ts`
- [Listening/reading scoring](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/score.ts): `lib/mock-skill/score.ts`
- [Band conversion](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/band-mapping.ts): `lib/mock-skill/band-mapping.ts`
- [Staff grading](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/app/api/admin/mock-skill-submissions/%5Bid%5D/grade/route.ts): `app/api/admin/mock-skill-submissions/[id]/grade/route.ts`
- [Gemini scoring](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/gemini/score-writing.ts): `lib/gemini/score-writing.ts`

### Platform Services

- [Google Drive](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/google/drive.ts): `lib/google/drive.ts`
- [Supabase services](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/supabase/server.ts): `lib/supabase/server.ts`
- [Browser IndexedDB](https://github.com/ycnekkkkkk/web-glocalielts/blob/master/lib/mock-skill/storage-indexeddb.ts): `lib/mock-skill/storage-indexeddb.ts`

### Other components

- **Learner / visitor**

## Connections

- Learner / visitor → Public discovery: browses
- Learner / visitor → Mock exam experience: takes exam
- Learner / visitor → Course learning: learns
- Mock exam experience → Local exam drafts: saves drafts
- Local exam drafts → Browser IndexedDB: reads/writes
- Exam submission → Exam content resolution: resolves content
- Exam submission → Listening/reading scoring: scores answers
- Exam submission → Band conversion: converts scores
- Exam submission → Supabase services: stores submission
- Exam submission → Google Drive: uploads artifacts
- Staff grading → Supabase services: loads and updates
- Staff grading → Gemini scoring: requests grading
- Staff grading → Google Drive: reads audio
- Administration → Student account setup: manages accounts
- Student account setup → Supabase services: creates and links
- Class enrollment → Supabase services: reads and writes
- Course purchase requests → Supabase services: reads and writes
