Data Flow: Westside Basketball

arch-dataflow-westside-basketball Architecture

architecture

Data Flow

How information moves through the system at runtime. Answers: what happens when?

Key flows

  • Registration: Stripe payment → webhook → DB record → email with token → parent fills form → waiver signed. Two entry points to parent creation (Stripe webhook vs form submission) — must converge on same record.
  • Tryout day: Admin checks players in via dashboard → coaches see live roster on phones. All mutations go through basketball-api JSON endpoints.
  • Team placement: Admin assigns players to teams via draft board. Sets player.team_id.
  • Contract signing → GroupMe join: Parent signs contract → contract_status flips to signed → basketball-api looks up team.groupme_share_url → sends welcome email via pal-e-mail with GroupMe share link → parent clicks link and self-joins the team group. No API member-add — parent self-joins. GroupMe API is source of truth for membership.
  • Email: Sent via pal-e-mail service (MJML templates, Gmail OAuth). Tenant account: westsidebasketball@gmail.com.
  • GroupMe admin ops: Group creation and announcements handled via groupme-mcp tools in agent sessions. Membership audits query GroupMe API on demand — no local replication.

Known bug (2026-03-13)

The registration form looks up parents by email (line 796 of register.py). If a parent uses a different email than Stripe checkout, a new parent record is created. The waiver lands on the new parent, not the paid one. Fix: match by token, not email.