Skip to main content

Documentation Index

Fetch the complete documentation index at: https://285e39fd5e337e58f16290.sightscreen.app/llms.txt

Use this file to discover all available pages before exploring further.

System context diagram

This shows every system and external service in play, and the connections between them.

How data flows

1

Ingest

Two pollers fetch data from SportMonks. ScorePoller polls all active matches on a schedule with Cockatiel resilience (timeout, circuit breaker, retry). MarqueePoller polls the marquee league at higher frequency with ball-by-ball data included.
2

Detect

Raw score data flows into MatchEventBus, which routes it through the event detection pipeline. Tier0EventDetector catches high-priority events (wickets, milestones). Tier1EventDetector catches routine updates (score changes, over completions). Events pass through CooldownFilter and StalenessFilter to suppress duplicates and stale data.
3

Build

DisplayStateBuilder constructs a UnifiedDisplayState from the current match data, ready for both API responses and APNs payloads.
4

Deliver

LACoordinator receives prioritized events and coordinates delivery through ApnsDeliveryService to all subscribed devices. Priority determines APNs priority header (5 vs 10).
5

Serve

The iOS app also makes direct REST API calls to the backend for on-demand data — fixture lists, match details, standings, etc. HubDataService builds data for the admin UI.

Connection details

ConnectionProtocolAuthNotes
iOS to BackendHTTPS RESTCognito JWT in Authorization headerAll endpoints require auth except health check
Pavilion to BackendHTTPS RESTCognito JWTAdmin-scoped token with elevated permissions
Backend to SportMonksHTTPS RESTAPI key in query paramsRate-limited, polled on intervals with Cockatiel resilience
Backend to DynamoDBAWS SDKIAM roleAll persistent storage goes here
Backend to CognitoAWS SDKIAM roleToken verification, user pool management
Backend to APNsHTTP/2JWT-based APNs auth tokenDelivered via LACoordinator through ApnsDeliveryService
mock-sportmonksHTTPS RESTNoneLocal service that replays recorded SportMonks responses for testing
If push notifications stop working, check the APNs auth token expiry first. These tokens are short-lived and need periodic refresh.