Get Hedhog updates in your inbox
New releases, fresh recipes, and breaking changes — no spam.
LMS Submodule
platforma
The student-facing LMS portal — course catalog and player, video/HLS/subtitle streaming via signed tokens, lesson notifications (with an SSE stream), learning streak, lesson evaluations, BitCode wallet self-service, watch-time heartbeats, performance dashboards, and profile management.
Source path: libraries/lms/src/platforma
Module file: (none — registered directly in lms.module.ts)
Introduction
Platforma (the Portuguese word for "platform" — note the controller class is literally `PlataformaController`, while every file, service, and the `/lms/platforma` route prefix use the English spelling, a pre-existing naming inconsistency in the codebase) is structurally unique among LMS submodules: it has no dedicated `*.module.ts`. `PlataformaController` and all five of its backing services (`PlatformaService`, `PlatformaVideoService`, `PlatformaHeartbeatService`, `PlatformaPerformanceService`, `PlatformaSearchService`) plus two queue/event handlers are registered directly in the root `LmsModule`, rather than each submodule owning its own module file as everywhere else in this library.
The controller is decorated `@NoRole()` rather than `@Role()` — any authenticated user can call it, with no specific platform role required — except for a cluster of streaming routes (`/video/:token`, `/hls/:token/...`, `/subtitles/:token/captions.vtt`) which are `@Public()`: the security model for video delivery is the signed, time-limited token itself rather than a session check, since a video player or `<video>` tag cannot attach an Authorization header to a manifest/segment request. Tokens are minted by the `@NoRole()` endpoints (`video-token`, `hls-token`, `subtitles-token`) and then handed to the public streaming endpoints.
Beyond video, Platforma aggregates several other submodules behind one learner-friendly surface: notifications (list/unread-count/mark-read/delete, plus a `GET /notifications/stream` SSE endpoint for live push), the learning streak and its activity registration, lesson evaluation submission (delegating to `EvaluationService.getCourseLessonTopics`/`getMyLessonRatings`/`submitLessonRatings`, which are not otherwise exposed by the Evaluations submodule's own controller), a self-service BitCode wallet view and transaction endpoint, a cross-entity search across courses/paths/exams/classes/instructors, and a watch-time heartbeat endpoint that enqueues async jobs (ip/user-agent/position/session) consumed by `LessonHeartbeatHandler` to drive engagement analytics and the performance dashboard. Two endpoints (lesson evaluation submission and streak-activity registration) accept plain inline body shapes with no class-validator DTO behind them.
HTTP Endpoints
32 endpoints
Student dashboard (home alias).
Student learning dashboard.
Browses published courses.
- Query
- page, pageSize, search, category, sort
Gets a published course by slug.
- Params
- slug (string)
Cross-entity search across courses, learning paths, exams, class groups, and instructors.
- Query
- q, types? (csv), pageSize? (default 5)
Lesson detail.
- Params
- lessonId (int)
Issues a signed token for progressive video playback.
- Params
- lessonId (int)
- Query
- quality?
Issues a signed token for HLS streaming.
- Params
- lessonId (int)
Streams progressive video bytes; the signed token is the only auth.
- Params
- token (string)
Serves the HLS master manifest.
- Params
- token (string)
Serves an HLS variant playlist.
- Params
- token (string), variant (string)
Serves an individual HLS media segment.
- Params
- token, variant, segment (string)
Issues a signed token for subtitles, if transcription segments exist.
- Params
- lessonId (int)
Evaluation rating topics configured for the lesson.
- Params
- lessonId (int)
The caller's existing ratings for the lesson.
- Params
- lessonId (int)
Submits or updates the caller's lesson ratings.
- Params
- lessonId (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| ratings | { topicId, score, comment? }[] | yes | Plain inline type, not a validated DTO |
Serves a VTT captions file by token.
- Params
- token (string)
Lists the caller's notifications.
- Query
- page, pageSize, search, sortField, sortOrder
Unread notification count.
Marks all notifications read.
Marks one notification read.
- Params
- id (int)
SSE stream for real-time notification delivery.
Deletes one notification.
- Params
- id (int)
Deletes all of the caller's notifications.
The caller's learning streak data.
- Query
- days?
Registers a streak-triggering activity.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| activityType | string | no | Plain inline type, not a validated DTO |
| source | string | no | — |
| activityDateKey | string | no | — |
The caller's own BitCode wallet.
Creates a transaction on the caller's own wallet.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| type | 'credit' | 'debit' | no | — |
| amount | number | yes | Min 1 |
| description | string | no | Max 2000 chars |
| source | string | no | Max 200 chars |
Aggregated KPIs, study-hours chart, area performance, accuracy distribution, and ranking.
- Query
- period? (default '30d')
Enqueues a lesson-watch heartbeat job for async engagement tracking.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| lessonId | number | yes | — |
| positionSeconds | number | yes | Min 0 |
| sessionId | string | no | — |
| screenWidth | number | no | 1–10000 |
| screenHeight | number | no | 1–10000 |
| isTouch | boolean | no | — |
Combined user + person profile data.
Updates the caller's name and/or person profile fields in one transaction.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| name | string | no | — |
| cpf | string | no | — |
| dob | string | no | — |
| gender | string | no | — |
| country | string | no | — |
| city | string | no | — |
| state | string | no | — |
| neighborhood | string | no | — |
| street | string | no | — |
| number | string | no | — |
| complement | string | no | — |
| zip | string | no | — |
| phone | string | no | — |
| profession | string | no | — |
MCP Tools
No MCP tools mapped for this submodule.