MatchPlay Pro AI — Master Rebuild Document

Complete technical specification for rebuilding the platform (Table Tennis)

Table Tennis Only
React + Base44
Multi-Tenant
ELO Rankings
Digital Match Cards
Cup & Tournaments
AI Scorecard
PWA
Real-time Chat
Advertising Platform
MatchPlay Pro AI is a full-stack web application for managing table tennis leagues. It is built on React + Tailwind CSS + Base44 (backend-as-a-service). It is a multi-tenant SaaS platform where each league gets its own branded public-facing website and admin panel. The platform supports everything from player registration and team management through to digital match cards, live standings, cup competitions, tournaments, advertising, and communications.
• Frontend: React 18, Tailwind CSS, shadcn/ui components, Lucide React icons, Framer Motion, Recharts, React Router DOM v6, TanStack React Query
• Backend: Base44 BaaS (entities/database, backend functions via Deno, integrations, automations, auth)
• Auth: Built-in Base44 auth (admin role vs user role)
• Routing: React Router DOM — App.jsx is the single source of truth for all routes
• Each league has a unique league_url_slug stored in LeagueSettings
• Leagues are identified by either:
  - Subdomain: westwilts.ttleagueapp.com → subdomain = "westwilts"
  - Query param: ?slug=westwilts
• LeagueHelper.js (getCurrentLeague) handles detection with priority: subdomain → slug param → first available league (fallback)
• All internal links preserve the slug via createPageUrlWithSlug() helper
• Admin URLs use createAdminUrl() — no slug appended when on subdomain
• League data is cached in sessionStorage for 10 minutes
File also available at: /league-pro-ai-master-prompt.txt