Skip to content

Scoreboard Feature Architecture โ€‹

System Architecture Diagram โ€‹

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         Frontend (Svelte/TS)                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚  โ”‚ /my/scoreboard       โ”‚      โ”‚ /scoreboard          โ”‚            โ”‚
โ”‚  โ”‚ (Authenticated)      โ”‚      โ”‚ (Public)             โ”‚            โ”‚
โ”‚  โ”‚                      โ”‚      โ”‚                      โ”‚            โ”‚
โ”‚  โ”‚ - 4 Tabs             โ”‚      โ”‚ - 4 Tabs             โ”‚            โ”‚
โ”‚  โ”‚ - Success Rates      โ”‚      โ”‚ - Success Rates      โ”‚            โ”‚
โ”‚  โ”‚ - OTel Data          โ”‚      โ”‚ - OTel Data          โ”‚            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚           โ”‚                             โ”‚                           โ”‚
โ”‚           โ”‚                             โ”‚                           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚                           โ”‚
โ”‚  โ”‚ /my/scoreboard/[type]/[id]     โ”‚    โ”‚                           โ”‚
โ”‚  โ”‚                                โ”‚    โ”‚                           โ”‚
โ”‚  โ”‚ - Summary Cards                โ”‚    โ”‚                           โ”‚
โ”‚  โ”‚ - Test History Chart           โ”‚    โ”‚                           โ”‚
โ”‚  โ”‚ - OTel Span Table              โ”‚    โ”‚                           โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚                           โ”‚
โ”‚                                         โ”‚                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                          โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚                                         โ”‚
                    โ–ผ                                         โ–ผ
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚ GET           โ”‚                      โ”‚ GET              โ”‚
            โ”‚ /api/my/      โ”‚                      โ”‚ /api/all-results โ”‚
            โ”‚ results       โ”‚                      โ”‚                  โ”‚
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚                                         โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                       Backend API (Go)                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚ ScoreboardHandler                                          โ”‚    โ”‚
โ”‚  โ”‚                                                            โ”‚    โ”‚
โ”‚  โ”‚  - HandleMyResults()      - HandleAllResults()            โ”‚    โ”‚
โ”‚  โ”‚  - buildScoreboardResponse()                              โ”‚    โ”‚
โ”‚  โ”‚  - buildOTelData()                                        โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚ Aggregation Functions (Placeholder)                        โ”‚    โ”‚
โ”‚  โ”‚                                                            โ”‚    โ”‚
โ”‚  โ”‚  - aggregateWalletResults()                               โ”‚    โ”‚
โ”‚  โ”‚  - aggregateIssuerResults()                               โ”‚    โ”‚
โ”‚  โ”‚  - aggregateVerifierResults()                             โ”‚    โ”‚
โ”‚  โ”‚  - aggregatePipelineResults()                             โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                            โ”‚                                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                โ”‚ PocketBase Collections โ”‚
                โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
                โ”‚ - wallets              โ”‚
                โ”‚ - wallet_actions       โ”‚
                โ”‚ - credential_issuers   โ”‚
                โ”‚ - verifiers            โ”‚
                โ”‚ - use_cases_verif...   โ”‚
                โ”‚ - pipelines            โ”‚
                โ”‚ - pipeline_results     โ”‚
                โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Data Flow โ€‹

User-Specific Results Flow โ€‹

  1. User navigates to /my/scoreboard
  2. Frontend calls GET /api/my/results with auth token
  3. Backend validates authentication
  4. Backend gets user's organization ID
  5. Backend aggregates data for user's entities
  6. Backend formats response with:
    • Summary tables (wallets, issuers, verifiers, pipelines)
    • OpenTelemetry traces/spans
  7. Frontend displays tabbed interface with results

Public Results Flow โ€‹

  1. User navigates to /scoreboard (public)
  2. Frontend calls GET /api/all-results (no auth required)
  3. Backend aggregates data for all entities
  4. Backend formats response in same structure
  5. Frontend displays public scoreboard

