API Referencia¶
Overené podľa implementácie dňa 2026-05-07.
Zdroj pravdy pre kontrakt¶
src/app/api/*src/app/schemas/*- runtime
GET /openapi.json(v development/debug režime) - error kontrakty v
src/app/api/contracts.py
Dôležité upresnenie¶
GitPulse nepoužíva JWT login endpoint typu /api/v1/auth/login.
Autentifikácia je riešená troma režimami:
- Dashboard: GitLab OAuth + session cookie.
- API: statický bearer token (
TEACHER_API_TOKEN) alebo dashboard session. - Webhook endpoint:
X-Gitlab-Token.
Základné prefixy¶
| Oblasť | Prefix | Poznámka |
|---|---|---|
| REST API | /api/v1 | CRUD, sync, rubrics, telemetry, jobs |
| Dashboard | /dashboard | server-rendered UI + JSON endpointy |
| Ops | /health, /metrics | healthcheck a Prometheus scrape |
Health a ops endpointy¶
GET /healthGET /health/liveGET /health/readyGET /metrics
Príklad:
API autentifikácia - príklady¶
Bearer token¶
Webhook endpoint¶
| Bash | |
|---|---|
Endpoint inventory (zgrupované)¶
Celkový scan: 200+ route handlerov.
Core API¶
- Kurzy:
/api/v1/courses/* - Tímy:
/api/v1/teams/* - Študenti:
/api/v1/students/* - Projekty:
/api/v1/projects/* - Používatelia:
/api/v1/users/*
Event pipeline¶
- Webhook ingest:
POST /api/v1/webhooks/gitlab - DLQ/replay:
/api/v1/events/*
Synchronizácia a joby¶
- Sync:
/api/v1/teams/{team_id}/sync,/api/v1/courses/{course_id}/sync-all - Recheck:
/api/v1/teams/{team_id}/recheck- okamžité prepočítanie metrik (force all checks) - Job status/SSE:
/api/v1/jobs/{job_id},/api/v1/jobs/{job_id}/stream
Hodnotenie¶
- Rubrics:
/api/v1/courses/{course_id}/rubrics,/api/v1/rubrics/{rubric_id}/* - Reporty:
/api/v1/teams/{team_id}/report,/api/v1/reports/{filename}
Rozšírenia¶
- LLM:
/api/v1/llm/mr/{project_id}/{mr_iid} - Docker verify:
/api/v1/docker-verify/report - GitLab parse:
/api/v1/gitlab/parse-url
Telemetria¶
/api/v1/telemetry/*(activity, flags, compliance snapshots, feedback, report preview)
Dashboard routy¶
/dashboard/* obsahuje:
- login/logout/OAuth callback
- dashboard pre kurzy, tímy, študentov, projekty
- rubric UI
- admin sekcie (users, courses, system, events)
Mermaid mapa API domén¶
flowchart TB
API["/api/v1"]
API --> C["Courses"]
API --> T["Teams"]
API --> S["Students"]
API --> P["Projects"]
API --> U["Users"]
API --> E["Events/Webhooks"]
API --> R["Rubrics"]
API --> SY["Sync + Jobs"]
API --> TE["Telemetry"]
API --> X["LLM / Docker Verify / GitLab Parse"] OpenAPI export¶
| Bash | |
|---|---|
Poznámka: openapi.json, /docs, /redoc sú dostupné v development/debug režime.
Súvisiace dokumenty¶
- Architektúra
- GitLab webhooky
- Monitoring
- Detailný route inventory:
docs/04-api-spec.md