# afri-tah/studysphere-website architecture

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

- Interactive diagram: https://gitdiagram.com/afri-tah/studysphere-website
- Repository: https://github.com/afri-tah/studysphere-website

## Overview

StudySphere is a student-facing learning website with course discovery and a broad collection of study utilities, including AI tutoring and note generation. The visible home-page script filters courses and opens WhatsApp enrollment; the AI Worker accepts chat requests and tries configured providers in sequence. The tree identifies many additional tools, but their source was not sampled, so their internal behavior and wiring are not asserted. The repository also contains three copies of the Worker; their relationship is unclear.

Main entry points: [`ai-proxy/worker.js`](https://github.com/afri-tah/studysphere-website/blob/main/ai-proxy/worker.js) (AI Proxy), [`studysphere-ai-update/ai-proxy/worker.js`](https://github.com/afri-tah/studysphere-website/blob/main/studysphere-ai-update/ai-proxy/worker.js) (AI Proxy Copy), [`studysphere-ai-update (1)/ai-proxy/worker.js`](https://github.com/afri-tah/studysphere-website/blob/main/studysphere-ai-update%20(1)/ai-proxy/worker.js) (AI Proxy Copy), [`script.js`](https://github.com/afri-tah/studysphere-website/blob/main/script.js) (Course Discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Website"]
  node_course_discovery["Course Discovery<br/>[script.js]"]
  node_course_enrollment["WhatsApp Enrollment<br/>[script.js]"]
end

subgraph group_tools["Study Tools"]
  node_tool_catalog["Tool Catalog<br/>[index.html]"]
  node_ai_tutor["AI Tutor<br/>[ai-tutor.js]"]
  node_question["Ask Question<br/>[ask-a-question.js]"]
  node_notes["Notes Generator<br/>[notes-generator.js]"]
  node_generators["Study Generators<br/>[generators.js]"]
  node_attendance["Attendance Tracker"]
  node_countdown["Exam Countdown<br/>[exam-countdown.js]"]
  node_grades["Grade Calculator"]
  node_papers["Past Papers<br/>[past-papers.js]"]
  node_pomodoro["Pomodoro Timer<br/>[pomodoro-timer.js]"]
  node_progress["Progress Report<br/>[progress-report.js]"]
  node_quick_notes["Quick Notes<br/>[quick-notes.js]"]
  node_resources["Resources Hub<br/>[resources-hub.js]"]
  node_wheel["Spin Wheel<br/>[spin-the-wheel.js]"]
  node_student_apps["Student Apps<br/>[student-apps.js]"]
  node_study_tracker["Study Tracker<br/>[study-tracker.js]"]
  node_timetable["Timetable Builder"]
  node_planner["Weekly Planner<br/>[weekly-planner.js]"]
  node_shared_tools["Shared Tool Helpers<br/>[tools-common.js]"]
end

subgraph group_ai["AI Service"]
  node_proxy["AI Proxy<br/>[worker.js]"]
  node_proxy_update["AI Proxy Copy<br/>[worker.js]"]
  node_proxy_update_copy["AI Proxy Copy<br/>[worker.js]"]
  node_providers{{"AI Providers"}}
end

node_student(("Student"))

node_student -->|"filters courses"| node_course_discovery
node_student -->|"requests enrollment"| node_course_enrollment
node_proxy -->|"tries providers"| node_providers
node_proxy_update -->|"tries providers"| node_providers
node_proxy_update_copy -->|"tries providers"| node_providers

click node_course_discovery "https://github.com/afri-tah/studysphere-website/blob/main/script.js"
click node_course_enrollment "https://github.com/afri-tah/studysphere-website/blob/main/script.js"
click node_tool_catalog "https://github.com/afri-tah/studysphere-website/blob/main/tools/index.html"
click node_ai_tutor "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/ai-tutor.js"
click node_question "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/ask-a-question.js"
click node_notes "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/notes-generator.js"
click node_generators "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/generators.js"
click node_attendance "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/attendance-tracker.js"
click node_countdown "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/exam-countdown.js"
click node_grades "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/grade-calculator.js"
click node_papers "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/past-papers.js"
click node_pomodoro "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/pomodoro-timer.js"
click node_progress "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/progress-report.js"
click node_quick_notes "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/quick-notes.js"
click node_resources "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/resources-hub.js"
click node_wheel "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/spin-the-wheel.js"
click node_student_apps "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/student-apps.js"
click node_study_tracker "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/study-tracker.js"
click node_timetable "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/timetable-builder.js"
click node_planner "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/weekly-planner.js"
click node_shared_tools "https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/tools-common.js"
click node_proxy "https://github.com/afri-tah/studysphere-website/blob/main/ai-proxy/worker.js"
click node_proxy_update "https://github.com/afri-tah/studysphere-website/blob/main/studysphere-ai-update/ai-proxy/worker.js"
click node_proxy_update_copy "https://github.com/afri-tah/studysphere-website/blob/main/studysphere-ai-update%20(1)/ai-proxy/worker.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_course_discovery,node_course_enrollment toneBlue
class node_tool_catalog,node_ai_tutor,node_question,node_notes,node_generators,node_attendance,node_countdown,node_grades,node_papers,node_pomodoro,node_progress,node_quick_notes,node_resources,node_wheel,node_student_apps,node_study_tracker,node_timetable,node_planner,node_shared_tools toneAmber
class node_proxy,node_proxy_update,node_proxy_update_copy,node_providers toneMint
class node_student toneIndigo
```

## Components

### Website

- [Course Discovery](https://github.com/afri-tah/studysphere-website/blob/main/script.js): `script.js`
- [WhatsApp Enrollment](https://github.com/afri-tah/studysphere-website/blob/main/script.js): `script.js`

### Study Tools

- [Tool Catalog](https://github.com/afri-tah/studysphere-website/blob/main/tools/index.html): `tools/index.html`
- [AI Tutor](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/ai-tutor.js): `tools/assets/js/ai-tutor.js`
- [Ask Question](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/ask-a-question.js): `tools/assets/js/ask-a-question.js`
- [Notes Generator](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/notes-generator.js): `tools/assets/js/notes-generator.js`
- [Study Generators](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/generators.js): `tools/assets/js/generators.js`
- [Attendance Tracker](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/attendance-tracker.js): `tools/assets/js/attendance-tracker.js`
- [Exam Countdown](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/exam-countdown.js): `tools/assets/js/exam-countdown.js`
- [Grade Calculator](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/grade-calculator.js): `tools/assets/js/grade-calculator.js`
- [Past Papers](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/past-papers.js): `tools/assets/js/past-papers.js`
- [Pomodoro Timer](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/pomodoro-timer.js): `tools/assets/js/pomodoro-timer.js`
- [Progress Report](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/progress-report.js): `tools/assets/js/progress-report.js`
- [Quick Notes](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/quick-notes.js): `tools/assets/js/quick-notes.js`
- [Resources Hub](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/resources-hub.js): `tools/assets/js/resources-hub.js`
- [Spin Wheel](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/spin-the-wheel.js): `tools/assets/js/spin-the-wheel.js`
- [Student Apps](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/student-apps.js): `tools/assets/js/student-apps.js`
- [Study Tracker](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/study-tracker.js): `tools/assets/js/study-tracker.js`
- [Timetable Builder](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/timetable-builder.js): `tools/assets/js/timetable-builder.js`
- [Weekly Planner](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/js/weekly-planner.js): `tools/assets/js/weekly-planner.js`
- [Shared Tool Helpers](https://github.com/afri-tah/studysphere-website/blob/main/tools/assets/tools-common.js): `tools/assets/tools-common.js`

### AI Service

- [AI Proxy](https://github.com/afri-tah/studysphere-website/blob/main/ai-proxy/worker.js): `ai-proxy/worker.js`
- [AI Proxy Copy](https://github.com/afri-tah/studysphere-website/blob/main/studysphere-ai-update/ai-proxy/worker.js): `studysphere-ai-update/ai-proxy/worker.js`
- [AI Proxy Copy](https://github.com/afri-tah/studysphere-website/blob/main/studysphere-ai-update%20(1)/ai-proxy/worker.js): `studysphere-ai-update (1)/ai-proxy/worker.js`
- **AI Providers**

### Other components

- **Student**

## Connections

- Student → Course Discovery: filters courses (evidence: `script.js`)
- Student → WhatsApp Enrollment: requests enrollment (evidence: `script.js`)
- AI Proxy → AI Providers: tries providers (evidence: `ai-proxy/worker.js`)
- AI Proxy Copy → AI Providers: tries providers (evidence: `studysphere-ai-update/ai-proxy/worker.js`)
- AI Proxy Copy → AI Providers: tries providers (evidence: `studysphere-ai-update (1)/ai-proxy/worker.js`)