Detail Page Flow โ€‹

  1. User clicks "View Details" on an entry
  2. Frontend navigates to /my/scoreboard/{type}/{id}
  3. Frontend calls GET /api/my/results
  4. Frontend filters results to specific entity
  5. Frontend displays:
    • Summary metrics
    • Test run history
    • OpenTelemetry span details

OpenTelemetry Data Structure โ€‹

OTelTracesData
โ””โ”€โ”€ ResourceSpans[]
    โ”œโ”€โ”€ Resource
    โ”‚   โ””โ”€โ”€ Attributes[]
    โ”‚       โ”œโ”€โ”€ service.name: "credimi"
    โ”‚       โ””โ”€โ”€ service.version: "1.0.0"
    โ””โ”€โ”€ ScopeSpans[]
        โ”œโ”€โ”€ Scope
        โ”‚   โ”œโ”€โ”€ name: "credimi.scoreboard"
        โ”‚   โ””โ”€โ”€ version: "1.0.0"
        โ””โ”€โ”€ Spans[]
            โ”œโ”€โ”€ traceId
            โ”œโ”€โ”€ spanId
            โ”œโ”€โ”€ name
            โ”œโ”€โ”€ kind: "SPAN_KIND_INTERNAL"
            โ”œโ”€โ”€ startTimeUnixNano
            โ”œโ”€โ”€ endTimeUnixNano
            โ”œโ”€โ”€ attributes[]
            โ”‚   โ”œโ”€โ”€ entity.id
            โ”‚   โ”œโ”€โ”€ entity.name
            โ”‚   โ”œโ”€โ”€ entity.type
            โ”‚   โ”œโ”€โ”€ test.total_runs
            โ”‚   โ”œโ”€โ”€ test.success_count
            โ”‚   โ”œโ”€โ”€ test.failure_count
            โ”‚   โ”œโ”€โ”€ test.success_rate
            โ”‚   โ””โ”€โ”€ test.last_run
            โ””โ”€โ”€ status
                โ”œโ”€โ”€ code: "OK" | "ERROR"
                โ””โ”€โ”€ message

Integration Points โ€‹

Current State โ€‹

  • โœ… API routes registered
  • โœ… Frontend pages created
  • โœ… Type definitions complete
  • โœ… OpenTelemetry format implemented
  • โš ๏ธ Using placeholder data

Next Steps โ€‹

  1. Implement real database queries in aggregation functions
  2. Add filtering/sorting to API endpoints
  3. Implement chart visualization in detail pages
  4. Add export functionality
  5. Integrate with external OTel collectors (optional)

File Structure โ€‹

credimi/
โ”œโ”€โ”€ pkg/internal/apis/
โ”‚   โ”œโ”€โ”€ RoutesRegistry.go (modified - added routes)
โ”‚   โ””โ”€โ”€ handlers/
โ”‚       โ”œโ”€โ”€ scoreboard_handler.go (new - 356 lines)
โ”‚       โ””โ”€โ”€ scoreboard_handler_test.go (new - 143 lines)
โ”œโ”€โ”€ webapp/src/routes/
โ”‚   โ”œโ”€โ”€ (public)/scoreboard/
โ”‚   โ”‚   โ””โ”€โ”€ +page.svelte (new - public view)
โ”‚   โ””โ”€โ”€ my/scoreboard/
โ”‚       โ”œโ”€โ”€ +page.svelte (new - 183 lines)
โ”‚       โ”œโ”€โ”€ types.ts (new - type definitions)
โ”‚       โ””โ”€โ”€ [type]/[id]/
โ”‚           โ””โ”€โ”€ +page.svelte (new - detail view)
โ””โ”€โ”€ docs/
    โ”œโ”€โ”€ SCOREBOARD.md (new - documentation)
    โ””โ”€โ”€ ARCHITECTURE.md (this file)