# hibatullahsyauqi/tutoring-platform architecture

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

- Interactive diagram: https://gitdiagram.com/hibatullahsyauqi/tutoring-platform
- Repository: https://github.com/hibatullahsyauqi/tutoring-platform

## Overview

Pedagogical OS is a tutor-facing STEM tutoring platform. The main workflow runs from tutor sign-in and dashboard briefing through student enrollment, scheduling, session logging, and a student learning dossier with conceptual mastery continuity and a copyable presence row. The README also describes multi-curriculum differentiation and contract-aware earnings; the sampled course APIs and dashboard support parts of those capabilities, while other implementation details are not shown. Edges reflect sampled calls, indexed module references, or documented behavior; unsampled financial and pedagogical internals are not inferred.

Main entry points: [`src/lib/prisma.ts`](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/lib/prisma.ts) (Prisma Client), [`src/app/page.tsx`](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/page.tsx) (Dashboard & Briefing), [`src/app/students/[id]/page.tsx`](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/students/%5Bid%5D/page.tsx) (Student Dossier), [`src/lib/supabase/server.ts`](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/lib/supabase/server.ts) (Supabase Server Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Tutor Operations"]
  node_dashboard["Dashboard &amp; Briefing<br/>[page.tsx]"]
  node_schedule_page["Schedule Page<br/>[page.tsx]"]
  node_schedule_view["Schedule Calendar"]
  node_schedule_actions["Schedule Actions<br/>[schedule.ts]"]
  node_presence_button["Presence Clipboard"]
end

subgraph group_learning["Learning Records"]
  node_new_student_page["New Student Page<br/>[page.tsx]"]
  node_new_student_form["Student Enrollment Form<br/>[NewStudentForm.tsx]"]
  node_student_actions["Student Actions<br/>[student.ts]"]
  node_student_dossier["Student Dossier<br/>[page.tsx]"]
  node_session_page["New Session Page<br/>[page.tsx]"]
  node_session_form["Session Log Form<br/>[SessionForm.tsx]"]
  node_session_actions["Session Actions<br/>[session.ts]"]
end

subgraph group_curriculum["Curriculum &amp; Resources"]
  node_courses_api["Course Options API<br/>[route.ts]"]
  node_session_options_api["Session Options API<br/>[route.ts]"]
  node_library_page["Resource Library Page<br/>[page.tsx]"]
  node_library_view["Resource Library View<br/>[LibraryView.tsx]"]
  node_resource_actions["Resource Actions<br/>[resource.ts]"]
end

subgraph group_platform["Identity &amp; Data"]
  node_auth_actions["Auth Actions<br/>[auth.ts]"]
  node_login["Tutor Login<br/>[page.tsx]"]
  node_auth_callback["Auth Callback<br/>[route.ts]"]
  node_supabase_server["Supabase Server Client<br/>[server.ts]"]
  node_prisma_client["Prisma Client<br/>[prisma.ts]"]
  node_database[("PostgreSQL Database<br/>[schema.prisma]")]
end

node_tutor(("Tutor"))
node_clipboard["System Clipboard"]
node_supabase_auth{{"Supabase Auth"}}

node_tutor -->|"signs in"| node_login
node_login -->|"authenticates with"| node_supabase_server
node_supabase_server -->|"creates session client"| node_supabase_auth
node_auth_callback -->|"exchanges code"| node_supabase_server
node_auth_callback -->|"syncs tutor profile"| node_prisma_client
node_tutor -->|"views briefing"| node_dashboard
node_dashboard -->|"checks user"| node_supabase_server
node_dashboard -->|"reads tutor data"| node_prisma_client
node_dashboard -->|"submits sign-out"| node_auth_actions
node_dashboard -->|"opens student"| node_student_dossier
node_tutor -->|"opens schedule"| node_schedule_page
node_schedule_page -->|"renders"| node_schedule_view
node_schedule_page -->|"loads schedule data"| node_prisma_client
node_schedule_view -->|"schedules or cancels"| node_schedule_actions
node_schedule_actions -->|"updates sessions"| node_prisma_client
node_tutor -->|"starts enrollment"| node_new_student_page
node_new_student_page -->|"renders"| node_new_student_form
node_new_student_page -->|"loads enrollment data"| node_prisma_client
node_new_student_form -->|"submits student"| node_student_actions
node_student_actions -->|"persists student"| node_prisma_client
node_tutor -->|"logs lesson"| node_session_page
node_session_page -->|"renders"| node_session_form
node_session_page -->|"loads session data"| node_prisma_client
node_session_form -->|"submits session log"| node_session_actions
node_session_actions -->|"stores session records"| node_prisma_client
node_tutor -->|"reviews continuity"| node_student_dossier
node_student_dossier -->|"reads learning history"| node_prisma_client
node_student_dossier -->|"provides row payload"| node_presence_button
node_presence_button -->|"copies TSV row"| node_clipboard
node_student_dossier -->|"offers profile deletion"| node_student_actions
node_tutor -.->|"requests course options"| node_courses_api
node_courses_api -->|"queries courses"| node_prisma_client
node_tutor -.->|"requests session options"| node_session_options_api
node_session_options_api -->|"queries courses"| node_prisma_client
node_tutor -.->|"opens resources"| node_library_page
node_library_page -->|"renders"| node_library_view
node_library_page -->|"loads resource data"| node_prisma_client
node_library_view -->|"requests resource changes"| node_resource_actions
node_resource_actions -->|"updates resources"| node_prisma_client
node_prisma_client -.->|"queries records"| node_database

click node_dashboard "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/page.tsx"
click node_schedule_page "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/schedule/page.tsx"
click node_schedule_view "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/schedule/ScheduleClientView.tsx"
click node_schedule_actions "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/schedule.ts"
click node_new_student_page "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/students/new/page.tsx"
click node_new_student_form "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/students/new/NewStudentForm.tsx"
click node_student_actions "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/student.ts"
click node_student_dossier "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/students/%5Bid%5D/page.tsx"
click node_session_page "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/sessions/new/page.tsx"
click node_session_form "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/sessions/new/SessionForm.tsx"
click node_session_actions "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/session.ts"
click node_presence_button "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/components/CopyPresenceButton.tsx"
click node_courses_api "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/api/courses/route.ts"
click node_session_options_api "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/api/session-options/route.ts"
click node_library_page "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/library/page.tsx"
click node_library_view "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/library/LibraryView.tsx"
click node_resource_actions "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/resource.ts"
click node_auth_actions "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/auth.ts"
click node_login "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/login/page.tsx"
click node_auth_callback "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/auth/callback/route.ts"
click node_supabase_server "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/lib/supabase/server.ts"
click node_prisma_client "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/lib/prisma.ts"
click node_database "https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/prisma/schema.prisma"

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_dashboard,node_schedule_page,node_schedule_view,node_schedule_actions,node_presence_button toneBlue
class node_new_student_page,node_new_student_form,node_student_actions,node_student_dossier,node_session_page,node_session_form,node_session_actions toneAmber
class node_courses_api,node_session_options_api,node_library_page,node_library_view,node_resource_actions toneMint
class node_auth_actions,node_login,node_auth_callback,node_supabase_server,node_prisma_client,node_database toneRose
class node_tutor,node_clipboard,node_supabase_auth toneIndigo
```

## Components

### Tutor Operations

- [Dashboard & Briefing](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Schedule Page](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/schedule/page.tsx): `src/app/schedule/page.tsx`
- [Schedule Calendar](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/schedule/ScheduleClientView.tsx): `src/app/schedule/ScheduleClientView.tsx`
- [Schedule Actions](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/schedule.ts): `src/app/actions/schedule.ts`
- [Presence Clipboard](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/components/CopyPresenceButton.tsx): `src/components/CopyPresenceButton.tsx`

### Learning Records

- [New Student Page](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/students/new/page.tsx): `src/app/students/new/page.tsx`
- [Student Enrollment Form](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/students/new/NewStudentForm.tsx): `src/app/students/new/NewStudentForm.tsx`
- [Student Actions](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/student.ts): `src/app/actions/student.ts`
- [Student Dossier](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/students/%5Bid%5D/page.tsx): `src/app/students/[id]/page.tsx`
- [New Session Page](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/sessions/new/page.tsx): `src/app/sessions/new/page.tsx`
- [Session Log Form](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/sessions/new/SessionForm.tsx): `src/app/sessions/new/SessionForm.tsx`
- [Session Actions](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/session.ts): `src/app/actions/session.ts`

### Curriculum & Resources

- [Course Options API](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/api/courses/route.ts): `src/app/api/courses/route.ts`
- [Session Options API](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/api/session-options/route.ts): `src/app/api/session-options/route.ts`
- [Resource Library Page](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/library/page.tsx): `src/app/library/page.tsx`
- [Resource Library View](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/library/LibraryView.tsx): `src/app/library/LibraryView.tsx`
- [Resource Actions](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/resource.ts): `src/app/actions/resource.ts`

### Identity & Data

- [Auth Actions](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/actions/auth.ts): `src/app/actions/auth.ts`
- [Tutor Login](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Auth Callback](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`
- [Supabase Server Client](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Prisma Client](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- [PostgreSQL Database](https://github.com/hibatullahsyauqi/tutoring-platform/blob/main/prisma/schema.prisma): `prisma/schema.prisma`

### Other components

- **Tutor**
- **System Clipboard**
- **Supabase Auth**

## Connections

- Tutor → Tutor Login: signs in (evidence: `src/app/login/page.tsx`)
- Tutor Login → Supabase Server Client: authenticates with (evidence: `src/app/login/page.tsx`)
- Supabase Server Client → Supabase Auth: creates session client (evidence: `src/lib/supabase/server.ts`)
- Auth Callback → Supabase Server Client: exchanges code (evidence: `src/app/auth/callback/route.ts`)
- Auth Callback → Prisma Client: syncs tutor profile (evidence: `src/app/auth/callback/route.ts`)
- Tutor → Dashboard & Briefing: views briefing (evidence: `README.md`)
- Dashboard & Briefing → Supabase Server Client: checks user (evidence: `src/app/page.tsx`)
- Dashboard & Briefing → Prisma Client: reads tutor data (evidence: `src/app/page.tsx`)
- Dashboard & Briefing → Auth Actions: submits sign-out (evidence: `src/app/page.tsx`)
- Dashboard & Briefing → Student Dossier: opens student (evidence: `src/app/page.tsx`)
- Tutor → Schedule Page: opens schedule (evidence: `README.md`)
- Schedule Page → Schedule Calendar: renders (evidence: `src/app/schedule/page.tsx`)
- Schedule Page → Prisma Client: loads schedule data (evidence: `src/app/schedule/page.tsx`)
- Schedule Calendar → Schedule Actions: schedules or cancels (evidence: `src/app/schedule/ScheduleClientView.tsx`)
- Schedule Actions → Prisma Client: updates sessions (evidence: `src/app/actions/schedule.ts`)
- Tutor → New Student Page: starts enrollment (evidence: `README.md`)
- New Student Page → Student Enrollment Form: renders (evidence: `src/app/students/new/page.tsx`)
- New Student Page → Prisma Client: loads enrollment data (evidence: `src/app/students/new/page.tsx`)
- Student Enrollment Form → Student Actions: submits student (evidence: `src/app/students/new/NewStudentForm.tsx`)
- Student Actions → Prisma Client: persists student (evidence: `src/app/actions/student.ts`)
- Tutor → New Session Page: logs lesson (evidence: `README.md`)
- New Session Page → Session Log Form: renders (evidence: `src/app/sessions/new/page.tsx`)
- New Session Page → Prisma Client: loads session data (evidence: `src/app/sessions/new/page.tsx`)
- Session Log Form → Session Actions: submits session log (evidence: `src/app/sessions/new/SessionForm.tsx`)
- Session Actions → Prisma Client: stores session records (evidence: `src/app/actions/session.ts`)
- Tutor → Student Dossier: reviews continuity (evidence: `README.md`)
- Student Dossier → Prisma Client: reads learning history (evidence: `src/app/students/[id]/page.tsx`)
- Student Dossier → Presence Clipboard: provides row payload (evidence: `src/app/students/[id]/page.tsx`)
- Presence Clipboard → System Clipboard: copies TSV row (evidence: `src/components/CopyPresenceButton.tsx`)
- Student Dossier → Student Actions: offers profile deletion
- Tutor → Course Options API: requests course options
- Course Options API → Prisma Client: queries courses (evidence: `src/app/api/courses/route.ts`)
- Tutor → Session Options API: requests session options
- Session Options API → Prisma Client: queries courses (evidence: `src/app/api/session-options/route.ts`)
- Tutor → Resource Library Page: opens resources
- Resource Library Page → Resource Library View: renders (evidence: `src/app/library/page.tsx`)
- Resource Library Page → Prisma Client: loads resource data (evidence: `src/app/library/page.tsx`)
- Resource Library View → Resource Actions: requests resource changes (evidence: `src/app/library/LibraryView.tsx`)
- Resource Actions → Prisma Client: updates resources (evidence: `src/app/actions/resource.ts`)
- Prisma Client → PostgreSQL Database: queries records
