xyng / yuoshi-studip-plugin

Stud.IP Plugin to provide an API and a management-tool for integrating with yUOShi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yUOShi Integration for Stud.IP

This repository contains an extension for the Stud.IP-Software to provide an API as well as a management-tool for data required and sent by the yuoshi learning platform.

It depends on the JsonApiPlugin that will probably be integrated into the Stud.IP core in foreseeable future.

Installation

Install the yuoshi-x.x.x.zip-File provided under releases in your Stud.IP-Instance. Please consult the Stud.IP-Manual for help with this.

Steps after installation

Register your yUOShi-Application as an API-Application to obtain OAuth-Tokens. Provide those to your yUOShi-Instance. Activate this plugin in the Course(s) you want to use yUOShi in. Make sure this plugin is accessible for the Stud.IP-Group nobody. (This step is handled at Setup, but please double-check!) This is required for the JsonApiPlugin to recognize this plugin. Authentication is applied by this plugin later.

Compiling yourself

You can also compile this plugin yourself. You need the following packages to accomplish this. (You can alternatively use the included Dockerfile to compile it - batteries are included there 😉)

  • yarn
  • php (at least Version 7.2.)
    • Required Extensions:
    • ext-phar
    • ext-json
    • ext-mbstring
    • ext-openssl
    • ext-ctype
    • ext-dom
    • (depending on your system, most of them may already be installed.)
  • composer
  • make (should probably already be on your system)
  • zip (should probably already be on your system)

Copy the file .webpack.env.example to .webpack.env. Adjust values as needed. Please not that the variable STUDIP_URL is ignored for production builds.

If you are all set, simply run make. After it finishes, you will find a file called yuoshi.zip in the project-root. Use this file to install the plugin in your Stud.IP-Instance.

Building with the Dockerfile

You do not need to have the aforementioned packages when you are using docker to build. Note that this does require you to have docker installed and set up. Furthermore, this is only applicable to production builds - the development environment has to run on your machine for the time being.

Steps:

  1. Build the image with the docker/build/Dockerfile. Run something like: docker build ./docker/build -t yuoshi_build_env
  2. Use the created Docker-Image to run the make-process: docker run --rm yuoshi_build_env make

Contributing

To contribute to this project, you need the same packages installed as for compiling for production as well as the .webpack.env-File (see above). Clone this project into the following directory (case-sensitive!): STUDIP_ROOT/public/plugins_packages/xyng/Yuoshi, where STUDIP_ROOT is the root-directory of your Stud.IP-Instance.

To set up all dependencies, run:

yarn
composer install

(The path to your composer binary may vary - please adjust as needed.)

To start a development-server for the management-tool, run yarn run start. This will start a webpack-dev-server that proxies your local Stud.IP-Instance (accessible with the STUDIP_URL given in the .env file). All assets except those created by this build-system are served from your Stud.IP-Instance. Assets from this build-system are served from memory. As we use information from the build-manifest generated by webpack to load the assets in the plugin, you may have to wait for the first build to finish before loading the page.

Code-Style and Linting

Please check the Linting output by the build process. You can use to following tools to resolve easy problems:

  • yarn run lint-fix: Is able to fix many problems shown by the linter.
  • yarn run format: Formats your code according to the specifications.

Above commands are automatically run when you commit changes to JavaScript or TypeScript files. Please check for linting issues (like undefined variables or missing hook dependencies to name a few common ones) before committing and fix them accordingly.

About

Stud.IP Plugin to provide an API and a management-tool for integrating with yUOShi

License:MIT License


Languages

Language:TypeScript 54.4%Language:PHP 43.7%Language:JavaScript 1.0%Language:CSS 0.8%Language:Makefile 0.0%Language:Dockerfile 0.0%Language:Hack 0.0%