How academeio/academe-h5p works
1. What this repo is
- This is a content repository plus lightweight H5P runtime for medical education.
- It is not primarily an application with dynamic business logic; most of the “product” is packaged H5P activities and the scripts that generate and serve them.
2. Primary domain boundary: activity packages
- The activities/ tree is the main payload.
- Each activity folder is a self-contained H5P package with:
- h5p.json for the package manifest
- content.json for activity data
- content/ for nested H5P content when needed
- The folders are organized by subject/topic and by H5P type, for example *-blanks, *-crossword, *-summary, *-branching, *-flashcards, *-drag-text.
3. Content model and tiering
- The repository’s content is intentionally stratified into tiers:
- Tier 1: text-centric activities such as Blanks, Crossword, Flashcards, SortParagraphs, MarkTheWords, Summary
- Tier 2: image-driven activities such as ImageSequencing, ImageJuxtaposition, Timeline, MemoryGame
- Tier 3/4: planned vision-heavy and complex interactive types
- This tiering is important because it separates template-based text generation from image/interaction generation and from more complex scenario/video experiences.
4. Reusable H5P library layer
- libs/ contains the reusable H5P content-type libraries and core UI dependencies.
- This is the execution substrate for everything in activities/: it includes the actual H5P runtimes for content types like Blanks, DragText, Crossword, Flashcards, Summary, InteractiveVideo, BranchingScenario, etc.
- Many libraries are versioned side by side, which means the repo can preserve compatibility across activity generations.
5. Core runtime and player boundary
- server/h5p-core/ is a vendored H5P core runtime, not just a thin app dependency.
- It supplies the player, embedding logic, resizer, xAPI plumbing, library listing, content upgrade support, and styling assets needed to render H5P packages.
- The runtime boundary is: activity package in activities/ + libraries in libs/ + core player in server/h5p-core/.
6. Local serving subsystem
- server/server.mjs is the local application entrypoint that serves activities through the H5P runtime.
- The README indicates URLs like /play/{activity-slug}, so the server exposes per-activity playback routes.
- This server is the main execution boundary between the static content repository and browser-based consumption.
7. Preview subsystem
- preview/h5p-host.mjs is a separate preview host.
- It likely exists to render or embed packaged H5P content in a lightweight local/preview context without going through the full server path.
- Architecturally, this is a preview/testing boundary, distinct from the main serving path used for production-like playback.
8. Generation and transformation pipeline
- scripts/ contains automation for producing and reshaping content packages:
- type selection
- tier 1 generation
- applying generated outputs
- content placement and precis generation
- embryo sequence and tier-2 batch workflows
- These scripts are the bridge between medical source material / competency mapping and the final activities/ packages.
9. Competency-driven content selection
- The README states that NMC CBME competencies are mapped to the best H5P type.
- That means the pipeline has an upstream decision layer: competency verb → recommended H5P content type → generated activity package.
- This is a key architectural boundary because it determines what gets generated before any H5P content is authored.
10. AI-assisted image/content production
- The repo also supports AI-assisted generation, including a custom image pipeline where Gemini produces purpose-built medical diagrams.
- In architecture terms, this is an external content-generation dependency feeding the package-generation scripts, not the runtime player itself.
11. Consumption model and LMS integration
- The intended downstream consumer is Canvas LMS.
- The README calls out two embedding modes:
- iframe embed for simpler activities
- ExternalUrl for more complex ones
- So the repo’s output is designed to be consumed as embedded interactive content rather than as a standalone full-stack app.
12. Documentation and governance
- docs/ contains the repository’s architecture, roadmap, content-type reference, progress reporting, and competency mapping documentation.
- This is useful for diagramming because it reflects the project’s internal decomposition: content types, competencies, and implementation status are explicitly tracked.
13. Packaging and deployment wrapper
- Dockerfile, .dockerignore, and the Node-based server imply containerized deployment support.
- The container boundary wraps the static H5P assets, the runtime server, and the preview/hosting scripts into a reproducible environment.
14. How data flows through the system
- Source medical topics/competencies are mapped by scripts into H5P-specific structures.
- Generated outputs are written into activities/.
- The H5P runtime in server/h5p-core/ resolves the required libraries from libs/ and serves the activity.
- Browser users access the activity through the H5P player, often embedded into Canvas.
15. What to show in an architecture diagram
- A good diagram should separate:
- content sources and generation tooling
- static activity packages
- shared H5P libraries/core runtime
- serving/preview hosts
- external consumers and AI/image services
- The dominant architectural pattern here is generated content packages served by a shared H5P runtime.
Main entry points: libs Libraries · activities Activities · server.mjs Server · scripts Generators
Components 24
Content packages
Self-contained H5P activities organized by topic and content type
- Activities · Top-level library of generated H5P activity packages
activities - Text tier · Text-centric activities such as blanks, crossword, drag text, mark words, summary, and branching
activities - Image tier · Image-driven and sequencing-style activities used for richer visual interactions
activities - Topic sets · Subject-specific activity bundles repeated across anatomy, physiology, biochemistry, and related domains
activities - h5p.json · Per-activity H5P manifest defining package metadata and dependencies
activities/abdominal-cavity-blanks/h5p.json - content.json · Per-activity content model and authored exercise data
activities/abdominal-cavity-blanks/content.json - Nested content · Inner content.json used by package-internal content trees when needed
activities/abdominal-cavity-blanks/content/content.json
H5P runtime
Reusable libraries and vendored core player assets
- Libraries · Shared content-type libraries and UI dependencies used by all activities
libs - Blanks · Cloze-style text gap interaction runtime
libs/H5P.Blanks-1.14 - Drag text · Text drag-and-drop interaction runtime
libs/H5P.DragText-1.10 - Crossword · Crossword interaction runtime
libs/H5P.Crossword-0.5 - Flashcards · Flashcard interaction runtime
libs/H5P.Flashcards-1.7 - Summary · Summary/question-set style runtime for text comprehension
libs/H5P.Summary-1.10 - Branching · Branching scenario / decision-tree runtime for guided cases
libs/H5P.BranchingScenario-1.8 - Interactive video · Interactive video runtime for complex, timed interactions
libs/H5P.InteractiveVideo-1.27 - H5P core · Vendored H5P core player, embedding, resizer, xAPI, and upgrade support
server/h5p-core
Serving
Local playback and preview hosts
- Server · Main Node-based application entrypoint that serves activities through the H5P runtime
server/server.mjs - Preview host · Lightweight preview boundary for rendering and embedding packaged H5P content
preview/h5p-host.mjs
Generation
Scripts that map source material into packaged activities
- Generators · Content-generation and transformation scripts for building activity packages
scripts - Type select · Chooses the best H5P activity type for a competency or source item
scripts/h5p-type-selector.mjs - Tier 1 gen · Generates text-centric activity packages from source material
scripts/h5p-generate-tier1.mjs - Tier 2 batch · Batch workflow for image-driven or more complex activity generation
scripts/gen-tier2-batch.mjs
Docs
Architecture and content-type reference material
- Architecture · Repository architecture overview and implementation boundaries
docs/02-architecture.md - Competency map · Mapping from competencies to recommended H5P content types
docs/05-competency-mapping.md
Connections 26
- Activities → Text tier: contains · Most packages are text-first activities
- Activities → Image tier: contains · Some packages are image-driven or more visual
- Activities → Topic sets: organized as · Packages are grouped by medical topic and learning goal
- h5p.json → content.json: describes · Manifest binds package metadata to authored content
- content.json → Nested content: may include · Some activities embed nested package content
- Generators → Type select: routes via · Scripts first choose the most suitable activity type
- Type select → Competency map: guided by · Competency mapping informs content-type selection
- Generators → Tier 1 gen: builds · Tier 1 scripts generate text-centric packages
- Generators → Tier 2 batch: builds · Batch scripts handle the richer visual/complex tiers
- Tier 1 gen → Activities: writes · Generated outputs are placed into the activities tree
- Tier 2 batch → Activities: writes · Batch workflows also materialize packages into activities
- Libraries → Blanks: includes · Shared runtime library for blanks activities
- Libraries → Drag text: includes · Shared runtime library for drag-text activities
- Libraries → Crossword: includes · Shared runtime library for crossword activities
- Libraries → Flashcards: includes · Shared runtime library for flashcard activities
- Libraries → Summary: includes · Shared runtime library for summary activities
- Libraries → Branching: includes · Shared runtime library for branching scenarios
- Libraries → Interactive video: includes · Shared runtime library for interactive video
- Server → H5P core: uses · Server delegates player and embed behavior to the H5P core runtime
- Server → Activities: serves · Playback routes expose packaged activities
- Server → Libraries: resolves · Server loads the activity libraries needed for rendering
- Preview host → H5P core: uses · Preview host renders content through the same core player boundary
- Preview host → Activities: loads · Preview host consumes packaged activities directly
- H5P core → Libraries: depends on · Player resolves content-type libraries and UI dependencies
- Architecture → Server: documents · Architecture docs explain the serving boundary
- Architecture → Generators: documents · Architecture docs explain the generation pipeline