# rajesh1707-stack/school-ai architecture

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

- Interactive diagram: https://gitdiagram.com/rajesh1707-stack/school-ai
- Repository: https://github.com/rajesh1707-stack/school-ai

## Overview

English Excel is a school English-learning platform with student, teacher, principal, and administrator portals. Its central learner workflow is to enter the student learning studio, work through lessons and interactive practice, and complete speaking assessment; teacher and principal portals support attendance and class oversight, while administrators manage accounts and curriculum. The graph reflects the sampled code and SOURCE INDEX references. Several route implementations and dashboard details were not sampled, so uncertain connections are omitted or marked optional.

Main entry points: [`src/app/student/page.tsx`](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/student/page.tsx) (Student Studio), [`src/lib/supabase.ts`](https://github.com/rajesh1707-stack/school-ai/blob/main/src/lib/supabase.ts) (Supabase Client), [`src/app/teacher/page.tsx`](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/teacher/page.tsx) (Teacher Portal), [`src/app/admin/page.tsx`](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/admin/page.tsx) (Admin Portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Admin"]
  node_login["Login<br/>[page.tsx]"]
  node_admin["Admin Portal<br/>[page.tsx]"]
end

subgraph group_learning["Learning Experience"]
  node_student["Student Studio<br/>[page.tsx]"]
  node_speech["Speech Analyzer<br/>[SpeechAnalyzer.tsx]"]
  node_typing["Typing Practice<br/>[TypingActivity.tsx]"]
  node_wordbuilder["Word Builder<br/>[WordBuilder.tsx]"]
  node_matchgame["Match Game"]
  node_sentencegame["Sentence Builder"]
  node_gamification["Gamification Logic<br/>[gamification.ts]"]
  node_sound["Sound Effects<br/>[soundEffects.ts]"]
end

subgraph group_school["School Operations"]
  node_teacher["Teacher Portal<br/>[page.tsx]"]
  node_principal["Principal Portal<br/>[page.tsx]"]
  node_leaderboard["Class Leaderboard"]
  node_report["Student Report"]
end

subgraph group_services["Data and Services"]
  node_speechapi["Speech Evaluation API<br/>[route.ts]"]
  node_attendance["Attendance API<br/>[route.ts]"]
  node_supabase["Supabase Client<br/>[supabase.ts]"]
  node_createuser["Create User API<br/>[route.ts]"]
  node_password["Password API<br/>[route.ts]"]
  node_database[("Supabase Data")]
end

node_visitor(("User"))

node_visitor -->|"signs in"| node_login
node_visitor -->|"opens"| node_student
node_visitor -->|"opens"| node_teacher
node_visitor -->|"opens"| node_principal
node_visitor -->|"opens"| node_admin
node_login -->|"uses client"| node_supabase
node_admin -->|"uses client"| node_supabase
node_admin -.->|"provisions accounts"| node_createuser
node_admin -.->|"updates credentials"| node_password
node_student -->|"uses client"| node_supabase
node_student -->|"uses analyzer"| node_speech
node_student -->|"uses activity"| node_typing
node_student -->|"uses activity"| node_wordbuilder
node_speech -.->|"submits evaluation"| node_speechapi
node_teacher -->|"uses client"| node_supabase
node_teacher -.->|"records attendance"| node_attendance
node_teacher -->|"uses analyzer"| node_speech
node_principal -->|"uses client"| node_supabase
node_principal -->|"renders"| node_leaderboard
node_student -->|"uses component"| node_leaderboard
node_teacher -->|"uses component"| node_leaderboard
node_student -->|"uses component"| node_report
node_report -->|"reads completions"| node_supabase
node_supabase -.->|"connects"| node_database
node_matchgame -->|"plays effects"| node_sound
node_sentencegame -->|"plays effects"| node_sound

click node_login "https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/login/page.tsx"
click node_admin "https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/admin/page.tsx"
click node_student "https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/student/page.tsx"
click node_speech "https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/speech/SpeechAnalyzer.tsx"
click node_speechapi "https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/api/ai/speech-eval/route.ts"
click node_typing "https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/activities/TypingActivity.tsx"
click node_wordbuilder "https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/activities/WordBuilder.tsx"
click node_matchgame "https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/activities/InteractiveMatchGame.tsx"
click node_sentencegame "https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/activities/SentenceBuilderGame.tsx"
click node_teacher "https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/teacher/page.tsx"
click node_attendance "https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/api/teacher/attendance/route.ts"
click node_principal "https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/principal/page.tsx"
click node_leaderboard "https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/dashboard/ClassLeaderboard.tsx"
click node_report "https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/dashboard/StudentReportModal.tsx"
click node_supabase "https://github.com/rajesh1707-stack/school-ai/blob/main/src/lib/supabase.ts"
click node_createuser "https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/api/admin/create-user/route.ts"
click node_password "https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/api/admin/update-password/route.ts"
click node_gamification "https://github.com/rajesh1707-stack/school-ai/blob/main/src/lib/gamification.ts"
click node_sound "https://github.com/rajesh1707-stack/school-ai/blob/main/src/utils/soundEffects.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_login,node_admin,node_visitor toneBlue
class node_student,node_speech,node_typing,node_wordbuilder,node_matchgame,node_sentencegame,node_gamification,node_sound toneAmber
class node_teacher,node_principal,node_leaderboard,node_report toneMint
class node_speechapi,node_attendance,node_supabase,node_createuser,node_password,node_database toneRose
```

## Components

### Access and Admin

- [Login](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Admin Portal](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`

### Learning Experience

- [Student Studio](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/student/page.tsx): `src/app/student/page.tsx`
- [Speech Analyzer](https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/speech/SpeechAnalyzer.tsx): `src/components/speech/SpeechAnalyzer.tsx`
- [Typing Practice](https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/activities/TypingActivity.tsx): `src/components/activities/TypingActivity.tsx`
- [Word Builder](https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/activities/WordBuilder.tsx): `src/components/activities/WordBuilder.tsx`
- [Match Game](https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/activities/InteractiveMatchGame.tsx): `src/components/activities/InteractiveMatchGame.tsx`
- [Sentence Builder](https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/activities/SentenceBuilderGame.tsx): `src/components/activities/SentenceBuilderGame.tsx`
- [Gamification Logic](https://github.com/rajesh1707-stack/school-ai/blob/main/src/lib/gamification.ts): `src/lib/gamification.ts`
- [Sound Effects](https://github.com/rajesh1707-stack/school-ai/blob/main/src/utils/soundEffects.ts): `src/utils/soundEffects.ts`

### School Operations

- [Teacher Portal](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/teacher/page.tsx): `src/app/teacher/page.tsx`
- [Principal Portal](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/principal/page.tsx): `src/app/principal/page.tsx`
- [Class Leaderboard](https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/dashboard/ClassLeaderboard.tsx): `src/components/dashboard/ClassLeaderboard.tsx`
- [Student Report](https://github.com/rajesh1707-stack/school-ai/blob/main/src/components/dashboard/StudentReportModal.tsx): `src/components/dashboard/StudentReportModal.tsx`

### Data and Services

- [Speech Evaluation API](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/api/ai/speech-eval/route.ts): `src/app/api/ai/speech-eval/route.ts`
- [Attendance API](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/api/teacher/attendance/route.ts): `src/app/api/teacher/attendance/route.ts`
- [Supabase Client](https://github.com/rajesh1707-stack/school-ai/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Create User API](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/api/admin/create-user/route.ts): `src/app/api/admin/create-user/route.ts`
- [Password API](https://github.com/rajesh1707-stack/school-ai/blob/main/src/app/api/admin/update-password/route.ts): `src/app/api/admin/update-password/route.ts`
- **Supabase Data**

### Other components

- **User**

## Connections

- User → Login: signs in (evidence: `src/app/login/page.tsx`)
- User → Student Studio: opens (evidence: `src/app/student/page.tsx`)
- User → Teacher Portal: opens (evidence: `src/app/teacher/page.tsx`)
- User → Principal Portal: opens (evidence: `src/app/principal/page.tsx`)
- User → Admin Portal: opens (evidence: `src/app/admin/page.tsx`)
- Login → Supabase Client: uses client (evidence: `src/app/login/page.tsx`)
- Admin Portal → Supabase Client: uses client (evidence: `src/app/admin/page.tsx`)
- Admin Portal → Create User API: provisions accounts
- Admin Portal → Password API: updates credentials
- Student Studio → Supabase Client: uses client (evidence: `src/app/student/page.tsx`)
- Student Studio → Speech Analyzer: uses analyzer (evidence: `src/app/student/page.tsx`)
- Student Studio → Typing Practice: uses activity (evidence: `src/app/student/page.tsx`)
- Student Studio → Word Builder: uses activity (evidence: `src/app/student/page.tsx`)
- Speech Analyzer → Speech Evaluation API: submits evaluation
- Teacher Portal → Supabase Client: uses client (evidence: `src/app/teacher/page.tsx`)
- Teacher Portal → Attendance API: records attendance
- Teacher Portal → Speech Analyzer: uses analyzer (evidence: `src/app/teacher/page.tsx`)
- Principal Portal → Supabase Client: uses client (evidence: `src/app/principal/page.tsx`)
- Principal Portal → Class Leaderboard: renders (evidence: `src/app/principal/page.tsx`)
- Student Studio → Class Leaderboard: uses component (evidence: `src/app/student/page.tsx`)
- Teacher Portal → Class Leaderboard: uses component (evidence: `src/app/teacher/page.tsx`)
- Student Studio → Student Report: uses component (evidence: `src/app/student/page.tsx`)
- Student Report → Supabase Client: reads completions (evidence: `src/components/dashboard/StudentReportModal.tsx`)
- Supabase Client → Supabase Data: connects
- Match Game → Sound Effects: plays effects (evidence: `src/components/activities/InteractiveMatchGame.tsx`)
- Sentence Builder → Sound Effects: plays effects (evidence: `src/components/activities/SentenceBuilderGame.tsx`)
