# thandupsherpa/study-notes-extension architecture

> Architecture diagram of the GitHub repository thandupsherpa/study-notes-extension, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thandupsherpa/study-notes-extension
- Repository: https://github.com/thandupsherpa/study-notes-extension

## Overview

Digiicampus Study Assistant is a Chrome extension that turns course material into downloadable study-note PDFs. A student opens the popup, selects a semester, course, and module, then starts generation. The workflow collects portal content through the real or mock adapter, requests structured notes from the AI backend, formats them as a PDF, and downloads the result. The popup also supports search, settings, status, and note preview. The README documents the backend and product capabilities; unsampled implementation details are not inferred beyond those documented relationships.

Main entry points: [`src/popup/App.tsx`](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/App.tsx) (Popup workflow), [`src/services/notesService.ts`](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/notesService.ts) (Notes workflow), [`src/services/digiicampus/realAdapter.ts`](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/digiicampus/realAdapter.ts) (Live portal adapter), [`src/storage/storageService.ts`](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/storage/storageService.ts) (Storage service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_popup["Extension popup"]
  node_popup_app["Popup workflow<br/>[App.tsx]"]
  node_course_view["Course browser"]
  node_module_view["Module rows<br/>[ModuleRow.tsx]"]
  node_controls["Term and search<br/>[TopControls.tsx]"]
  node_settings["Settings<br/>[SettingsModal.tsx]"]
  node_progress["Generation progress<br/>[ProgressSheet.tsx]"]
  node_preview["Notes preview"]
  node_status["Session status<br/>[StatusBanner.tsx]"]
  node_i18n["Translations<br/>[i18n.ts]"]
end

subgraph group_portal["Portal access"]
  node_portal["Digiicampus portal"]
  node_real_adapter["Live portal adapter<br/>[realAdapter.ts]"]
  node_mock_adapter["Mock adapter<br/>[mockAdapter.ts]"]
  node_content_script["Portal content script"]
  node_dom_parser["DOM and syllabus parser<br/>[domParser.ts]"]
end

subgraph group_generation["Note generation"]
  node_notes_service["Notes workflow<br/>[notesService.ts]"]
  node_api_client["AI API client<br/>[api.ts]"]
  node_backend["Express AI backend<br/>[server.js]"]
  node_pdf["PDF formatter<br/>[pdfGenerator.ts]"]
end

subgraph group_platform["Extension platform"]
  node_storage_service["Storage service<br/>[storageService.ts]"]
end

node_student(("Student"))
node_gemini["Gemini AI"]
node_chrome_storage[("Chrome local storage")]
node_browser_download["Browser downloads"]

node_student -->|"opens"| node_popup_app
node_popup_app -->|"renders"| node_course_view
node_popup_app -->|"renders"| node_controls
node_popup_app -->|"renders"| node_settings
node_popup_app -->|"renders"| node_progress
node_popup_app -->|"renders"| node_preview
node_popup_app -->|"renders"| node_status
node_course_view -->|"renders"| node_module_view
node_popup_app -->|"starts generation"| node_notes_service
node_notes_service -->|"selects live adapter"| node_real_adapter
node_notes_service -->|"selects mock adapter"| node_mock_adapter
node_real_adapter -->|"queries session content"| node_portal
node_real_adapter -->|"messages tab"| node_content_script
node_content_script -->|"uses parser"| node_dom_parser
node_dom_parser -->|"reads page DOM"| node_portal
node_notes_service -->|"requests notes"| node_api_client
node_api_client -->|"sends generation request"| node_backend
node_backend -->|"generates structured notes"| node_gemini
node_notes_service -->|"formats notes"| node_pdf
node_notes_service -->|"downloads PDF"| node_browser_download
node_popup_app -->|"saves settings"| node_storage_service
node_notes_service -->|"reads settings"| node_storage_service
node_storage_service -->|"reads and writes"| node_chrome_storage
node_popup_app -.->|"uses translations"| node_i18n

click node_popup_app "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/App.tsx"
click node_course_view "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/CourseAccordion.tsx"
click node_module_view "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/ModuleRow.tsx"
click node_controls "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/TopControls.tsx"
click node_settings "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/SettingsModal.tsx"
click node_progress "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/ProgressSheet.tsx"
click node_preview "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/NotesPreviewModal.tsx"
click node_status "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/StatusBanner.tsx"
click node_i18n "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/utils/i18n.ts"
click node_real_adapter "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/digiicampus/realAdapter.ts"
click node_mock_adapter "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/digiicampus/mockAdapter.ts"
click node_content_script "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/content/digiiContentScript.ts"
click node_dom_parser "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/content/parsers/domParser.ts"
click node_notes_service "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/notesService.ts"
click node_api_client "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/api.ts"
click node_backend "https://github.com/thandupsherpa/study-notes-extension/blob/main/backend/server.js"
click node_pdf "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/pdf/pdfGenerator.ts"
click node_storage_service "https://github.com/thandupsherpa/study-notes-extension/blob/main/src/storage/storageService.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_popup_app,node_course_view,node_module_view,node_controls,node_settings,node_progress,node_preview,node_status,node_i18n,node_browser_download toneBlue
class node_portal,node_real_adapter,node_mock_adapter,node_content_script,node_dom_parser,node_chrome_storage toneAmber
class node_notes_service,node_api_client,node_backend,node_pdf toneMint
class node_storage_service toneRose
class node_student,node_gemini toneIndigo
```

## Components

### Extension popup

- [Popup workflow](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/App.tsx): `src/popup/App.tsx`
- [Course browser](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/CourseAccordion.tsx): `src/popup/components/CourseAccordion.tsx`
- [Module rows](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/ModuleRow.tsx): `src/popup/components/ModuleRow.tsx`
- [Term and search](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/TopControls.tsx): `src/popup/components/TopControls.tsx`
- [Settings](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/SettingsModal.tsx): `src/popup/components/SettingsModal.tsx`
- [Generation progress](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/ProgressSheet.tsx): `src/popup/components/ProgressSheet.tsx`
- [Notes preview](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/NotesPreviewModal.tsx): `src/popup/components/NotesPreviewModal.tsx`
- [Session status](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/popup/components/StatusBanner.tsx): `src/popup/components/StatusBanner.tsx`
- [Translations](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/utils/i18n.ts): `src/utils/i18n.ts`

### Portal access

- **Digiicampus portal**
- [Live portal adapter](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/digiicampus/realAdapter.ts): `src/services/digiicampus/realAdapter.ts`
- [Mock adapter](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/digiicampus/mockAdapter.ts): `src/services/digiicampus/mockAdapter.ts`
- [Portal content script](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/content/digiiContentScript.ts): `src/content/digiiContentScript.ts`
- [DOM and syllabus parser](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/content/parsers/domParser.ts): `src/content/parsers/domParser.ts`

### Note generation

- [Notes workflow](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/notesService.ts): `src/services/notesService.ts`
- [AI API client](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/services/api.ts): `src/services/api.ts`
- [Express AI backend](https://github.com/thandupsherpa/study-notes-extension/blob/main/backend/server.js): `backend/server.js`
- [PDF formatter](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/pdf/pdfGenerator.ts): `src/pdf/pdfGenerator.ts`

### Extension platform

- [Storage service](https://github.com/thandupsherpa/study-notes-extension/blob/main/src/storage/storageService.ts): `src/storage/storageService.ts`

### Other components

- **Student**
- **Gemini AI**
- **Chrome local storage**
- **Browser downloads**

## Connections

- Student → Popup workflow: opens (evidence: `README.md`)
- Popup workflow → Course browser: renders (evidence: `src/popup/App.tsx`)
- Popup workflow → Term and search: renders (evidence: `src/popup/App.tsx`)
- Popup workflow → Settings: renders (evidence: `src/popup/App.tsx`)
- Popup workflow → Generation progress: renders (evidence: `src/popup/App.tsx`)
- Popup workflow → Notes preview: renders (evidence: `src/popup/App.tsx`)
- Popup workflow → Session status: renders (evidence: `src/popup/App.tsx`)
- Course browser → Module rows: renders (evidence: `src/popup/components/CourseAccordion.tsx`)
- Popup workflow → Notes workflow: starts generation (evidence: `src/popup/App.tsx`)
- Notes workflow → Live portal adapter: selects live adapter (evidence: `src/services/notesService.ts`)
- Notes workflow → Mock adapter: selects mock adapter (evidence: `src/services/notesService.ts`)
- Live portal adapter → Digiicampus portal: queries session content (evidence: `src/services/digiicampus/realAdapter.ts`)
- Live portal adapter → Portal content script: messages tab (evidence: `src/services/digiicampus/realAdapter.ts`)
- Portal content script → DOM and syllabus parser: uses parser (evidence: `src/content/digiiContentScript.ts`)
- DOM and syllabus parser → Digiicampus portal: reads page DOM (evidence: `src/content/parsers/domParser.ts`)
- Notes workflow → AI API client: requests notes (evidence: `src/services/notesService.ts`)
- AI API client → Express AI backend: sends generation request (evidence: `README.md`)
- Express AI backend → Gemini AI: generates structured notes (evidence: `README.md`)
- Notes workflow → PDF formatter: formats notes (evidence: `src/services/notesService.ts`)
- Notes workflow → Browser downloads: downloads PDF (evidence: `src/services/notesService.ts`)
- Popup workflow → Storage service: saves settings (evidence: `src/popup/App.tsx`)
- Notes workflow → Storage service: reads settings (evidence: `src/services/notesService.ts`)
- Storage service → Chrome local storage: reads and writes (evidence: `src/storage/storageService.ts`)
- Popup workflow → Translations: uses translations
