How kth/kursinfo-admin-web works
System Overview
The project is a microservice-based web application that serves as an administration tool for teachers to manage course information at KTH. Here's how to structure the main components:
Main Components
a. Frontend Layer:
• React-based SPA (located in /public/js/app)
• Key pages: AdminStartPage, CourseEditStartPage, DescriptionPage
• Shared components and context providers
• CKEditor integration for rich text editing
b. Backend Layer:
• Node.js Express server (in /server)
• Controller layer (/server/controllers)
• API integration layer (/server/apiCalls)
• Server-side rendering support (/server/ssr-context)
c. External Services:
• KOPPS-API (course information source)
• kursinfo-api (course data storage)
• Azure Blob Storage (image storage)
• Redis (caching layer)
[Client Layer]
• ↕️
[Application Layer]
• ↕️
[External Services Layer]
Detailed Component Representation
Client Layer:
┌─ React Frontend ─────────────────┐
• Admin Dashboard │
• Course Editor │
• Image Management │
• CKEditor Integration │
• ┘
Application Layer:
┌─ Express Server ──────────────┐
• ┌─ Controllers ─────────────┐ │
• Admin Pages │ │
• Description │ │
• Image │ │
• ┘ │
• ┌─ API Integration ───────┐ │
• KOPPS API Client │ │
• KursInfo API Client │ │
• ┘ │
• ┘
External Services Layer:
┌─ Storage ─────┐ ┌─ APIs ──────┐ ┌─ Cache ────┐
• Azure Blob │ │ KOPPS API │ │ Redis │
• Storage │ │ KursInfo API│ │ │
• ┘ └────────────┘ └────────────┘
Important Flows to Highlight
a. Authentication Flow:
• How user roles (coordinators/examiners) affect access
b. Data Flows:
• Course information retrieval from KOPPS-API
• Image upload to Azure Blob Storage
• Cache interaction for frequently accessed data
c. API Interactions:
• Bidirectional communication with kursinfo-api
• Cached vs direct KOPPS-API calls
Additional Elements
• Component types
• Authentication boundaries
• Caching mechanisms
Technical Details to Note
• Node.js 18 runtime
• Server-side rendering capability
• Redis caching for KOPPS-API responses
• Azure Blob Storage for image management
• Handlebars templating for views
• React for client-side interactivity
Remember to indicate the development, reference, and production environments as they have different configurations (as evidenced by the .azure directory structure).
This system design should help developers understand both the high-level architecture and the specific implementation details of the kursinfo-admin-web service.