Technical docs

Padel Connect architecture

Stack overview, data model, scoring engine, and production integrations.

Technology stack

Static export for Firebase Hosting at /padelconnect

Next.js 15

App Router, static export at /padelconnect

React 19

Client islands, hooks, forms

TypeScript

End-to-end type safety

Tailwind CSS 4

Mobile-first design system

shadcn/ui

Accessible UI primitives

Supabase

Auth, Postgres, realtime lobbies

Google Maps

Match map, Places search, add locations

FCM

Push: invites, reminders, scores

Framer Motion

Map markers & page motion

localStorage

Demo state & session persistence

Database schema

Supabase Postgres with RLS — players only see public matches and their lobbies.

TableKey fields
usersid, email, role, player_id, city, skill_level
playersid, name, stats (jsonb), favorite_club_ids[]
clubsid, slug, name, lat, lng, courts (jsonb)
matchesid, club_id, status, scheduled_at, scoring_config
match_playersmatch_id, player_id, team, status
lobbiesid, match_id
messagesid, lobby_id, sender_id, body
invitationsid, match_id, from_player_id, to_player_id, status
match_historyid, match_id, final_score (jsonb), winner_team
notificationsid, user_id, type, match_id, read

Padel scoring rules

Implemented in features/padelconnect/scoring.ts

· Points: 0 → 15 → 30 → 40. Deuce at 40–40 with optional golden point.

· Games: first to 6 with 2-game lead; tiebreak at 6–6 (7 points, win by 2).

· Sets: best of 1, 3, or 5; third set may be a super tiebreak to 10.

· Doubles serve rotation: A1 → B1 → A2 → B2, advancing after each game.

· Live scorer updates serve indicator and set history automatically.

API integrations

Supabase Auth

Google, Apple, and email magic links. JWT sessions for API routes.

supabase.auth.signInWithOAuth()
Google Maps Platform

Interactive map, Places Autocomplete, tap-to-pin for community padel locations. Set NEXT_PUBLIC_GOOGLE_MAPS_API_KEY (Maps JavaScript API + Places API).

maps.googleapis.com/maps/api/js
Firebase Cloud Messaging

Match invites, join approvals, lobby messages, start reminders.

POST /api/push/subscribe
Supabase Realtime

Live lobby chat and scoreboard sync across devices.

supabase.channel('lobby:{id}')
Weather API

Open-Meteo hourly forecast for outdoor court planning.

GET /api/weather?lat=&lng=

Explore the demo

This build uses localStorage. Try the map, live scorer, and lobby chat.