Reference
Function index
Every named function or module in this atlas, where it runs, and the page that explains it. Names match the code layout in the repository.
| Name | Layer | Purpose | Page |
|---|---|---|---|
verifyJWT | API middleware | Validate token, set req.user | Security |
attachRole | API middleware | Load roles, require approved, set req.role | Security |
authorizeRoute | API middleware | Route vs nav_item_roles | Security |
injectRLSContext | API middleware | BEGIN, set_config identity, expose req.db | Security |
protect | API middleware | The four stages in order | Security |
keyByUserOrIp | API limits | Rate-limit key | Security |
generalApiLimiter, aiGenerationLimiter, certificateIssueLimiter | API limits | Per-user rate limits | Security |
saveUpload | API files | Validate and write an upload | Ingestion and embeddings |
createResource, enqueueEmbedJob | API resources | Insert row and queue job | Ingestion and embeddings |
claim_job | ai-service | Take one queued job atomically | Ingestion and embeddings |
extract_text, chunk_text | ai-service | Text extraction and chunking | Ingestion and embeddings |
embed | ai-service | Ollama embedding call, 768 dims | Ingestion and embeddings |
store_chunks, mark_done, mark_failed | ai-service | Persist and finish a job | Ingestion and embeddings |
generateQuestionnaire | API assessments | Draft route handler | Assessments |
selectChunks, buildPrompt | API assessments | Context and prompt for the provider | Assessments |
getProvider, provider.generate | API ai | Vertex or Ollama behind AI_PROVIDER | Assessments |
parseAndValidate | API ai | Check the model reply | Assessments |
saveDraft, publishQuestionnaire | API assessments | Persist and publish | Assessments |
submitAttempt, scoreAttempt | API assessments | Server-side scoring, one attempt | Assessments |
embedTrainerProfile, embedCourse | ai-service | Refresh competency embeddings | Competency matching |
suggestTrainers, matcherPool | API competency | Top-5 ranking under BYPASSRLS | Competency matching |
streamResource | API files | Authenticated download | Files and certificates |
issueCertificate, issueCohortCertificates | API certificates | Render, store, record | Files and certificates |
renderCertificateHtml, escapeHtml, renderPdf | API certificates | Template and Gotenberg call | Files and certificates |
fetchNav, NavRenderer, CoursesApp | portal | Sidebar and section router | Web and mobile |
appRedirect, AuthRepository.refresh | mobile | go_router guard and token refresh | Web and mobile |
Capacity Connect · Team Syntax Squad · SIH 2026 · PS 26075Code samples are implementation sketches.