# jun28th/ielts-fe architecture

> Architecture diagram of the GitHub repository jun28th/ielts-fe, 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/jun28th/ielts-fe
- Repository: https://github.com/jun28th/ielts-fe

## Overview

This is a role-based education management web application. Teachers manage courses, weekly sections, student accounts and a four-skill question bank; students and administrators have separate dashboards, and administrators manage roles and permissions. The visible workflow runs from role-specific pages through browser API clients and Next.js API routes to a configured backend. Source excerpts show course and student management and access control; other major routes and features are retained from the tree, but their internal behavior is not inferred. No backend datastore is shown.

Main entry points: [`lib/api/courses-client.ts`](https://github.com/jun28th/ielts-fe/blob/main/lib/api/courses-client.ts) (Course API client), [`app/[locale]/admin/access-control/page.tsx`](https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/admin/access-control/page.tsx) (Access control), [`app/[locale]/teacher/students/page.tsx`](https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/teacher/students/page.tsx) (Student management), [`lib/api/http.ts`](https://github.com/jun28th/ielts-fe/blob/main/lib/api/http.ts) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Identity"]
  node_signin["Sign-in page<br/>[page.tsx]"]
  node_authcontext["Authentication state<br/>[auth-context.tsx]"]
  node_authclient["Authentication client<br/>[auth-client.ts]"]
  node_authapi["Authentication routes<br/>[route.ts]"]
end

subgraph group_learning["Teaching and courses"]
  node_teacher["Teacher workspace<br/>[page.tsx]"]
  node_student["Student dashboard<br/>[page.tsx]"]
  node_courseui["Course views"]
  node_coursemodal["Course creation"]
  node_students["Student management<br/>[page.tsx]"]
  node_studentmodal["Student forms"]
  node_questionbank["Question bank"]
end

subgraph group_admin["Administration"]
  node_adminui["Access control<br/>[page.tsx]"]
end

subgraph group_platform["Application services"]
  node_courseclient["Course API client<br/>[courses-client.ts]"]
  node_courseapi["Course routes"]
  node_coursemodel["Course data types<br/>[course-types.ts]"]
  node_userclient["User API client<br/>[user-client.ts]"]
  node_studentapi["Student routes"]
  node_writingclient["Writing question client"]
  node_writingapi["Writing question routes<br/>[route.ts]"]
  node_rolesclient["Role API client<br/>[roles-client.ts]"]
  node_permissionsclient["Permission API client"]
  node_rolesapi["Role routes"]
  node_permissionsapi["Permission routes<br/>[route.ts]"]
  node_http["HTTP client<br/>[http.ts]"]
end

node_backend{{"Backend API"}}

node_teacher -->|"loads courses"| node_courseclient
node_teacher -->|"renders cards"| node_courseui
node_teacher -->|"opens form"| node_coursemodal
node_coursemodal -->|"creates course"| node_courseclient
node_courseclient -->|"uses"| node_http
node_courseclient -->|"uses types"| node_coursemodel
node_courseclient -->|"requests"| node_courseapi
node_students -->|"loads and deletes"| node_userclient
node_students -->|"renders forms"| node_studentmodal
node_students -->|"debounces search"| node_students
node_userclient -->|"uses"| node_http
node_userclient -.->|"requests"| node_studentapi
node_questionbank -.->|"manages writing questions"| node_writingclient
node_writingclient -->|"uses"| node_http
node_writingapi -->|"forwards requests"| node_backend
node_adminui -->|"loads and updates roles"| node_rolesclient
node_adminui -->|"loads permissions"| node_permissionsclient
node_adminui -.->|"requests roles"| node_rolesapi
node_adminui -.->|"requests permissions"| node_permissionsapi
node_signin -->|"uses auth state"| node_authcontext
node_signin -->|"submits credentials"| node_authclient
node_authapi -.->|"forwards requests"| node_backend
node_courseapi -->|"forwards requests"| node_backend
node_studentapi -.->|"forwards requests"| node_backend
node_http -.->|"sends requests"| node_backend

click node_teacher "https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/teacher/courses/page.tsx"
click node_student "https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/student/dashboard/page.tsx"
click node_courseui "https://github.com/jun28th/ielts-fe/tree/main/components/Course"
click node_coursemodal "https://github.com/jun28th/ielts-fe/blob/main/components/Modal/CreateCourseModal.tsx"
click node_courseclient "https://github.com/jun28th/ielts-fe/blob/main/lib/api/courses-client.ts"
click node_courseapi "https://github.com/jun28th/ielts-fe/tree/main/app/api/courses"
click node_coursemodel "https://github.com/jun28th/ielts-fe/blob/main/types/course-types.ts"
click node_students "https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/teacher/students/page.tsx"
click node_studentmodal "https://github.com/jun28th/ielts-fe/blob/main/components/Modal/CreateStudentModal.tsx"
click node_userclient "https://github.com/jun28th/ielts-fe/blob/main/lib/api/user-client.ts"
click node_studentapi "https://github.com/jun28th/ielts-fe/tree/main/app/api/users/students"
click node_questionbank "https://github.com/jun28th/ielts-fe/tree/main/app/%5Blocale%5D/teacher/question-bank"
click node_writingclient "https://github.com/jun28th/ielts-fe/blob/main/lib/api/writing-questions-client.ts"
click node_writingapi "https://github.com/jun28th/ielts-fe/blob/main/app/api/writing-questions/route.ts"
click node_adminui "https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/admin/access-control/page.tsx"
click node_rolesclient "https://github.com/jun28th/ielts-fe/blob/main/lib/api/roles-client.ts"
click node_permissionsclient "https://github.com/jun28th/ielts-fe/blob/main/lib/api/permissions-client.ts"
click node_rolesapi "https://github.com/jun28th/ielts-fe/tree/main/app/api/roles"
click node_permissionsapi "https://github.com/jun28th/ielts-fe/blob/main/app/api/permissions/route.ts"
click node_signin "https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/auth/sign-in/page.tsx"
click node_authcontext "https://github.com/jun28th/ielts-fe/blob/main/contexts/auth-context.tsx"
click node_authclient "https://github.com/jun28th/ielts-fe/blob/main/lib/api/auth-client.ts"
click node_authapi "https://github.com/jun28th/ielts-fe/blob/main/app/api/auth/sign-in/route.ts"
click node_http "https://github.com/jun28th/ielts-fe/blob/main/lib/api/http.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_signin,node_authcontext,node_authclient,node_authapi toneBlue
class node_teacher,node_student,node_courseui,node_coursemodal,node_students,node_studentmodal,node_questionbank toneAmber
class node_adminui,node_backend toneMint
class node_courseclient,node_courseapi,node_coursemodel,node_userclient,node_studentapi,node_writingclient,node_writingapi,node_rolesclient,node_permissionsclient,node_rolesapi,node_permissionsapi,node_http toneRose
```

## Components

### Identity

- [Sign-in page](https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/auth/sign-in/page.tsx): `app/[locale]/auth/sign-in/page.tsx`
- [Authentication state](https://github.com/jun28th/ielts-fe/blob/main/contexts/auth-context.tsx): `contexts/auth-context.tsx`
- [Authentication client](https://github.com/jun28th/ielts-fe/blob/main/lib/api/auth-client.ts): `lib/api/auth-client.ts`
- [Authentication routes](https://github.com/jun28th/ielts-fe/blob/main/app/api/auth/sign-in/route.ts): `app/api/auth/sign-in/route.ts`

### Teaching and courses

- [Teacher workspace](https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/teacher/courses/page.tsx): `app/[locale]/teacher/courses/page.tsx`
- [Student dashboard](https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/student/dashboard/page.tsx): `app/[locale]/student/dashboard/page.tsx`
- [Course views](https://github.com/jun28th/ielts-fe/tree/main/components/Course): `components/Course`
- [Course creation](https://github.com/jun28th/ielts-fe/blob/main/components/Modal/CreateCourseModal.tsx): `components/Modal/CreateCourseModal.tsx`
- [Student management](https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/teacher/students/page.tsx): `app/[locale]/teacher/students/page.tsx`
- [Student forms](https://github.com/jun28th/ielts-fe/blob/main/components/Modal/CreateStudentModal.tsx): `components/Modal/CreateStudentModal.tsx`
- [Question bank](https://github.com/jun28th/ielts-fe/tree/main/app/%5Blocale%5D/teacher/question-bank): `app/[locale]/teacher/question-bank`

### Administration

- [Access control](https://github.com/jun28th/ielts-fe/blob/main/app/%5Blocale%5D/admin/access-control/page.tsx): `app/[locale]/admin/access-control/page.tsx`

### Application services

- [Course API client](https://github.com/jun28th/ielts-fe/blob/main/lib/api/courses-client.ts): `lib/api/courses-client.ts`
- [Course routes](https://github.com/jun28th/ielts-fe/tree/main/app/api/courses): `app/api/courses`
- [Course data types](https://github.com/jun28th/ielts-fe/blob/main/types/course-types.ts): `types/course-types.ts`
- [User API client](https://github.com/jun28th/ielts-fe/blob/main/lib/api/user-client.ts): `lib/api/user-client.ts`
- [Student routes](https://github.com/jun28th/ielts-fe/tree/main/app/api/users/students): `app/api/users/students`
- [Writing question client](https://github.com/jun28th/ielts-fe/blob/main/lib/api/writing-questions-client.ts): `lib/api/writing-questions-client.ts`
- [Writing question routes](https://github.com/jun28th/ielts-fe/blob/main/app/api/writing-questions/route.ts): `app/api/writing-questions/route.ts`
- [Role API client](https://github.com/jun28th/ielts-fe/blob/main/lib/api/roles-client.ts): `lib/api/roles-client.ts`
- [Permission API client](https://github.com/jun28th/ielts-fe/blob/main/lib/api/permissions-client.ts): `lib/api/permissions-client.ts`
- [Role routes](https://github.com/jun28th/ielts-fe/tree/main/app/api/roles): `app/api/roles`
- [Permission routes](https://github.com/jun28th/ielts-fe/blob/main/app/api/permissions/route.ts): `app/api/permissions/route.ts`
- [HTTP client](https://github.com/jun28th/ielts-fe/blob/main/lib/api/http.ts): `lib/api/http.ts`

### Other components

- **Backend API**

## Connections

- Teacher workspace → Course API client: loads courses (evidence: `app/[locale]/teacher/courses/page.tsx`)
- Teacher workspace → Course views: renders cards (evidence: `app/[locale]/teacher/courses/page.tsx`)
- Teacher workspace → Course creation: opens form (evidence: `app/[locale]/teacher/courses/page.tsx`)
- Course creation → Course API client: creates course (evidence: `components/Modal/CreateCourseModal.tsx`)
- Course API client → HTTP client: uses (evidence: `lib/api/courses-client.ts`)
- Course API client → Course data types: uses types (evidence: `lib/api/courses-client.ts`)
- Course API client → Course routes: requests (evidence: `lib/api/courses-client.ts`)
- Student management → User API client: loads and deletes (evidence: `app/[locale]/teacher/students/page.tsx`)
- Student management → Student forms: renders forms (evidence: `app/[locale]/teacher/students/page.tsx`)
- Student management → Student management: debounces search (evidence: `app/[locale]/teacher/students/page.tsx`)
- User API client → HTTP client: uses (evidence: `lib/api/user-client.ts`)
- User API client → Student routes: requests
- Question bank → Writing question client: manages writing questions
- Writing question client → HTTP client: uses (evidence: `lib/api/writing-questions-client.ts`)
- Writing question routes → Backend API: forwards requests (evidence: `app/api/writing-questions/route.ts`)
- Access control → Role API client: loads and updates roles (evidence: `app/[locale]/admin/access-control/page.tsx`)
- Access control → Permission API client: loads permissions (evidence: `app/[locale]/admin/access-control/page.tsx`)
- Access control → Role routes: requests roles
- Access control → Permission routes: requests permissions
- Sign-in page → Authentication state: uses auth state (evidence: `app/[locale]/auth/sign-in/page.tsx`)
- Sign-in page → Authentication client: submits credentials (evidence: `app/[locale]/auth/sign-in/page.tsx`)
- Authentication routes → Backend API: forwards requests
- Course routes → Backend API: forwards requests (evidence: `app/api/courses/route.ts`)
- Student routes → Backend API: forwards requests
- HTTP client → Backend API: sends requests
