H5P-Nodejs-Library
  • README
  • Basic usage
    • Architecture
    • Integrating the core library
    • H5P Ajax Endpoints
    • Constructing H5PEditor
    • REST Example
  • Advanced usage
    • Authorization
    • User content state
    • Multiple user states per object
    • Impersonating users
    • Basic completion tracking
    • Localization
    • Cluster
    • Addons
    • Customization
    • Performance optimizations
    • Privacy
    • Forward proxy support
    • Security
  • NPM packages
    • h5p-mongos3
      • Mongo/S3 Content Storage
      • S3 Temporary File Storage
      • Mongo Library Storage
      • Mongo/S3 Library Storage
    • h5p-webcomponents
    • h5p-react
    • h5p-redis-lock
    • h5p-svg-sanitizer
    • h5p-clamav-scanner
  • Development
    • Getting started
    • Testing & code quality
    • Core updates
    • Project Status
Powered by GitBook
On this page
  • Packages
  • Examples
  • Trying out the demo
  • Contributing
  • Get in touch
  • Versioning
  • License
  • Support

Was this helpful?

README

NextBasic usage

Last updated 2 months ago

Was this helpful?

This library provides everything needed to create custom H5P servers running on NodeJS. It is written in TypeScript and fully typed, which makes it much easier to work with than the official PHP server. Of course, it's also possible to use this library in projects with JavaScript (ES5) and you will still profit from the typings by getting code completion in your IDE.

Even though the repository includes a sample demo project that demonstrates its functionality, it's still your job to integrate this library into your own NodeJS server. This is called an "implementation" or "plugin" in H5P terminology. The implementation is responsible for exposing HTTP endpoints, persisting data and calling maintenance functions. This library is not an out-of-the-box solution to get a standalone H5P server.

Check out the for details on how to use this library.

Please note that even if most functionality of H5P works, there are parts which haven't been implemented yet or which might be faulty. This is particularly true for security concerns. For a more comprehensive list of what works and what doesn't, check out . The interfaces have reached some level of stability, but might still change in future major releases.

Packages

The main Git repository is a monorepo that contains several packages, which can be installed through NPM. The packages are meant to be combined.

Package name
Functionality
used in

@lumieducation/h5p-server

the core package to run H5P in NodeJS

backend

@lumieducation/h5p-express

routes and controllers for Express

backend

native web components to display the H5P player and editor in the browser

frontend

React components with the same functionality as the native web components

frontend

storage classes for MongoDB and S3

backend

storage class for locks with Redis

backend

@lumieducation/h5p-html-exporter

an optional component that can create bundled HTML files for exporting

backend

an optional package that protects against XSS attack in SVGs if you want to enable SVG in content files

backend

an optional package that checks file uploads for viruses

backend

Examples

There are two example implementations that illustrate how the packages can be used:

Example type
Tech stack
Location

server-side-rendering

server: Express with JS template rendering client: static HTML, some React for library management

/packages/h5p-examples

server: Express with REST endpoints client: React

/packages/h5p-rest-example-server /packages/h5p-rest-example-client

Trying out the demo

  1. Clone the repository with git

  2. npm install

  3. npm start

Contributing

Get in touch

Versioning

License

Support

This work obtained financial support for development from the German BMBF-sponsored research project "lea.online" (FKN: W-143600).

Read more about them at the following websites:

Make sure you have , , and installed. If you use Windows, you must use bash (comes with Git for windows) as a command shell (otherwise scripts won't run).

You can then open the URL in any browser.

Lumi tries to improve education wherever it is possible by providing a software that connects teachers with their students. Every help is appreciated and welcome. Feel free to create pull requests. Check out the to get started.

This project has adopted the code of conduct defined by the Contributor Covenant. It can be read in full .

or .

We use for versioning. For the versions available, see the .

This project is licensed under the GNU GENERAL PUBLIC LICENSE v3 License - see the file for details

lea.online -

University of Bremen -

BMBF -

git
node ≥ 10.16
npm
http://localhost:8080
documentation pages for developers
here
Slack
c@Lumi.education
SemVer
tags on this repository
LICENSE
https://blogs.uni-bremen.de/leaonline
https://www.uni-bremen.de/en.html
https://www.bmbf.de/en/index.html
@lumieducation/h5p-webcomponents
@lumieducation/h5p-react
@lumieducation/h5p-mongos3
@lumieducation/h5p-redis-lock
@lumieducation/h5p-svg-sanitizer
@lumieducation/h5p-clamav-scanner
Single Page Application
GitBook documentation
the documentation page on the current status of the project