These instructions will get a copy of MyLA up and running on your local machine with anonymized/fake student data.
To follow the instructions below, you will at minimum need the following:
-
Clone this repo.
git clone https://github.com/tl-its-umich-edu/my-learning-analytics.git
-
Then navigate into the repo.
cd my-learning-analytics
-
Create a directory in your home directory called
mylasecrets
. This directory is mapped bydocker-compose.yml
into the container as/secrets/
.mkdir ~/mylasecrets
-
Copy the
config/env_sample.hjson
file intomylasecrets
asenv.hjson
.cp config/env_sample.hjson ~/mylasecrets/env.hjson
-
Copy the
config/cron_udp.hjson
file intomylasecrets
. This step is Optional, since the MyLA cron query file path defaults toconfig/cron_udp.hjson
.cp config/cron_udp.hjson ~/mylasecrets/cron_udp.hjson
-
Examine the
env.hjson
file. You may need to change some of the configuration values for different environments, e.g. localhost vs. a production deployment. There are comments to help determine the proper settings. See Configuration for some additional info.Note: You may also optionally place the JSON settings directly into the
ENV_JSON
environment variable if your deployment environment doesn't easily support mounting theenv.hjson
file into container. When usingENV_JSON
, put the entire contents ofenv.hjson
into it as a single-line string. -
Copy the
.env.sample
file as.env
.cp .env.sample .env
-
Examine the
.env
file. It will have the suggested default environment variable settings, mostly just MySQL information as well as locations of other configuration files. -
Start the Docker build process (this will take some time).
docker compose build
-
Start up the web server and database containers.
docker compose up
Note: Use
docker compose down
and^C
at any time to stop the running containers. -
Download the latest SQL file from this Google Drive link, and move it into the repository.
-
Load the database with data.
docker exec -i student_dashboard_mysql mysql \ -u student_dashboard_user \ --password=student_dashboard_pw student_dashboard \ < {name of sql file}
- Navigate to http://localhost:5001/ and log in as
root
with passwordroot
.
As you are now logged in as root
, there are no courses listed.
To view a course and the visualizations as an admin, do the following:
-
Go to the Django admin panel by clicking the avatar in the top right, then clicking "Admin", or navigate to http://localhost:5001/admin.
-
Click on "Courses" under "Dashboard" in the right-hand panel.
-
Click on one of the "Link" links in the "Course Link" column for one of the three courses.
-
If you are logged in as
root
, click on the top-right circle, then click "Logout". -
Connect to the MySQL database.
Host: 127.0.0.1 Username: student_dashboard_user Password: student_dashboard_pw Database: student_dashboard Port: 5306
-
Pick a student
sis_name
from theuser
table to be used in the next step.SELECT sis_name FROM `user` WHERE enrollment_type = 'StudentEnrollment';
-
Create an authorized user.
docker exec -it student_dashboard python manage.py createuser \ --username={insert sis_name} \ --password={create password} \ [email protected]
Note: To make a user a superuser, edit the record in
auth_user
to setis_staff=1
andis_superuser=1
. -
Login using the username and password created.
-
The course(s) the student with the selected
sis_name
are enrolled in will be displayed. Click on a course to view as the student selected in step 3.