# energizee/gdgstudyapp architecture

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

- Interactive diagram: https://gitdiagram.com/energizee/gdgstudyapp
- Repository: https://github.com/energizee/gdgstudyapp

## Overview

Momentum is a learner study-planning app: learners enter courses and assessments, review a study plan, work through focus sessions, and track progress. Its UI also supports syllabus scanning, work marking, adapting schedules, unblocking study, and learner profiling. The sampled code shows a shared Gemma API route dispatching model tasks, with prompts, tools, caching, and model-call helpers behind it. Relationships for unsampled feature implementations are included only where the source index or route excerpts show them; the README is empty.

Main entry points: [`lib/store.ts`](https://github.com/energizee/gdgstudyapp/blob/main/lib/store.ts) (Learner state), [`lib/api.ts`](https://github.com/energizee/gdgstudyapp/blob/main/lib/api.ts) (Gemma client), [`components/FocusSession.tsx`](https://github.com/energizee/gdgstudyapp/blob/main/components/FocusSession.tsx) (Focus session), [`app/api/gemma/route.ts`](https://github.com/energizee/gdgstudyapp/blob/main/app/api/gemma/route.ts) (Task dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learner experience"]
  node_shell["App shell<br/>[AppShell.tsx]"]
  node_onboarding["Course setup<br/>[Onboarding.tsx]"]
  node_home["Study dashboard<br/>[Home.tsx]"]
  node_courses["Course views<br/>[CoursesView.tsx]"]
  node_course_detail["Course detail<br/>[CourseDetail.tsx]"]
  node_plans["Plan views<br/>[PlansView.tsx]"]
  node_plan_detail["Plan detail<br/>[PlanDetail.tsx]"]
  node_profile["Learner profile<br/>[ProfileView.tsx]"]
end

subgraph group_study["Study workflows"]
  node_session["Focus session<br/>[FocusSession.tsx]"]
  node_syllabus["Syllabus scan<br/>[SyllabusScan.tsx]"]
  node_work_scan["Work marking<br/>[WorkScan.tsx]"]
  node_unblock["Study unblock<br/>[Unblock.tsx]"]
  node_adapt["Schedule adaptation<br/>[AdaptPanel.tsx]"]
end

subgraph group_ai["AI services"]
  node_client_api["Gemma client<br/>[api.ts]"]
  node_api_route["Task dispatcher<br/>[route.ts]"]
  node_prompts["Task prompts<br/>[prompts.ts]"]
  node_tools["Schedule tools<br/>[tools.ts]"]
  node_model["Gemma calls<br/>[gemma.ts]"]
  node_cache["Response cache<br/>[cache.ts]"]
end

subgraph group_core["State and domain"]
  node_store[("Learner state<br/>[store.ts]")]
  node_grades["Grade calculations<br/>[grades.ts]"]
  node_seed["Starter state<br/>[seed.ts]"]
end

node_learner(("Learner"))

node_learner -->|"sets up courses"| node_onboarding
node_learner -->|"reviews progress"| node_home
node_learner -->|"browses courses"| node_courses
node_learner -->|"reviews plans"| node_plans
node_learner -->|"checks profile"| node_profile
node_learner -->|"studies"| node_session
node_shell -->|"shows setup"| node_onboarding
node_shell -->|"reads state"| node_store
node_courses -->|"opens course"| node_course_detail
node_plans -->|"opens plan"| node_plan_detail
node_session -->|"opens blocker help"| node_unblock
node_session -->|"uses work scan"| node_work_scan
node_onboarding -->|"offers scanning"| node_syllabus
node_plans -->|"offers scanning"| node_syllabus
node_onboarding -->|"updates state"| node_store
node_home -->|"reads state"| node_store
node_profile -->|"reads state"| node_store
node_session -->|"updates state"| node_store
node_session -->|"requests tasks"| node_client_api
node_syllabus -->|"requests extraction"| node_client_api
node_work_scan -->|"requests marking"| node_client_api
node_unblock -->|"requests help"| node_client_api
node_adapt -->|"requests adaptation"| node_client_api
node_client_api -->|"posts tasks"| node_api_route
node_api_route -->|"calls model"| node_model
node_api_route -->|"builds task prompts"| node_prompts
node_api_route -->|"dispatches schedule tools"| node_tools
node_api_route -->|"reads and writes cache"| node_cache
node_store -->|"requests triage"| node_client_api
node_store -->|"initializes state"| node_seed
node_store -->|"uses date logic"| node_grades
node_home -->|"calculates metrics"| node_grades
node_profile -->|"calculates metrics"| node_grades

click node_shell "https://github.com/energizee/gdgstudyapp/blob/main/components/AppShell.tsx"
click node_onboarding "https://github.com/energizee/gdgstudyapp/blob/main/components/Onboarding.tsx"
click node_home "https://github.com/energizee/gdgstudyapp/blob/main/components/Home.tsx"
click node_courses "https://github.com/energizee/gdgstudyapp/blob/main/components/CoursesView.tsx"
click node_course_detail "https://github.com/energizee/gdgstudyapp/blob/main/components/CourseDetail.tsx"
click node_plans "https://github.com/energizee/gdgstudyapp/blob/main/components/PlansView.tsx"
click node_plan_detail "https://github.com/energizee/gdgstudyapp/blob/main/components/PlanDetail.tsx"
click node_profile "https://github.com/energizee/gdgstudyapp/blob/main/components/ProfileView.tsx"
click node_session "https://github.com/energizee/gdgstudyapp/blob/main/components/FocusSession.tsx"
click node_syllabus "https://github.com/energizee/gdgstudyapp/blob/main/components/SyllabusScan.tsx"
click node_work_scan "https://github.com/energizee/gdgstudyapp/blob/main/components/WorkScan.tsx"
click node_unblock "https://github.com/energizee/gdgstudyapp/blob/main/components/Unblock.tsx"
click node_adapt "https://github.com/energizee/gdgstudyapp/blob/main/components/AdaptPanel.tsx"
click node_client_api "https://github.com/energizee/gdgstudyapp/blob/main/lib/api.ts"
click node_api_route "https://github.com/energizee/gdgstudyapp/blob/main/app/api/gemma/route.ts"
click node_prompts "https://github.com/energizee/gdgstudyapp/blob/main/lib/prompts.ts"
click node_tools "https://github.com/energizee/gdgstudyapp/blob/main/lib/tools.ts"
click node_model "https://github.com/energizee/gdgstudyapp/blob/main/lib/gemma.ts"
click node_cache "https://github.com/energizee/gdgstudyapp/blob/main/lib/cache.ts"
click node_store "https://github.com/energizee/gdgstudyapp/blob/main/lib/store.ts"
click node_grades "https://github.com/energizee/gdgstudyapp/blob/main/lib/grades.ts"
click node_seed "https://github.com/energizee/gdgstudyapp/blob/main/lib/seed.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_shell,node_onboarding,node_home,node_courses,node_course_detail,node_plans,node_plan_detail,node_profile toneBlue
class node_session,node_syllabus,node_work_scan,node_unblock,node_adapt toneAmber
class node_client_api,node_api_route,node_prompts,node_tools,node_model,node_cache toneMint
class node_store,node_grades,node_seed toneRose
class node_learner toneIndigo
```

## Components

### Learner experience

- [App shell](https://github.com/energizee/gdgstudyapp/blob/main/components/AppShell.tsx): `components/AppShell.tsx`
- [Course setup](https://github.com/energizee/gdgstudyapp/blob/main/components/Onboarding.tsx): `components/Onboarding.tsx`
- [Study dashboard](https://github.com/energizee/gdgstudyapp/blob/main/components/Home.tsx): `components/Home.tsx`
- [Course views](https://github.com/energizee/gdgstudyapp/blob/main/components/CoursesView.tsx): `components/CoursesView.tsx`
- [Course detail](https://github.com/energizee/gdgstudyapp/blob/main/components/CourseDetail.tsx): `components/CourseDetail.tsx`
- [Plan views](https://github.com/energizee/gdgstudyapp/blob/main/components/PlansView.tsx): `components/PlansView.tsx`
- [Plan detail](https://github.com/energizee/gdgstudyapp/blob/main/components/PlanDetail.tsx): `components/PlanDetail.tsx`
- [Learner profile](https://github.com/energizee/gdgstudyapp/blob/main/components/ProfileView.tsx): `components/ProfileView.tsx`

### Study workflows

- [Focus session](https://github.com/energizee/gdgstudyapp/blob/main/components/FocusSession.tsx): `components/FocusSession.tsx`
- [Syllabus scan](https://github.com/energizee/gdgstudyapp/blob/main/components/SyllabusScan.tsx): `components/SyllabusScan.tsx`
- [Work marking](https://github.com/energizee/gdgstudyapp/blob/main/components/WorkScan.tsx): `components/WorkScan.tsx`
- [Study unblock](https://github.com/energizee/gdgstudyapp/blob/main/components/Unblock.tsx): `components/Unblock.tsx`
- [Schedule adaptation](https://github.com/energizee/gdgstudyapp/blob/main/components/AdaptPanel.tsx): `components/AdaptPanel.tsx`

### AI services

- [Gemma client](https://github.com/energizee/gdgstudyapp/blob/main/lib/api.ts): `lib/api.ts`
- [Task dispatcher](https://github.com/energizee/gdgstudyapp/blob/main/app/api/gemma/route.ts): `app/api/gemma/route.ts`
- [Task prompts](https://github.com/energizee/gdgstudyapp/blob/main/lib/prompts.ts): `lib/prompts.ts`
- [Schedule tools](https://github.com/energizee/gdgstudyapp/blob/main/lib/tools.ts): `lib/tools.ts`
- [Gemma calls](https://github.com/energizee/gdgstudyapp/blob/main/lib/gemma.ts): `lib/gemma.ts`
- [Response cache](https://github.com/energizee/gdgstudyapp/blob/main/lib/cache.ts): `lib/cache.ts`

### State and domain

- [Learner state](https://github.com/energizee/gdgstudyapp/blob/main/lib/store.ts): `lib/store.ts`
- [Grade calculations](https://github.com/energizee/gdgstudyapp/blob/main/lib/grades.ts): `lib/grades.ts`
- [Starter state](https://github.com/energizee/gdgstudyapp/blob/main/lib/seed.ts): `lib/seed.ts`

### Other components

- **Learner**

## Connections

- Learner → Course setup: sets up courses
- Learner → Study dashboard: reviews progress
- Learner → Course views: browses courses
- Learner → Plan views: reviews plans
- Learner → Learner profile: checks profile
- Learner → Focus session: studies
- App shell → Course setup: shows setup (evidence: `app/(shell)/layout.tsx`)
- App shell → Learner state: reads state (evidence: `app/(shell)/layout.tsx`)
- Course views → Course detail: opens course
- Plan views → Plan detail: opens plan
- Focus session → Study unblock: opens blocker help (evidence: `components/FocusSession.tsx`)
- Focus session → Work marking: uses work scan (evidence: `components/FocusSession.tsx`)
- Course setup → Syllabus scan: offers scanning (evidence: `components/Onboarding.tsx`)
- Plan views → Syllabus scan: offers scanning (evidence: `components/PlansView.tsx`)
- Course setup → Learner state: updates state (evidence: `components/Onboarding.tsx`)
- Study dashboard → Learner state: reads state (evidence: `components/Home.tsx`)
- Learner profile → Learner state: reads state (evidence: `components/ProfileView.tsx`)
- Focus session → Learner state: updates state (evidence: `app/session/[id]/page.tsx`)
- Focus session → Gemma client: requests tasks (evidence: `components/FocusSession.tsx`)
- Syllabus scan → Gemma client: requests extraction (evidence: `components/SyllabusScan.tsx`)
- Work marking → Gemma client: requests marking (evidence: `components/WorkScan.tsx`)
- Study unblock → Gemma client: requests help (evidence: `components/Unblock.tsx`)
- Schedule adaptation → Gemma client: requests adaptation (evidence: `components/AdaptPanel.tsx`)
- Gemma client → Task dispatcher: posts tasks (evidence: `lib/api.ts`)
- Task dispatcher → Gemma calls: calls model (evidence: `app/api/gemma/route.ts`)
- Task dispatcher → Task prompts: builds task prompts (evidence: `app/api/gemma/route.ts`)
- Task dispatcher → Schedule tools: dispatches schedule tools (evidence: `app/api/gemma/route.ts`)
- Task dispatcher → Response cache: reads and writes cache (evidence: `app/api/gemma/route.ts`)
- Learner state → Gemma client: requests triage (evidence: `lib/store.ts`)
- Learner state → Starter state: initializes state (evidence: `lib/store.ts`)
- Learner state → Grade calculations: uses date logic (evidence: `lib/store.ts`)
- Study dashboard → Grade calculations: calculates metrics (evidence: `components/Home.tsx`)
- Learner profile → Grade calculations: calculates metrics (evidence: `components/ProfileView.tsx`)
