Event ticketing

An event happens at a venue and sells several ticket types, each with a price, a quota and a sales window. An order is one purchase of possibly several ticket types; every seat sold becomes a ticket with its own code, so the door can check each person in once. Promo codes discount an order and count their uses.

Start a project from this schema
$ npx vela create my-app --schema event-ticketing
users auth
  • id* text
  • password* password
  • tokenKey* text
  • email* email
  • emailVisibility bool
  • verified bool
  • name text
  • avatar file
  • created autodate
  • updated autodate
venues
  • id* text
  • name* text
  • address text
  • city text
  • location geo
  • capacity number
  • created autodate
  • updated autodate
events
  • id* text
  • title* text
  • slug* text
  • description editor
  • venue* venues
  • organizer* users
  • starts_at* date
  • ends_at date
  • cover file
  • status* select
  • created autodate
  • updated autodate
ticket_types
  • id* text
  • event* events
  • name* text
  • description text
  • price* number
  • quota* number
  • sold number
  • sales_start date
  • sales_end date
  • max_per_order number
  • created autodate
  • updated autodate
promo_codes
  • id* text
  • event* events
  • code* text
  • kind* select
  • value* number
  • max_uses number
  • uses number
  • expires_at date
  • created autodate
  • updated autodate
orders
  • id* text
  • number* text
  • event* events
  • buyer users
  • email* email
  • name* text
  • promo_code promo_codes
  • subtotal* number
  • discount number
  • total* number
  • status* select
  • payment_reference text
  • created autodate
  • updated autodate
tickets
  • id* text
  • order* orders
  • ticket_type* ticket_types
  • code* text
  • holder_name text
  • checked_in_at date
  • checked_in_by users
  • 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.