# sunilkolla/study_grove_web architecture

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

- Interactive diagram: https://gitdiagram.com/sunilkolla/study_grove_web
- Repository: https://github.com/sunilkolla/study_grove_web

## Overview

Studygrove is a GCSE study app whose main workflow is choosing a syllabus topic, practicing questions, and recording progress. It also supports flashcard review, focus sessions with a study grove, task tracking, and profile settings. The sampled services use an in-memory session store and mock data. The graph follows documented page-to-component/service references and sampled calls; several routes and focus UI components are represented only at directory level because their source was not sampled.

Main entry points: [`services/userService.ts`](https://github.com/sunilkolla/study_grove_web/blob/main/services/userService.ts) (User Service), [`components/layout/AppShellClient.tsx`](https://github.com/sunilkolla/study_grove_web/blob/main/components/layout/AppShellClient.tsx) (App Shell), [`app/(study)/dashboard/page.tsx`](https://github.com/sunilkolla/study_grove_web/blob/main/app/(study)/dashboard/page.tsx) (Dashboard Route), [`services/flashcardService.ts`](https://github.com/sunilkolla/study_grove_web/blob/main/services/flashcardService.ts) (Flashcard Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["Study Routes"]
  node_home["Home<br/>[page.tsx]"]
  node_dashboard["Dashboard Route<br/>[page.tsx]"]
  node_quizroute["Quiz Route<br/>[page.tsx]"]
  node_flashroute["Flashcards Route<br/>[page.tsx]"]
  node_focusroute["Focus Route<br/>[page.tsx]"]
  node_otherstudy["Other Study Routes"]
  node_userui["Profile Settings"]
end

subgraph group_practice["Practice &amp; Syllabus"]
  node_practicehub["Practice Hub"]
  node_topicselection["Topic Selection"]
  node_syllabus["GCSE Syllabus<br/>[gcseSyllabus.ts]"]
  node_questionservice["Question Service<br/>[questionService.ts]"]
  node_quizui["Quiz Components"]
end

subgraph group_review["Flashcard Review"]
  node_flashui["Flashcard Hub"]
  node_flashsession["Review Session"]
  node_flashservice["Flashcard Service"]
  node_sm2["SM-2 Scheduling<br/>[sm2.ts]"]
end

subgraph group_focus["Focus &amp; Grove"]
  node_focusui["Focus Hub<br/>[FocusHubClient.tsx]"]
  node_timer["Focus Timer<br/>[useFocusTimer.ts]"]
  node_shell["App Shell<br/>[AppShellClient.tsx]"]
  node_groveservice["Grove Service<br/>[groveService.ts]"]
  node_focusservice["Focus Service<br/>[focusService.ts]"]
end

subgraph group_state["Session State"]
  node_user["User Service<br/>[userService.ts]"]
  node_tasks["Task Service<br/>[taskService.ts]"]
  node_store[("Session Store")]
end

node_student(("Student"))

node_student -->|"opens"| node_home
node_student -->|"studies"| node_dashboard
node_student -->|"reviews cards"| node_flashroute
node_student -->|"starts focus"| node_focusroute
node_student -->|"opens quizzes"| node_quizroute
node_student -.->|"uses"| node_otherstudy
node_dashboard -->|"renders"| node_practicehub
node_dashboard -->|"loads questions"| node_questionservice
node_dashboard -->|"loads stats"| node_user
node_practicehub -->|"selects topics"| node_topicselection
node_practicehub -->|"renders practice"| node_quizui
node_topicselection -->|"reads topics"| node_syllabus
node_quizroute -->|"loads questions"| node_questionservice
node_quizroute -->|"loads stats"| node_user
node_flashroute -->|"renders"| node_flashui
node_flashroute -->|"loads cards"| node_flashservice
node_flashui -->|"opens session"| node_flashsession
node_flashsession -->|"records reviews"| node_flashservice
node_flashservice -->|"schedules review"| node_sm2
node_flashservice -->|"reads and writes"| node_store
node_focusroute -->|"renders"| node_focusui
node_focusui -->|"loads grove"| node_groveservice
node_focusui -->|"uses timer"| node_timer
node_shell -->|"starts timer"| node_timer
node_shell -->|"loads trees"| node_groveservice
node_shell -->|"loads and updates tasks"| node_tasks
node_shell -->|"updates stats"| node_user
node_timer -->|"records focus"| node_focusservice
node_focusservice -->|"records grove tree"| node_groveservice
node_groveservice -->|"reads and writes trees"| node_store
node_tasks -->|"reads and writes tasks"| node_store
node_user -->|"reads and writes stats"| node_store
node_userui -.->|"updates profile"| node_user

click node_home "https://github.com/sunilkolla/study_grove_web/blob/main/app/page.tsx"
click node_dashboard "https://github.com/sunilkolla/study_grove_web/blob/main/app/(study)/dashboard/page.tsx"
click node_quizroute "https://github.com/sunilkolla/study_grove_web/blob/main/app/(study)/quizzes/page.tsx"
click node_flashroute "https://github.com/sunilkolla/study_grove_web/blob/main/app/(study)/flashcards/page.tsx"
click node_focusroute "https://github.com/sunilkolla/study_grove_web/blob/main/app/(study)/focus/page.tsx"
click node_otherstudy "https://github.com/sunilkolla/study_grove_web/tree/main/app/(study)"
click node_practicehub "https://github.com/sunilkolla/study_grove_web/blob/main/components/dashboard/PracticeHubClient.tsx"
click node_topicselection "https://github.com/sunilkolla/study_grove_web/blob/main/hooks/useStudyTopicSelection.ts"
click node_syllabus "https://github.com/sunilkolla/study_grove_web/blob/main/data/gcseSyllabus.ts"
click node_questionservice "https://github.com/sunilkolla/study_grove_web/blob/main/services/questionService.ts"
click node_quizui "https://github.com/sunilkolla/study_grove_web/tree/main/components/quiz"
click node_userui "https://github.com/sunilkolla/study_grove_web/blob/main/components/profile/ProfileSettingsClient.tsx"
click node_flashui "https://github.com/sunilkolla/study_grove_web/blob/main/components/flashcards/FlashcardsHubClient.tsx"
click node_flashsession "https://github.com/sunilkolla/study_grove_web/blob/main/components/flashcards/FlashcardSessionModal.tsx"
click node_flashservice "https://github.com/sunilkolla/study_grove_web/blob/main/services/flashcardService.ts"
click node_sm2 "https://github.com/sunilkolla/study_grove_web/blob/main/lib/sm2.ts"
click node_focusui "https://github.com/sunilkolla/study_grove_web/blob/main/components/focus/FocusHubClient.tsx"
click node_timer "https://github.com/sunilkolla/study_grove_web/blob/main/components/focus/useFocusTimer.ts"
click node_shell "https://github.com/sunilkolla/study_grove_web/blob/main/components/layout/AppShellClient.tsx"
click node_groveservice "https://github.com/sunilkolla/study_grove_web/blob/main/services/groveService.ts"
click node_focusservice "https://github.com/sunilkolla/study_grove_web/blob/main/services/focusService.ts"
click node_user "https://github.com/sunilkolla/study_grove_web/blob/main/services/userService.ts"
click node_tasks "https://github.com/sunilkolla/study_grove_web/blob/main/services/taskService.ts"
click node_store "https://github.com/sunilkolla/study_grove_web/blob/main/services/mockSessionStore.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_home,node_dashboard,node_quizroute,node_flashroute,node_focusroute,node_otherstudy,node_userui toneBlue
class node_practicehub,node_topicselection,node_syllabus,node_questionservice,node_quizui toneAmber
class node_flashui,node_flashsession,node_flashservice,node_sm2 toneMint
class node_focusui,node_timer,node_shell,node_groveservice,node_focusservice toneRose
class node_user,node_tasks,node_store,node_student toneIndigo
```

## Components

### Study Routes

- [Home](https://github.com/sunilkolla/study_grove_web/blob/main/app/page.tsx): `app/page.tsx`
- [Dashboard Route](https://github.com/sunilkolla/study_grove_web/blob/main/app/(study)/dashboard/page.tsx): `app/(study)/dashboard/page.tsx`
- [Quiz Route](https://github.com/sunilkolla/study_grove_web/blob/main/app/(study)/quizzes/page.tsx): `app/(study)/quizzes/page.tsx`
- [Flashcards Route](https://github.com/sunilkolla/study_grove_web/blob/main/app/(study)/flashcards/page.tsx): `app/(study)/flashcards/page.tsx`
- [Focus Route](https://github.com/sunilkolla/study_grove_web/blob/main/app/(study)/focus/page.tsx): `app/(study)/focus/page.tsx`
- [Other Study Routes](https://github.com/sunilkolla/study_grove_web/tree/main/app/(study)): `app/(study)`
- [Profile Settings](https://github.com/sunilkolla/study_grove_web/blob/main/components/profile/ProfileSettingsClient.tsx): `components/profile/ProfileSettingsClient.tsx`

### Practice & Syllabus

- [Practice Hub](https://github.com/sunilkolla/study_grove_web/blob/main/components/dashboard/PracticeHubClient.tsx): `components/dashboard/PracticeHubClient.tsx`
- [Topic Selection](https://github.com/sunilkolla/study_grove_web/blob/main/hooks/useStudyTopicSelection.ts): `hooks/useStudyTopicSelection.ts`
- [GCSE Syllabus](https://github.com/sunilkolla/study_grove_web/blob/main/data/gcseSyllabus.ts): `data/gcseSyllabus.ts`
- [Question Service](https://github.com/sunilkolla/study_grove_web/blob/main/services/questionService.ts): `services/questionService.ts`
- [Quiz Components](https://github.com/sunilkolla/study_grove_web/tree/main/components/quiz): `components/quiz`

### Flashcard Review

- [Flashcard Hub](https://github.com/sunilkolla/study_grove_web/blob/main/components/flashcards/FlashcardsHubClient.tsx): `components/flashcards/FlashcardsHubClient.tsx`
- [Review Session](https://github.com/sunilkolla/study_grove_web/blob/main/components/flashcards/FlashcardSessionModal.tsx): `components/flashcards/FlashcardSessionModal.tsx`
- [Flashcard Service](https://github.com/sunilkolla/study_grove_web/blob/main/services/flashcardService.ts): `services/flashcardService.ts`
- [SM-2 Scheduling](https://github.com/sunilkolla/study_grove_web/blob/main/lib/sm2.ts): `lib/sm2.ts`

### Focus & Grove

- [Focus Hub](https://github.com/sunilkolla/study_grove_web/blob/main/components/focus/FocusHubClient.tsx): `components/focus/FocusHubClient.tsx`
- [Focus Timer](https://github.com/sunilkolla/study_grove_web/blob/main/components/focus/useFocusTimer.ts): `components/focus/useFocusTimer.ts`
- [App Shell](https://github.com/sunilkolla/study_grove_web/blob/main/components/layout/AppShellClient.tsx): `components/layout/AppShellClient.tsx`
- [Grove Service](https://github.com/sunilkolla/study_grove_web/blob/main/services/groveService.ts): `services/groveService.ts`
- [Focus Service](https://github.com/sunilkolla/study_grove_web/blob/main/services/focusService.ts): `services/focusService.ts`

### Session State

- [User Service](https://github.com/sunilkolla/study_grove_web/blob/main/services/userService.ts): `services/userService.ts`
- [Task Service](https://github.com/sunilkolla/study_grove_web/blob/main/services/taskService.ts): `services/taskService.ts`
- [Session Store](https://github.com/sunilkolla/study_grove_web/blob/main/services/mockSessionStore.ts): `services/mockSessionStore.ts`

### Other components

- **Student**

## Connections

- Student → Home: opens (evidence: `app/page.tsx`)
- Student → Dashboard Route: studies (evidence: `app/(study)/dashboard/page.tsx`)
- Student → Flashcards Route: reviews cards (evidence: `app/(study)/flashcards/page.tsx`)
- Student → Focus Route: starts focus (evidence: `app/(study)/focus/page.tsx`)
- Student → Quiz Route: opens quizzes (evidence: `app/(study)/quizzes/page.tsx`)
- Student → Other Study Routes: uses
- Dashboard Route → Practice Hub: renders (evidence: `app/(study)/dashboard/page.tsx`)
- Dashboard Route → Question Service: loads questions (evidence: `app/(study)/dashboard/page.tsx`)
- Dashboard Route → User Service: loads stats (evidence: `app/(study)/dashboard/page.tsx`)
- Practice Hub → Topic Selection: selects topics (evidence: `components/dashboard/PracticeHubClient.tsx`)
- Practice Hub → Quiz Components: renders practice (evidence: `components/dashboard/PracticeHubClient.tsx`)
- Topic Selection → GCSE Syllabus: reads topics (evidence: `hooks/useStudyTopicSelection.ts`)
- Quiz Route → Question Service: loads questions (evidence: `app/(study)/quizzes/page.tsx`)
- Quiz Route → User Service: loads stats (evidence: `app/(study)/quizzes/page.tsx`)
- Flashcards Route → Flashcard Hub: renders (evidence: `app/(study)/flashcards/page.tsx`)
- Flashcards Route → Flashcard Service: loads cards (evidence: `app/(study)/flashcards/page.tsx`)
- Flashcard Hub → Review Session: opens session (evidence: `components/flashcards/FlashcardsHubClient.tsx`)
- Review Session → Flashcard Service: records reviews (evidence: `components/flashcards/FlashcardSessionModal.tsx`)
- Flashcard Service → SM-2 Scheduling: schedules review (evidence: `services/flashcardService.ts`)
- Flashcard Service → Session Store: reads and writes (evidence: `services/flashcardService.ts`)
- Focus Route → Focus Hub: renders (evidence: `app/(study)/focus/page.tsx`)
- Focus Hub → Grove Service: loads grove (evidence: `components/focus/FocusHubClient.tsx`)
- Focus Hub → Focus Timer: uses timer (evidence: `components/focus/FocusHubClient.tsx`)
- App Shell → Focus Timer: starts timer (evidence: `components/layout/AppShellClient.tsx`)
- App Shell → Grove Service: loads trees (evidence: `components/layout/AppShellClient.tsx`)
- App Shell → Task Service: loads and updates tasks (evidence: `components/layout/AppShellClient.tsx`)
- App Shell → User Service: updates stats (evidence: `components/layout/AppShellClient.tsx`)
- Focus Timer → Focus Service: records focus (evidence: `components/focus/useFocusTimer.ts`)
- Focus Service → Grove Service: records grove tree (evidence: `services/focusService.ts`)
- Grove Service → Session Store: reads and writes trees (evidence: `services/groveService.ts`)
- Task Service → Session Store: reads and writes tasks (evidence: `services/taskService.ts`)
- User Service → Session Store: reads and writes stats (evidence: `services/userService.ts`)
- Profile Settings → User Service: updates profile (evidence: `components/profile/ProfileSettingsClient.tsx`)
