{"id":23819846,"url":"https://github.com/kth/kurs-pm-admin-web","last_synced_at":"2026-03-07T12:33:19.240Z","repository":{"id":41306641,"uuid":"199641442","full_name":"KTH/kurs-pm-admin-web","owner":"KTH","description":"Innehåller tjänster för att ladda upp kurs-PM som PDF och publicera kurs-PM för en specifik kursomgång,","archived":false,"fork":false,"pushed_at":"2024-08-28T06:30:13.000Z","size":6520,"stargazers_count":2,"open_issues_count":10,"forks_count":0,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-08-28T09:24:32.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KTH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-30T11:48:29.000Z","updated_at":"2024-08-28T06:29:11.000Z","dependencies_parsed_at":"2023-11-20T11:28:21.923Z","dependency_job_id":"21b38bf4-83bb-4d2e-93ec-8c5b8d3ecef6","html_url":"https://github.com/KTH/kurs-pm-admin-web","commit_stats":null,"previous_names":[],"tags_count":2140,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkurs-pm-admin-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkurs-pm-admin-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkurs-pm-admin-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkurs-pm-admin-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KTH","download_url":"https://codeload.github.com/KTH/kurs-pm-admin-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232163089,"owners_count":18481581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-02T07:16:04.502Z","updated_at":"2026-03-07T12:33:19.193Z","avatar_url":"https://github.com/KTH.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to kurs-pm-admin-web\n\n![Prerequisite](https://img.shields.io/badge/node-18-blue.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](#)\n\n## Introduction\n\nThe course information project (KIP) is an initiative at KTH that was launched in 2018 to improve the quality and availability of information about KTH:s courses. The background to the project is, among other things, that it was difficult for the student to find information about the courses and even more difficult to compare information about several courses. The reason for the problems is scattered course information in several places and that there is no uniformity or assigned places for the course information. The project takes measures to consolidate course information into two locations and to present the information in a manner that is uniform for KTH. The student should find the right information about the course, depending on their needs. The result of the project is a public course site where the correct course information is collected and presented uniformly. Also, a tool is developed for teachers to enter and publish course information. Eventually, this will lead to the student making better decisions based on their needs, and it will also reduce the burden on teachers and administration regarding questions and support for the student.\n\n**Kurs-pm-admin-web** is a microservice with an administration tool for teachers to upload a course memo in a **.pdf** format. It saves pdf to a blob storage directly, while information about which course offering it belongs to and other metadata are send to `kurs-pm-api` which later saves it to the common with `kurs-pm-data-api`database.\n\n### 🏠 [Homepage](https://github.com/KTH/kurs-pm-admin-web)\n\n## Overview\n\nFirstly, the app has only one function. It is to upload a course memo pdf file to a blob storage and send data about it to `kurs-pm-api`.\nLater this files can be found on public pages 'About course memo' served by `kurs-pm-web` and for a short time on pages served by `kursinfo-web`.\nUser can choose several course offerings and upload the same course memo file. It will be upload once in blob storage while in a database data about file and course offering will be saved per course offering. User can delete uploaded course memo or replace by a new one. The history of uploaded course-memos will be saved in api data.\n\nThe app consists of one page which is used to upload a new memo or to replace a published one. To do it user will go through three step:\n\n- Choose a course offering(s), upload a pdf file, review it and publish it.\n\n```\nlocalhost:3000/kursinfoadmin/pm/:courseCode\n```\n\n### API:s\n\nApplication is fetching data from LADOK for:\n\n- Course title\n- Course offerings which are/were active for this course\n\nApplication is fetching data from KURS-PM-API for:\n\n- Fetch course offerings which have a published course memo to sort per termin and filter course offerings fetched from LADOK.\n\n- Fetch information about course memo file and course offering it saved for if user want to replace a published course memo file\n\n- [https://github.com/KTH/kurs-pm-api](https://github.com/KTH/kurs-pm-api)\n\n### Related projects\n\n- [https://github.com/KTH/kursinfo-web](https://github.com/KTH/kursinfo-web)\n- [https://github.com/KTH/kurs-pm-web](https://github.com/KTH/kurs-pm-web)\n- [https://github.com/KTH/kurs-pm-api](https://github.com/KTH/kurs-pm-api)\n\nWe must try to make changes that affect the template projects in the template projects themselves.\n\n- [https://github.com/KTH/node-web](https://github.com/KTH/node-web)\n\n## Prerequisites\n\n- node 18\n\nBecause OICD library is compatible only with node 12.0.0 or \u003e 14.2.0\n\n### Blob storage. Generate Shared access signature\n\n- blob container (STORAGE_CONTAINER_NAME) `memo-blob-container`\n- Allowed permissions: _Read, Write, Delete, Create_\n\nWhile images uploads directly to a blob container located in a cloud in the storage account, f.e., `kursinfostoragestage`, the name of uploaded image will be saved in `kurs-pm-api`.\nTo connect to blob storage, the Shared access signature is used to limit what can be done by using this signature, f.e., only read, or write and which services. In stage environment keys were generated on base of key2.\nFor each service generated a separate Shared access signature and saved(f.e., SAS-REF-blob-service-sas-url-kurs-pm-admin-web) in standard key vault.\n\nIt requires package `\"@azure/storage-blob\": \"^12.2.1\"`. Further to parse a file between client and server, you need to have npm package `body-parser`. More details in `server/blobStorage.js`.\n\n#### Blob storage. Generate Shared access signature\n\nTo generate it, go to a storage account, f.e., `kursinfostoragestage`, choose Shared Access signature and choose:\n\n- Allowed services: _Blob_\n- Allowed resource types: _Object_\n- Allowed permissions: _Read, Write, Delete, Create_\n- Start and expiry date/time\n- HTTPS only\n- Signing key: key1 or key2\n\nAfter a generation of a key, copy **Blob service SAS URL** and save it in a standard key vault and set **Expiration Date**.\nLater you will use it as a _BLOB_SERVICE_SAS_URL_ in secrets together with a name of blob container STORAGE_CONTAINER_NAME\n\n### Secrets for Development\n\nSecrets during local development are stored in a gitignored `.env` file (`env.in` can be used as template for your `.env` file). More details about environment variable setup and secrets can be found in [confluence](https://confluence.sys.kth.se/confluence/x/OYKBDQ).\n\n### Install\n\n```sh\nnpm install\n\n```\n\nYou might need to install as well:\n\n```sh\nnpm install cross-env\nnpm install concurrently\n```\n\n- `mini-css-extract-plugin` requires installation by `yarn` therefore it's added in `postinstall` step\n\n### Usage\n\nStart the service on [http://localhost:3000/kursinfoadmin/pm/:courseCode](http://localhost:3000/kursinfoadmin/pm/:courseCode).\n\n```sh\nnpm run start-dev\n```\n\n### Debug in Visual Studio Code\n\nIt's possible to use debugging options available in Visual Studio Code\nAdd a file `launch.json` to `.vscode` directory :\n\n- _Microsoft_\n\n```json\n{\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"node\",\n      \"request\": \"launch\",\n      \"name\": \"Debug kurs-pm-admin-web\",\n      \"program\": \"${workspaceFolder}\\\\app.js\",\n      \"envFile\": \"${workspaceFolder}\\\\.env\",\n      \"env\": {\n        \"NODE_ENV\": \"development\"\n      }\n    }\n  ]\n}\n```\n\n- _Mac, Unix and so on_\n\n```json\n{\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"node\",\n      \"request\": \"launch\",\n      \"name\": \"Debug kurs-pm-admin-web\",\n      \"program\": \"${workspaceFolder}/app.js\",\n      \"envFile\": \"${workspaceFolder}/.env\",\n      \"env\": {\n        \"NODE_ENV\": \"development\"\n      }\n    }\n  ]\n}\n```\n\n## Run tests\n\n```sh\nnpm run test\n```\n\n## Use 🐳\n\n`API_URI` in `docker-compose.yml` is configured for a local kurs-pm-api, and might as well be changed to kurs-pm-api in ref.\n\n```sh\ndocker-compose up\n```\n\n## Author\n\n👤 **KTH**\n\n- Website: https://kth.github.io/\n- Github: [@KTH](https://github.com/KTH)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fkurs-pm-admin-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkth%2Fkurs-pm-admin-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fkurs-pm-admin-web/lists"}