Table of Contents
- Set up VS Code
- Set up git-secrets hooks
- Set up LTI tool
- Set up MongoDB
- Start up the app
- Test it out
- Documentation
- Download and install VS Code: https://code.visualstudio.com/
- Install ESlint package: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
- Install ESlint rules: npx install-peerdeps --global eslint-config-wesbos
To prevent us from accidentally committing secrets, we will install the git-secrets hooks.
-
Install git-secrets locally on your machine. See instructions for your platform here.
-
Set up git-secrets for this repo
cd
into the repo- Run
git secrets --install
-
Configure git-secrets by running the following commands:
git secrets --register-aws
git secrets --add 'SECRET(\s|[a-zA-Z\_])*=\s*.+'
These rules will prevent any variables prefixed with SECRET_
from being committed with a value filled in.
-
Startup your local Moodle on Docker, then log in as admin
-
Go to Site administration > Plugins > Activity modules > External tool > Manage tools
-
Click on configure a tool manually
-
Enter in the following:
Tool name: Tool URL: http://localhost:8080 LTI version: LTI 1.3 Public key type: RSA key Initiate login URL: http://localhost:8080/login Redirection URI(s): http://localhost:8080
Services:
IMS LTI Assignment and Grade Services: Use this service for grade sync and column management IMS LTI Names and Role Provisioning: Use this service to retrieve members' information as per privacy settings Tool Settings: Use this service
Privacy:
Share launcher's name with tool: Always Share launcher's email with tool: Always Accept grades from the tool: Always
-
Click "Save changes"
-
Then under "Tools" find LTI app you just created and click on the "View configurations" icon (first icon, next to gear)
-
Copy Client ID value into SECRET_PLATFORM_CLIENTID value in .env file (created below in Start up the app, Step 1).
- Install MongoDB: https://docs.mongodb.com/manual/administration/install-community/
- Helpful to install MongoDB Compass to ensure your database is running correctly: https://www.mongodb.com/try/download/compass
-
Copy .env.dist to a local .env file. There are some empty secret fields in .env.dist. Ask Rex for the secrets.
-
Set SECRET_LTI_KEY to any random string
-
(Optional) Comment out DEBUG if you do not want to see the LTI provider debugging messages
-
Start app:
yarn
→ This installs all the necessary dependencies.yarn dev
→ This is set to run migrate-mongo and start up both the client and server.
-
On initial load the app will display the public key in the terminal
-
Copy the key, and remember to remove the
[0]
characters from the start of each row of the key, and include the BEGIN/END PUBLIC KEY lines -
Back to Moodle: Go to Site administration → Plugins → Activity modules → External tool → Manage tools, and click on the gear icon on the LTI external tool
-
Paste the public key you just copied (with
[0]
removed) into 'Public key' -
Click "Save changes"
- Go to a course site
- Turn editing on and click "Add activity or resource", choose External tool, enter any name, choose your LTI tool from Preconfigured tool, and then click "Save changes"
- You should see your tool embedded in the site and the app should load up
- LTIjs: https://cvmcosta.me/ltijs/#/provider
- Instructure UI: https://instructure.design/
- Migrate-mongo: https://www.npmjs.com/package/migrate-mongo
- Jest: https://jestjs.io/
- UCLA API: https://kb.sait.ucla.edu/display/KB/API+Knowledgebase