Logotipo Hedhog

Get Hedhog updates in your inbox

New releases, fresh recipes, and breaking changes — no spam.

Back to LMS modulesLMS Submodule

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)

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

FieldTypeRequiredNotes
ratings{ topicId, score, comment? }[]yesPlain 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

FieldTypeRequiredNotes
activityTypestringnoPlain inline type, not a validated DTO
sourcestringno
activityDateKeystringno

The caller's own BitCode wallet.

Creates a transaction on the caller's own wallet.

Body

FieldTypeRequiredNotes
type'credit' | 'debit'no
amountnumberyesMin 1
descriptionstringnoMax 2000 chars
sourcestringnoMax 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

FieldTypeRequiredNotes
lessonIdnumberyes
positionSecondsnumberyesMin 0
sessionIdstringno
screenWidthnumberno1–10000
screenHeightnumberno1–10000
isTouchbooleanno

Combined user + person profile data.

Updates the caller's name and/or person profile fields in one transaction.

Body

FieldTypeRequiredNotes
namestringno
cpfstringno
dobstringno
genderstringno
countrystringno
citystringno
statestringno
neighborhoodstringno
streetstringno
numberstringno
complementstringno
zipstringno
phonestringno
professionstringno

MCP Tools

No MCP tools mapped for this submodule.