Appearance
Mobile BFF Endpoints
All endpoints require Clerk + Org authentication (handled by gateway). Routed via https://g2-elite-gateway.2pw.workers.dev/api/mobile/*.
Home
GET /api/mobile/home
Home screen data: active seasons + upcoming games (next 7 days).
Teams
GET /api/mobile/teams
List teams. Query params: ?seasonId=, ?sportId=
GET /api/mobile/teams/:id
Team detail with full player roster.
GET /api/mobile/teams/:teamId/player-stats
Season stat totals for all players on a team. Returns sport-specific stats (baseball, football, soccer, basketball, volleyball).
Players
GET /api/mobile/players/search?name=
Search players by name (fuzzy, case-insensitive). Minimum 2 characters.
Schedule & Games
GET /api/mobile/schedule
Games list. Query params: ?teamId=, ?startDate=, ?endDate=
GET /api/mobile/games/:gameId/player-stats
Per-game stat events. Query param: ?teamId=
POST /api/mobile/games/:gameId/player-stats
Create a game stat event (scoring).
PATCH /api/mobile/games/:gameId
Update game fields: homeScore, visitorScore, homeJerseyColor, visitorJerseyColor, snackParentName, snackParentPhone, officialScorer.
GET /api/mobile/games/:gameId/team-history
Umpire intel: past reports for both teams in a game.
Standings
GET /api/mobile/standings?ageGroupId=&seasonId=
League standings by age group.
Sports, Seasons, Facilities
GET /api/mobile/sports
Active sports.
GET /api/mobile/seasons
Seasons. Query param: ?sportId=
GET /api/mobile/facilities
Facility list with addresses.
Parent-Player Linking
POST /api/mobile/parent-links
Link a parent to a child player. Body: { "playerId": "uuid" }
GET /api/mobile/parent-links
Get the current parent's linked children.
Coach
GET /api/mobile/coach/teams?coachName=
Find teams by coach name (for onboarding confirmation).
Chat (HTTP Polling)
GET /api/mobile/chat/rooms
List chat rooms. Query params: ?teamId=, ?type=
GET /api/mobile/chat/rooms/:roomId/messages
Message history. Query params: ?before= (pagination), ?limit=
POST /api/mobile/chat/rooms/:roomId/messages
Send a message. Body: { "content": "text", "replyToId": null }
GET /api/mobile/chat/rooms/:roomId/poll?since=
Poll for new messages since a timestamp.
Push Notifications
POST /api/mobile/push-token
Register an Expo push token. Body: { "token": "ExponentPushToken[...]", "platform": "ios", "teamId": "uuid" }