<- Back to Index

Apache Superset Demo

SQL LRS's Postgresql support enables BI solutions like Apache Superset to query the underlying SQL database. The SQL LRS project includes a Docker Compose file that can be used to demo this functionality.

Run the Docker Stack

The Docker Compose stack includes an LRS, Postgresql, Keycloak, Superset and Redis (used as a cache by Superset). A Keycloak instance controls access to both the LRS and Superset.

Note that for Keycloak to work (at least on Docker for Mac) you'll need to map your loopback IP to host.docker.internal so that Superset can reach Keycloak at an address that is also available to the host machine. This can be done by adding the following line to your /etc/hosts file (note you will need administrative/sudo access):

127.0.0.1 host.docker.internal

To run the demo:

cd dev-resources/superset_demo
docker compose up -d

or

make superset-demo

Wait a minute or two for everything to start up.

Add xAPI data

You'll need some data to visualize. Hook up the xAPI-conformant Learning Record Provider (LRP) of your choice or use DATASIM to simulate learning activity:


git clone https://github.com/yetanalytics/datasim.git

cd datasim

docker run -v "$(pwd)"/dev-resources:/dev-resources  \
           -it \
           --rm \
           yetanalytics/datasim:latest \
           -i /dev-resources/input/simple.json \
           -E http://host.docker.internal:8080/xapi \
           -U my_key \
           -P my_secret \
           generate post

Log In to Superset

Navigate to http://localhost:8088/:

Superset landing page

Click "Login" and log in with the username dev_user and the password changeme123:

Superset login page

Add the SQL LRS Postgresql Database

Select "Database Connections" from the righthand menu:

Superset menu select database connections

You'll see an empty list of databases. Click "+ Database" on the right:

Superset database list select + Database

Select "PostgreSQL" in the list and proceed to the next screen:

Superset add database postgresql

Enter the following configuration:

FieldValueNotes
HOSTdbThe docker-internal address of the Postgresql database
PORT5432
DATABASE NAMElrsql_dbSpecified in the Docker Compose file
USERNAMElrsql_user"
PASSWORDlrsql_password"
DISPLAY NAMESQL LRSArbitrary name tag

And click "CONNECT". You should see confirmation that the database is connected:

Superset postgresql database connected

Click "FINISH" and the database is ready to explore with Superset.

Explore SQL LRS in SQL Lab:

SQL lab

Create a chart:

Create chart

<- Back to Index