Skip to main content
Petanque Life

Dynamic Data Integration

F18.11 10 features

At a glance

Live data widgets that pull from the Petanque Life API straight into CMS pages — ranking tables, calendars, results, club directories, venue maps, live scores, player profiles, federation stats, upcoming events and sponsor banners. Editors configure a widget once, the renderer caches with TTL, and content stays fresh without manual updates.

How it works

Each widget is a CmsWidgetDataConfig document tied to a CmsSite, with a discriminated `widget_type` field and a type-specific data_source config (filters, org_node scope, time range, display options, cache TTL, auto_refresh). Editors configure a widget via the admin (POST/PATCH `/cms/sites/{id}/widgets`), drop the corresponding block into a page, and the renderer fetches at build/revalidation time from a public endpoint at `/public/cms/sites/{id}/widget-data/<widget>` or by saved config id. Ten widget types are live: ranking table (auto-updated standings filtered by competition, category and season), competition calendar (filtered by event type, org_node, time range), results (top-3 finishers per competition with type filter), club directory (region filter, contact and map display), venue map (type filter, auto-center, terrain count), live scores (during competitions, with mene detail and court display), player profile (club filter, stats enriched from PlayerStatistics), federation statistics (configurable metrics with trend data from FederationReport), upcoming events (event type filter, location and description) and sponsor banner (tier and entity filter, tiered logo sizing).

Cache TTL per widget balances freshness against load — live scores poll every 15s while club directory caches for 24h. All widget data flows through the public API which respects the same tenant scope and visibility rules as the rest of the platform, so a widget on a club site cannot accidentally expose another tenant's data. Audit trail covers widget config CRUD.

On the frontend, each widget has a dedicated React component (LiveScoreBlock, PlayerProfileBlock, FederationStatsBlock, etc.) styled to match the active TenantBrandStyle so widgets feel native rather than embedded.

Key capabilities

  • Ten widget types covering rankings, calendar, results, clubs, venues, live scores, profiles, stats, events, sponsors
  • Saved widget configs (`CmsWidgetDataConfig`) with type-specific filters and display options
  • Per-widget cache TTL and auto-refresh tuned per data type
  • Public widget endpoints respecting tenant scope and visibility
  • Live-score widget with mene-level detail during ongoing competitions
  • Sponsor banner with tier-based logo sizing for visual hierarchy
  • Tenant-themed React components so widgets match site branding

In practice

Lucas runs the website for FCB Petanque Bordeaux. For the ligue final hosted at his club he wants the home page to feel alive. He configures four widgets: a live-score widget filtered to the final's competition with 15-second polling, a sponsor banner showing gold-tier sponsors of the event, an upcoming-events widget for next month's friendlies, and the club's player-profile grid for top results in the past season.

He drops each widget block onto the home page in two minutes. During the final, hundreds of visitors watch live scores update in near-real time without refreshing; the page stays under 200ms TTFB because the renderer caches widget output and only the live-score component polls. After the final, the results widget auto-shows the podium without Lucas touching anything.

Features in this subsystem

10
ID Status Features
F18.11.01 Shipped Ranking table widget (auto-updated) ✅ PL-F1811a
F18.11.02 Shipped Competition calendar widget ✅ PL-F1811a
F18.11.03 Shipped Recent results widget ✅ PL-F1811a
F18.11.04 Shipped Club directory widget ✅ PL-F1811a
F18.11.05 Shipped Venue map widget ✅ PL-F1811a
F18.11.06 Shipped Live score widget (during competitions) — PL-F1811b ✅ PL-F1811b
F18.11.07 Shipped Player profile widget — PL-F1811b ✅ PL-F1811b
F18.11.08 Shipped Federation statistics widget (member count, club count, etc.) — PL-F1811b ✅ PL-F1811b
F18.11.09 Shipped Upcoming events widget — PL-F1811b ✅ PL-F1811b
F18.11.10 Shipped Sponsor banner widget — PL-F1811b ✅ PL-F1811b