# greubela/edusquirrel-workbook architecture

> Architecture diagram of the GitHub repository greubela/edusquirrel-workbook, 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/greubela/edusquirrel-workbook
- Repository: https://github.com/greubela/edusquirrel-workbook

## Overview

EduSquirrel Workbook is a browser-based platform for authoring and delivering interactive, multilingual student workbooks. Its principal workflow is to mount an app, assemble workbook content into sections and exercises, render those elements in the browser, and let students complete interactions. The README also documents coding tasks, GPT-assisted feedback, TurtleStitch activities, and browser/worker/server modules. The graph follows those documented capabilities; several implementation links are unverified because their source was not sampled.

Main entry points: [`modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/interactionRenderer`](https://github.com/greubela/edusquirrel-workbook/tree/main/modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/interactionRenderer) (Exercise interactions), [`modules/core/shared/src/main/scala/it/evadid/workbook/interaction/sync/SyncInformation.scala`](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/core/shared/src/main/scala/it/evadid/workbook/interaction/sync/SyncInformation.scala) (Interaction sync), [`modules/client/src/main/scala/it/evadid/homepage/control/singletons/HtmlFullWorkbookApp.scala`](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/control/singletons/HtmlFullWorkbookApp.scala) (Workbook app context), [`modules/client/src/main/scala/MainApp.scala`](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/MainApp.scala) (Browser mounting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_main["Browser mounting<br/>[MainApp.scala]"]
  node_app["Workbook app context"]
end

subgraph group_workbook["Workbook experience"]
  node_content["Workbook authoring"]
  node_model["Workbook model"]
  node_renderer["Element dispatch"]
  node_structure["Workbook rendering"]
  node_interactions["Exercise interactions"]
  node_turtle["TurtleStitch tasks"]
end

subgraph group_shared["Shared services"]
  node_language["Language maps"]
  node_language_model["Language types<br/>[AppLanguage.scala]"]
  node_sync_info["Interaction sync"]
  node_cache["Remote cache"]
  node_sync_model["Serialized history"]
  node_local_sync[("IndexedDB sync")]
end

subgraph group_execution["Execution and feedback"]
  node_worker["Browser worker"]
  node_python_worker["Pyodide execution<br/>[pyodide-worker.js]"]
  node_feedback["Feedback diagnosis"]
  node_llm["LLM feedback client"]
  node_server["JVM command handlers"]
end

node_learner(("Student or author"))

node_learner -->|"opens workbook"| node_main
node_main -->|"mounts app"| node_app
node_app -.->|"loads content"| node_content
node_content -->|"composes model"| node_model
node_model -->|"renders elements"| node_renderer
node_renderer -->|"dispatches rendering"| node_structure
node_structure -.->|"renders exercises"| node_interactions
node_app -.->|"loads translations"| node_language
node_language -->|"uses language types"| node_language_model
node_learner -->|"completes tasks"| node_interactions
node_interactions -.->|"syncs interaction state"| node_sync_info
node_sync_info -->|"uses remote cache"| node_cache
node_sync_info -->|"stores history"| node_sync_model
node_sync_info -->|"uses sync destination"| node_local_sync
node_interactions -.->|"runs worker tasks"| node_worker
node_interactions -.->|"runs Python tasks"| node_python_worker
node_interactions -.->|"requests diagnosis"| node_feedback
node_feedback -.->|"requests LLM feedback"| node_llm
node_llm -.->|"calls server proxy"| node_server
node_interactions -->|"offers TurtleStitch tasks"| node_turtle

click node_main "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/MainApp.scala"
click node_app "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/control/singletons/HtmlFullWorkbookApp.scala"
click node_content "https://github.com/greubela/edusquirrel-workbook/tree/main/modules/client/src/main/scala/it/evadid/homepage/workbook/content"
click node_model "https://github.com/greubela/edusquirrel-workbook/tree/main/modules/core/shared/src/main/scala/it/evadid/workbook"
click node_renderer "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/HtmlRenderFactory.scala"
click node_structure "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/structureRenderer/HtmlWorkbookRenderer.scala"
click node_interactions "https://github.com/greubela/edusquirrel-workbook/tree/main/modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/interactionRenderer"
click node_language "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/control/change/LanguageMapStorageControl.scala"
click node_language_model "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/core/shared/src/main/scala/it/evadid/core/datastructures/language/AppLanguage.scala"
click node_sync_info "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/core/shared/src/main/scala/it/evadid/workbook/interaction/sync/SyncInformation.scala"
click node_cache "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/core/shared/src/main/scala/it/evadid/core/datastructures/storage/RemoteCacheController.scala"
click node_sync_model "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/core/shared/src/main/scala/it/evadid/workbook/interaction/variable/InteractionVariableHistorySerialized.scala"
click node_local_sync "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/syncDestination/LocalIndexedDbStorageSync.scala"
click node_worker "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/worker/src/main/scala/it/evadid/worker/WebWorkerBackendServer.scala"
click node_python_worker "https://github.com/greubela/edusquirrel-workbook/blob/main/homepage/js/pyodide-worker.js"
click node_feedback "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/legacy/interactionPlugins/blockEnvironment/feedback/diagnosis/DiagnosisEngine.scala"
click node_llm "https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/legacy/interactionPlugins/blockEnvironment/feedback/ai/FetchProxyLlmClient.scala"
click node_server "https://github.com/greubela/edusquirrel-workbook/tree/main/modules/server/src/main/scala/it/evadid/server"
click node_turtle "https://github.com/greubela/edusquirrel-workbook/tree/main/modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/interactionRenderer/turtleStitch"

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_main,node_app toneBlue
class node_content,node_model,node_renderer,node_structure,node_interactions,node_turtle toneAmber
class node_language,node_language_model,node_sync_info,node_cache,node_sync_model,node_local_sync toneMint
class node_worker,node_python_worker,node_feedback,node_llm,node_server toneRose
class node_learner toneIndigo
```

## Components

### App entry

- [Browser mounting](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/MainApp.scala): `modules/client/src/main/scala/MainApp.scala`
- [Workbook app context](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/control/singletons/HtmlFullWorkbookApp.scala): `modules/client/src/main/scala/it/evadid/homepage/control/singletons/HtmlFullWorkbookApp.scala`

### Workbook experience

- [Workbook authoring](https://github.com/greubela/edusquirrel-workbook/tree/main/modules/client/src/main/scala/it/evadid/homepage/workbook/content): `modules/client/src/main/scala/it/evadid/homepage/workbook/content`
- [Workbook model](https://github.com/greubela/edusquirrel-workbook/tree/main/modules/core/shared/src/main/scala/it/evadid/workbook): `modules/core/shared/src/main/scala/it/evadid/workbook`
- [Element dispatch](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/HtmlRenderFactory.scala): `modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/HtmlRenderFactory.scala`
- [Workbook rendering](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/structureRenderer/HtmlWorkbookRenderer.scala): `modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/structureRenderer/HtmlWorkbookRenderer.scala`
- [Exercise interactions](https://github.com/greubela/edusquirrel-workbook/tree/main/modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/interactionRenderer): `modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/interactionRenderer`
- [TurtleStitch tasks](https://github.com/greubela/edusquirrel-workbook/tree/main/modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/interactionRenderer/turtleStitch): `modules/client/src/main/scala/it/evadid/homepage/workbook/htmlRenderer/interactionRenderer/turtleStitch`

### Shared services

- [Language maps](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/control/change/LanguageMapStorageControl.scala): `modules/client/src/main/scala/it/evadid/homepage/control/change/LanguageMapStorageControl.scala`
- [Language types](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/core/shared/src/main/scala/it/evadid/core/datastructures/language/AppLanguage.scala): `modules/core/shared/src/main/scala/it/evadid/core/datastructures/language/AppLanguage.scala`
- [Interaction sync](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/core/shared/src/main/scala/it/evadid/workbook/interaction/sync/SyncInformation.scala): `modules/core/shared/src/main/scala/it/evadid/workbook/interaction/sync/SyncInformation.scala`
- [Remote cache](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/core/shared/src/main/scala/it/evadid/core/datastructures/storage/RemoteCacheController.scala): `modules/core/shared/src/main/scala/it/evadid/core/datastructures/storage/RemoteCacheController.scala`
- [Serialized history](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/core/shared/src/main/scala/it/evadid/workbook/interaction/variable/InteractionVariableHistorySerialized.scala): `modules/core/shared/src/main/scala/it/evadid/workbook/interaction/variable/InteractionVariableHistorySerialized.scala`
- [IndexedDB sync](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/syncDestination/LocalIndexedDbStorageSync.scala): `modules/client/src/main/scala/it/evadid/homepage/workbook/syncDestination/LocalIndexedDbStorageSync.scala`

### Execution and feedback

- [Browser worker](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/worker/src/main/scala/it/evadid/worker/WebWorkerBackendServer.scala): `modules/worker/src/main/scala/it/evadid/worker/WebWorkerBackendServer.scala`
- [Pyodide execution](https://github.com/greubela/edusquirrel-workbook/blob/main/homepage/js/pyodide-worker.js): `homepage/js/pyodide-worker.js`
- [Feedback diagnosis](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/legacy/interactionPlugins/blockEnvironment/feedback/diagnosis/DiagnosisEngine.scala): `modules/client/src/main/scala/it/evadid/homepage/workbook/legacy/interactionPlugins/blockEnvironment/feedback/diagnosis/DiagnosisEngine.scala`
- [LLM feedback client](https://github.com/greubela/edusquirrel-workbook/blob/main/modules/client/src/main/scala/it/evadid/homepage/workbook/legacy/interactionPlugins/blockEnvironment/feedback/ai/FetchProxyLlmClient.scala): `modules/client/src/main/scala/it/evadid/homepage/workbook/legacy/interactionPlugins/blockEnvironment/feedback/ai/FetchProxyLlmClient.scala`
- [JVM command handlers](https://github.com/greubela/edusquirrel-workbook/tree/main/modules/server/src/main/scala/it/evadid/server): `modules/server/src/main/scala/it/evadid/server`

### Other components

- **Student or author**

## Connections

- Student or author → Browser mounting: opens workbook
- Browser mounting → Workbook app context: mounts app
- Workbook app context → Workbook authoring: loads content
- Workbook authoring → Workbook model: composes model
- Workbook model → Element dispatch: renders elements
- Element dispatch → Workbook rendering: dispatches rendering
- Workbook rendering → Exercise interactions: renders exercises
- Workbook app context → Language maps: loads translations
- Language maps → Language types: uses language types (evidence: `modules/client/src/main/scala/it/evadid/homepage/control/change/LanguageMapStorageControl.scala`)
- Student or author → Exercise interactions: completes tasks
- Exercise interactions → Interaction sync: syncs interaction state
- Interaction sync → Remote cache: uses remote cache (evidence: `modules/core/shared/src/main/scala/it/evadid/core/datastructures/storage/RemoteCacheController.scala`)
- Interaction sync → Serialized history: stores history (evidence: `modules/core/shared/src/main/scala/it/evadid/workbook/interaction/sync/SyncInformation.scala`)
- Interaction sync → IndexedDB sync: uses sync destination (evidence: `modules/client/src/main/scala/it/evadid/homepage/workbook/syncDestination/LocalIndexedDbStorageSync.scala`)
- Exercise interactions → Browser worker: runs worker tasks
- Exercise interactions → Pyodide execution: runs Python tasks
- Exercise interactions → Feedback diagnosis: requests diagnosis
- Feedback diagnosis → LLM feedback client: requests LLM feedback
- LLM feedback client → JVM command handlers: calls server proxy
- Exercise interactions → TurtleStitch tasks: offers TurtleStitch tasks
