Scoreboard Feature Architecture
System Architecture Diagram
Section titled βSystem Architecture Diagramβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Frontend (Svelte/TS) ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ ββββββββββββββββββββββββ ββββββββββββββββββββββββ ββ β /scoreboard β β Homepage section β ββ β (Public) β β (random sample) β ββ β β β β ββ β - Paginated table β β - Pipeline cards β ββ β - Sortable columns β β - Success summary β ββ β - Entity display β β - Entity links β ββ ββββββββββββββββββββββββ ββββββββββββββββββββββββ ββ β β ββββββββββββββΌββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββ β β ββββββββββββββββ¬βββββββββββββββ β βΌ ββββββββββββββββββββββββ β PocketBase API β β pipeline_scoreboard_ β β cache β ββββββββββββββββββββββββ β² βββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββ Backend (Go + Temporal) ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β AggregateScoreboardWorkflow (Temporal) β ββ β β ββ β 1. List org namespaces β ββ β 2. GET /api/pipeline/scoreboard/{namespace} per tenant β ββ β 3. Merge pipeline stats β ββ β 4. POST /api/pipeline/scoreboard/save-results β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β Scoreboard handlers (pkg/internal/apis/handlers) β ββ β β ββ β - GET /api/pipeline/scoreboard/{namespace} β ββ β - POST /api/pipeline/scoreboard/save-results β ββ β - POST /api/pipeline/scoreboard/aggregate/start β ββ β - DELETE /api/pipeline/scoreboard/aggregate/schedule/{id} β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β βββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββ β βΌ ββββββββββββββββββββββββββ β PocketBase Collections β ββββββββββββββββββββββββββ€ β - pipeline_scoreboard_ β β cache (read model) β β - pipeline_results β β - pipelines β β - wallets, issuers, β β verifiers, etc. β ββββββββββββββββββββββββββData Flow
Section titled βData FlowβPublic Scoreboard Flow
Section titled βPublic Scoreboard Flowβ- User navigates to
/scoreboard - SvelteKit
loadcallsScoreboard.loadData()from$lib/scoreboard - Frontend queries PocketBase
pipeline_scoreboard_cachewith expanded relations ScoreboardTablerenders a paginated, sortable TanStack table- Rows link to Hub pipeline pages via entity display helpers
Homepage Summary Flow
Section titled βHomepage Summary Flowβ- Public homepage loads
loadScoreboardSummary()fromscoreboard-section.svelte - Frontend fetches a small random sample from
pipeline_scoreboard_cache - Cards show pipeline name, success rate, and related entities
Aggregation Flow
Section titled βAggregation Flowβ- An operator or scheduler starts
POST /api/pipeline/scoreboard/aggregate/start - Temporal runs
AggregateScoreboardWorkflowin thedefaultnamespace - For each org namespace, the workflow calls
GET /api/pipeline/scoreboard/{namespace} - Per-namespace stats are merged and posted to
POST /api/pipeline/scoreboard/save-results pipeline_scoreboard_cacheis refreshed (truncate + upsert by pipeline)
Integration Points
Section titled βIntegration PointsβCurrent State
Section titled βCurrent Stateβ- Public scoreboard UI at
/scoreboard - Homepage scoreboard section on the public landing page
- PocketBase-backed read model (
pipeline_scoreboard_cache) - Temporal aggregation workflow and save endpoint
- Shared frontend module at
webapp/src/lib/scoreboard
Removed
Section titled βRemovedβ/my/scoreboardand/my/scoreboard/[type]/[id]routes- Legacy tabbed scoreboard UI and OpenTelemetry viewer
/api/my/resultsand/api/all-resultshandlers (commented out inscoreboard_handler.go)
File Structure
Section titled βFile Structureβcredimi/βββ pkg/internal/apis/handlers/β βββ scoreboard.go (active aggregation + save handlers)β βββ scoreboard_handler.go (legacy OTel handler, commented out)β βββ scoreboard_test.goβββ pkg/workflowengine/workflows/β βββ scoreboard.go (AggregateScoreboardWorkflow)βββ webapp/src/lib/scoreboard/β βββ index.tsβ βββ functions.ts (PocketBase query)β βββ table.svelte / table.svelte.tsβ βββ columns/ (TanStack column definitions)β βββ entity-display/ (avatars, lists, links)β βββ extras/pipeline-content-summary.svelteβββ webapp/src/routes/β βββ (public)/scoreboard/β β βββ +page.tsβ β βββ +page.svelteβ βββ (public)/_partials/scoreboard-section.svelteβββ docs/ βββ SCOREBOARD.md βββ ARCHITECTURE.md (this file) βββ SUMMARY.md