Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
battis committed Feb 8, 2025
0 parents commit 5bd3073
Show file tree
Hide file tree
Showing 32 changed files with 9,878 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"@commitlint/config-conventional",
"@commitlint/config-pnpm-scopes"
]
}
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "composer" # See documentation for possible values
directories:
- "/"
- "/packages/php/*"
schedule:
interval: "weekly"

- package-ecosystem: "npm" # See documentation for possible values
directories:
- "/"
- "/packages/ts/*"
schedule:
interval: "monthly"
42 changes: 42 additions & 0 deletions .github/workflows/split.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'split'
on:
push:
branches:
- main
tags:
- '*'
jobs:
packages_split:
runs-on: ubuntu-latest
environment: 'actions'
env:
GITHUB_TOKEN: ${{ secrets.SPLIT_ACCESS_TOKEN }}
strategy:
fail-fast: false
matrix:
package:
- local_path: 'slim-lti-gae-shim'
split_repository: 'lti.slim-gae-shim'
- local_path: 'slim-lti-shim'
split_repository: 'lti.slim-lti-shim'
steps:
- uses: actions/checkout@v2
# no tag
- if: "!startsWith(github.ref, 'refs/tags/')"
uses: 'danharrin/monorepo-split-github-action@v2.3.0'
with:
package_directory: 'packages/${{ matrix.package.local_path }}'
repository_organization: 'groton-school'
repository_name: '${{ matrix.package.split_repository }}'
user_name: 'battis'
user_email: 'sbattis@groton.org'
# with tag
- if: "startsWith(github.ref, 'refs/tags/')"
uses: 'danharrin/monorepo-split-github-action@v2.3.0'
with:
tag: ${GITHUB_REF#refs/tags/}
package_directory: 'packages/${{ matrix.package.local_path }}'
repository_organization: 'groton-school'
repository_name: '${{ matrix.package.split_repository }}'
user_name: 'battis'
user_email: 'sbattis@groton.org'
12 changes: 12 additions & 0 deletions .github/workflows/todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'TODO to Issue'
on: ['push']
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v4'
- name: 'TODO to Issue'
uses: 'alstr/todo-to-issue-action@v5'
with:
AUTO_ASSIGN: true
IDENTIFIERS: '[{"name": "TODO", "labels": []}, {"name": "FIXME", "labels": ["bug"]}]'
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.env
.env.*
*.cache
**/node_modules/
**/vendor/
4 changes: 4 additions & 0 deletions .nova/Configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"prettier.module.path" : "\/Users\/sbattis\/Documents\/GitHub\/lti\/node_modules\/prettier",
"workspace.color" : 9
}
3 changes: 3 additions & 0 deletions .nova/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Configuration information for Nova

This directory is 100% unneeded if you are using a different IDE. This contains configuration information for Panic's [Nova](https://nova.app/) IDE.
9 changes: 9 additions & 0 deletions .nova/Tasks/deploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"actions" : {
"run" : {
"enabled" : true,
"script" : "pnpm run deploy --verbose"
}
},
"openLogOnRun" : "start"
}
46 changes: 46 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# to install pre-commit
# pre-commit install
# pre-commit install --hook-type commit-msg

# https://pre-commit.com/hooks.html
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: check-json
- id: check-xml
- id: check-merge-conflict
- id: check-symlinks
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-docstring-first
- id: check-case-conflict
- id: forbid-submodules
- repo: https://github.com/markdownlint/markdownlint
rev: v0.12.0
hooks:
- id: markdownlint
args:
- '-r ~MD013'
- repo: https://github.com/digitalpulp/pre-commit-php
rev: 1.4.0
hooks:
- id: php-lint-all
- id: php-cs-fixer
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.0.5
hooks:
- id: sqlfluff-lint
- repo: https://github.com/hija/clean-dotenv
rev: v0.0.7
hooks:
- id: clean-dotenv
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.20.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies:
['@commitlint/config-conventional', '@commitlint/config-pnpm-scopes']
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@battis/prettier-config"
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# groton-school/lti-base

## Install

