Skip to content

Core Database

The core database is the platform's central directory. It answers three questions:

  1. Who is this user? (mapped from their Clerk sign-in)
  2. What organizations do they belong to? (and what role do they have in each)
  3. Where is that organization's data? (points to the right database)

Tables at a Glance

TableWhat It StoresKey Relationships
UsersName, email, phone — synced from Clerk→ has Memberships
OrganizationsLeague name, code, branding, database pointer→ has Members, Invite Codes, Config
MembershipsWho belongs to which org, with what role→ links Users to Organizations
Invite CodesJoin codes like FARM-PARENT-2026→ belongs to an Organization
ConfigPer-org plan tier and feature flags→ one per Organization
Audit LogWho did what, when, and why→ tracks admin actions

Key Concepts

One user, many orgs. A parent can belong to multiple leagues.

One user, many roles. A coach can also be a parent in the same org. Each role is a separate membership record.

Invite codes control access. Each code specifies the org and role. Umpire and staff codes require admin approval before the user gets access.

Database credentials are secrets. The org's database address is never stored in this database — only a reference name (like ORG_DB_FARM) that maps to a secure Cloudflare secret. It can't be read back.

Database Details

PropertyValue
TypeCloudflare D1 (SQLite)
LocationUS East (co-located with our services)
Tables6
PurposeRouting and identity — lightweight by design

Internal Documentation — Do Not Share