The 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.
Kursplan-api is a microservice to generate course syllabuses for (kursinfo-web), (kursutveckling-web) and (kurs-pm-web) It uses Node.js, and is based on https://github.com/KTH/node-api.
🏠 Homepage
Kursplan-api generates syllabuses from Kopps data. Swagger is used for API documentation.
Syllabuses are generated in HTML
or as PDF
files.
This API is independent and will not break other projects but it is important remember it is logically connected to the bigger picture of course information.
- Node.js 18.0.0
npm install
Start the service on localhost:3001/api/kursplan/swagger.
npm run start-dev
Secrets and docker-compose are located in cellus-registry.
localhost:3001/api/kursplan/_monitor
To see more detailed behaviour in project, use Application Insights
, e.g., kursinfo-web-stage-application-insights-kthse
.
Copy docker-compose.yml.in
to docker-compose.yml
and make necessary changes, if any.
docker-compose up
The deployment process is described in Build, release, deploy. Technical details, such as configuration, is described in How to deploy your 🐳 application using Cellus-Registy and 🔧 How To Configure Your Application For The Pipeline.
ansible-vault edit secrets.env
Password find in gsv-key vault
Secrets 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).
The application has an endpoint that generates a PDF syllabus. The PDF file is generated with React-pdf. Syllabus data in HTML
will be parsed into React
elements with html-react-parser, before they are added to the document element tree.
React
components are converted with Babel into./components-dist/
.
Syllabus
|-- SyllabusDocument
| |-- SyllabusPages
| |-- SyllabusHead
| |-- SyllabusKeyInformation
| |-- SyllabusBody
| |-- SyllabusPageFooter
|-- SyllabusHtmlParser
|-- SyllabusStyles
Entry point component. Renders SyllabusDocument
component.
Renders wrapping Document
component, and SyllabusPages
.
Renders Page
component containing the syllabus’s pages. Inside the Page
SyllabusHead
, SyllabusKeyInformation
, and SyllabusBody
components are rendered for the syllabus content, and aSyllabusPageFooter
component for the syllabus’s footers.
Renders KTH logotype, syllabus heading, and such.
Renders syllabus key information.
Renders syllabus main content with Section
components. Contains logic for determining which data to use for certain sections.
Renders footer text and page numbers.
Parses HTML
data into React
elements. Called from SyllabusBody
.
Contains all styles for PDF components.
👤 KTH
- Website: https://kth.github.io/
- Github: @KTH