- Make sure that [gRPC](https://cloud.google.com/php/grpc) is installed so that the current version of Firestore can be used (on macOS, it's worth checking to see if the `pecl` symlink in the active PHP installation is valid, per [this note](https://yarnaudov.com/php-pecl-module-install-warning-mkdir-file-exists-fix.html)).
- Make sure that [Node](https://nodejs.org/en) is installed, as the deploy script runs on node.

## Deploy

```sh
composer run-script deploy
```

On the first deploy, you will be walked through an interactive Google Cloud project creation wizard (or can select an existing Google Cloud project) to which the app will be deployed.

## Acknowledgements

Below are a number of resources that I found useful in implementing this:

- [1EdTech's unmaintained lti-1-3-php library](https://github.com/1EdTech/lti-1-3-php-library) gave some helpful information about endpoints.
- [1EdTech;s unmaintined lti-1-3-php-example-tool](https://github.com/1EdTech/lti-1-3-php-example-tool/tree/master) gave some insight into the intended use of their library and further insights into the behavior of endpoints.
- [Packback's lti-1-3-php-library](https://github.com/packbackbooks/lti-1-3-php-library) is actual useful, maintained code on which this depends!
- [Packback's wiki for that library](https://github.com/packbackbooks/lti-1-3-php-library/wiki) was helpful in thinking through their implementation but is (as of this writing) lagging behind their actual implementation by a bit, I think.
- [My own notes in this Packback issue](https://github.com/packbackbooks/lti-1-3-php-library/issues/69) regarding making a full implementation.
- Obviously the [Slim Framework](https://www.slimframework.com/docs/v4/) and their [Slim-Skeleton](https://github.com/slimphp/Slim-Skeleton/tree/main) were helpful starting points for the structure of the Slim app! I find it more useful to bring in the pieces of the skeleton as-needed, rather than starting with the app template.
- The [LTI Debugger Chrome Extension](https://chromewebstore.google.com/detail/lti-debugger/cpjdeioljkbgkldnbojoagdoiggnlhll) which adds another tab to the Developer Console, which was about the only thing of value that I was able to pull from [1EdTech's LTI Bootcamp](https://github.com/1EdTech/ltibootcamp), which everyone else links to as a great resource. It may prove useful as I get more into the specifics of deep linking?

#### Dynamic Registration

Looking ahead, I intend to implement dynamic registration. I am finding the following helpful in this (although the choice between LTI 1.3 Dynamic Registration and LTI 2.0 Dynamic Registration is unclear to me -- the former seems like the path forward, while the latter seems to exist in the wild.)

- [Rahul Khedekar's LTI 1.3 Dynamic Registration Process](https://blog.nonstopio.com/lti-1-3-dynamic-registration-process-cf0bdbfc2a29)
- [1EdTech (née IMS Global)'s LTI Dynamic Registration Spec v1.0](https://www.imsglobal.org/spec/lti-dr/v1p0)
- [1EdTech (née IMS Global)'s LTI v2.0 Implementation Guide](https://www.imsglobal.org/specs/ltiv2p0/implementation-guide)
- [Anthology's Registering and Managing a REST or LTI Application](https://docs.anthology.com/docs/developer-portal/creating-new-rest-or-lti-application)
- [LTIASS's Performing Dynamic Registration](https://docs.ltiaas.com/guides/api/dynamic-registration/)
40 changes: 40 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "groton-school/lti",
"license": "GPL-3.0",
"version": "0.0.0",
"authors": [
{
"name": "Seth Battis",
"email": "sbattis@groton.org"
}
],
"require": {
"google/appengine-php-sdk": "^2.2",
"google/cloud-firestore": "^1.48",
"google/cloud-logging": "^1.32",
"guzzlehttp/guzzle": "^7.9",
"packbackbooks/lti-1p3-tool": "^6.2",
"php-di/php-di": "^7.0",
"slim/psr7": "^1.7",
"slim/slim": "^4.14",
"vlucas/phpdotenv": "^5.6"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.68",
"marcocesarato/php-conventional-changelog": "^1.17",
"symplify/monorepo-builder": "^11.2"
},
"replace": {
"groton-school/slim-lti-gae-shim": "self.version",
"groton-school/slim-lti-shim": "self.version"
},
"autoload": {
"psr-4": {
"GrotonSchool\\SlimLTI\\": "packages/slim-lti-shim/src/",
"GrotonSchool\\SlimLTI\\GAE\\": "packages/slim-lti/src/"
}
},
"config": {
"sort-packages": true
}
}
Loading

0 comments on commit 5bd3073

Please sign in to comment.