Files
HIPCTF2/docs/api/system.md
T

2.4 KiB

type, title, description, tags, timestamp
type title description tags timestamp
api System Endpoints Bootstrap payload, event status, and SSE streams.
api
system
bootstrap
event
sse
2026-07-21T18:28:00Z

Endpoints

Method Path Auth Source
GET /api/v1/bootstrap Public backend/src/modules/system/system.controller.ts
GET /api/v1/event/status Public Same.
GET /api/v1/event/stream Public (SSE) Same.
GET /api/v1/scoreboard/stream Public (SSE) Same.

GET /api/v1/bootstrap

Built by SystemService.bootstrap(). Public payload consumed by the SPA's BootstrapService:

{
  "initialized": true,
  "pageTitle": "HIPCTF",
  "logo": "",
  "welcomeMarkdown": "# Welcome\n\n...",
  "theme": { "id": "classic", "tokens": { "...": "..." } },
  "defaultChallengeIp": "127.0.0.1",
  "registrationsEnabled": false
}
  • initialized is true iff at least one admin user exists.
  • theme is the resolved Theme (one of the 10 canonical themes; see Theming).
  • registrationsEnabled is read from the setting table (SETTINGS_KEYS.REGISTRATIONS_ENABLED) and gates the new public register endpoint (see Auth Endpoints).

GET /api/v1/event/status

Returns the current event window computed by EventStatusService:

{ "state": "Running", "countdownMs": 12345, "startUtc": "...", "endUtc": "..." }

state is Stopped when now < eventStartUtc (countdown), Running between start and end, and Stopped once now >= eventEndUtc.

SSE streams

  • /api/v1/event/stream — emits the same payload as GET /api/v1/event/status whenever SseHubService.publish is invoked (typically via an admin cron tick).
  • /api/v1/scoreboard/stream — emits the public scoreboard projection after each new solve.

Both use NestJS @Sse() and are proxied through SseHubService (backend/src/common/services/sse-hub.service.ts).

See also