Ir al contenido principal
Petanque Life

Dynamic Data Integration

F18.11 10 funcionalidades

En resumen

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.

Cómo funciona

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.

Capacidades clave

  • 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

En la práctica

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.

Funcionalidades de este subsistema

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