Skip to content
Joerg Boeselt edited this page Mar 31, 2015 · 21 revisions

lxHive

##Introduction

lxHive is a new LRS (Learning Record Store) It is actively developed by Brightcookie Inc. It's main intent is to be an intersection between flexibility, readability and speed.

Features

  • Aims implement the xAPI spec in its entirety
  • Follows PSR-0 conventions and coding standard: autoload friendly
  • Built on top of a solid and extensively tested framework - Slim
  • Tested and well-documented

Supported xAPI versions

  • 1.0.3

##Installation

Requirements

  • MongoDb
  • PHP >= 5.3.3,
  • Composer
  • OpenSSL
  • (optional) PHPUnit to run tests.

You should use composer to install lxHive. It will automatically install any dependencies you might need and want.

API

xAPI introduction

xAPI is a service that allows for statements of experience to be delivered to and stored securely in a Learning Record Store (LRS). The xApi specification is maintainted by the Advanced Distributed Learning (ADL) Initiative, sponsored by the Office of the United Stated Under Secretary of Defense for Personnel and Readiness.

Supported xAPI endpoints

All xAPI endpoints, as specified by the xAPI spec, are supported.

Additional endpoints and parameters

In addition, lxHive supports several additional, non-spec endpoints and parameters by default.

These include:

An additional count parameter is provided in the root of the returned document to help developers iterate through all of the Statements.

Stored statements with file attachments are always served as type application/json with a fileUrl (GET).

Extending lxHive

Extending lxHive is easy. It's as simple as creating a new Composer package and including it in the composer.json file.

Plus endpoints

lxHive was written ground up with the goal of being easily extensible. As such, it is simple to add your own endpoints in the Plus namespace. To add a new basic endpoint you will most likely create 3 files - a controller, residing in the "Resource/{version}" folder, a "Service" where you manipulate/parse any data that needs to be presented and a "View" which is then presented to the user. More advanced use cases may require adding a new MongoDB collection and documents.

A complete tutorial to creating a new Plus endpoint can be found in Creating a new plus endpoint.

xAPI Versioning

When issuing all requests, except to /about and /oauth endpoints, you must include the X-API-Version header, so that lxHive knows by which version of the xAPI spec it should treat your request. As a result of careful planning, lxHive is inherently backwards and forwards compatible, meaning your xAPI-reliant apps will never stop working.

Authorisation model

Clients

A client is the application that is requesting the permissions in the users' name. This is usually an LMS or a standalone activity.

Agents

An agent is classified as a Person, which is the actual end-user performing all the actions that need to be tracked via xAPI.

Basic authentication

lxHive supports basic authentication as a method to authenticate. At the moment, setting up a basic token is recommended for machine-to-machine communication and for creation of administrative supertokens.

OAuth

lxHive supports OAuth 2.0 out of the box. Currently, we support the "Auth Code" flow. It is the preferred method of authentication when dealing with end users (real humans).

Administration

Using the console

The X tool is the lxHive administrators' best friend. It enables you to administrate all parts of the LRS, ranging from setting up MongoDB indexes, adding OAuth clients, Basic auth tokens, new users, etc. This goes without saying, but you should restrict access to this tool only to administrators, as it provides full access to all LRS data.

** This is the current command set available via X: **

Available commands:
 help                  Displays help for a command
 list                  Lists commands
auth
 auth:basic:create     Creates a new basic auth token
 auth:basic:delete     Deletes a token
 auth:basic:expire     Expires a token
 auth:basic:list       List tokens
 auth:scope:create     Creates a new authentication scope!
oauth
 oauth:client:create   Creates a new OAuth client
 oauth:client:list     Lists OAuth clients
setup
 setup:db              Sets up the MongoDB database
 setup:oauth           Sets up default OAuth scopes
user
 user:create           Creates a new user

Using the configuration files

Several aspects of lxHive are controller via YAML configuration files. These are located in the src/xAPI/Config directory. The defaults are in Config.yml, however you can override them in Config.production.yml or Config.production.yml files. The default mode is production, however, when developing, you can change by setting the SLIM_MODE to development.

Functional tests

The aim of the lxHive is to eventually achieve full (100%) compatibility with ADL's official test suite. We also regularly perform tests using other tools such as our own proprietary test suite, which is available here.

Current test status
Name Result
ADL test suite NaN% passing
Jasmine test suite 100% passing

Semantic versioning

lxHive follows the guidelines of semantic versioning, as described here.

Development guidelines

If you're a developer, we greatly encourage you to open issues, make enhancements and fix any bugs you might. When doing so, you should follow our development guidelines.