Gym memberships

A membership is a contract between a member and a plan, with its own start, end and status, so a member can pause, switch plans, or hold a history of past memberships. Check-ins record each visit against the membership that admitted it. Classes have a schedule and a capacity; bookings tie a member to one session and carry their attendance.

Start a project from this schema
$ npx vela create my-app --schema gym-memberships
users auth
  • id* text
  • password* password
  • tokenKey* text
  • email* email
  • emailVisibility bool
  • verified bool
  • name text
  • avatar file
  • created autodate
  • updated autodate
members
  • id* text
  • first_name* text
  • last_name* text
  • email* email
  • phone text
  • date_of_birth date
  • photo file
  • emergency_contact text
  • notes text
  • user users
  • created autodate
  • updated autodate
plans
  • id* text
  • name* text
  • description text
  • price* number
  • billing_period* select
  • class_credits number
  • active bool
  • created autodate
  • updated autodate
memberships
  • id* text
  • member* members
  • plan* plans
  • starts_on* date
  • ends_on date
  • status* select
  • price_paid number
  • notes text
  • created autodate
  • updated autodate
check_ins
  • id* text
  • member* members
  • membership memberships
  • checked_in_at* date
  • method select
  • created autodate
  • updated autodate
classes
  • id* text
  • name* text
  • description text
  • instructor users
  • capacity* number
  • duration_minutes number
  • level select
  • created autodate
  • updated autodate
class_sessions
  • id* text
  • class* classes
  • starts_at* date
  • room text
  • cancelled bool
  • created autodate
  • updated autodate
class_bookings
  • id* text
  • session* class_sessions
  • member* members
  • status* select
  • created autodate
  • updated autodate

Every collection, field and relation above becomes a PocketBase migration in the new project. Change any of it afterwards with vela generate migration --ai, which opens this same diagram as an editor.