Skip to main content

Overview

Events are the core entity in EventPalour. Each event belongs to a workspace and can be configured as online, physical, or hybrid with various status states and pricing models.

Event Schema

The events table contains comprehensive event information:
FieldTypeDescription
idvarchar(16)Unique event identifier
short_idvarchar(6)6-character short ID for URLs (unique)
titlevarchar(255)Event title
descriptiontextFull event description
workspace_idvarchar(16)Owner workspace (foreign key)
category_idvarchar(16)Event category (foreign key)
statusevent_status_enumCurrent status (default: “active”)
typeevent_type_enumEvent type (default: “physical”)
pricingevent_pricing_enumPricing model (default: “free”)
venuetextPhysical location details
countrytextCountry
citytextCity
online_linktextMeeting link for online/hybrid events
queue_counterintegerWaitlist counter (default: 0)
start_datetimestampEvent start time (with timezone)
end_datetimestampEvent end time (with timezone)
is_recurringbooleanRecurring event flag (default: false)
recurrence_patternvarchar(32)Pattern (e.g., “weekly”, “monthly”)
recurrence_daystextComma-separated or JSON string of days
created_attimestampCreation timestamp
updated_attimestampLast update timestamp

Event Types

EventPalour supports three event delivery models:

Online

Virtual events conducted entirely online. Requires online_link field.

Physical

In-person events at a physical venue. Requires venue, city, and country fields.

Hybrid

Both online and physical attendance options. Requires both location and meeting link.
// From /lib/db/schema/enums.ts:29-33
enum EventType {
  ONLINE = "online",
  PHYSICAL = "physical",
  HYBRID = "hybrid"
}

Event Status

Events transition through different statuses during their lifecycle:
1

Active

Event is live and accepting registrations/ticket sales.
2

Inactive

Event is hidden and not accepting new registrations.
3

Postponed

Event is delayed to a future date. Original details preserved.
4

Canceled

Event is permanently canceled. May trigger refund workflows.
// From /lib/db/schema/enums.ts:35-40
enum EventStatus {
  ACTIVE = "active",
  INACTIVE = "inactive",
  CANCELED = "canceled",
  POSTPONED = "postponed"
}
Changing event status to canceled may have financial implications for paid events. Ensure proper refund handling is in place.

Pricing Models

Events can be configured as free or paid:
PricingDescriptionUse Case
FreeNo payment requiredCommunity meetups, public talks, open events
PaidRequires ticket purchaseConferences, workshops, premium events
// From /lib/db/schema/enums.ts:54-57
enum EventPricing {
  FREE = "free",
  PAID = "paid"
}
For free events, use the event_registrations table to track attendees. For paid events, use the tickets and purchased_tickets tables.

Event Categories

Categories help organize events within a workspace. The events_categories table:
{
  id: varchar(16),              // Category ID
  workspace_id: varchar(16),    // Owner workspace
  name: varchar(255),           // Category name (e.g., "Tech Talks", "Workshops")
  created_at: timestamp,
  updated_at: timestamp
}
Categories are workspace-scoped. Each workspace defines its own category taxonomy.

Event Relationships

Event Images

Store multiple images per event in events_images table:
{
  id: varchar(16),
  event_id: varchar(16),        // Foreign key to events
  // Image URL stored separately in cloud storage
}

Event Speakers

Manage speaker information with the events_speakers table:
FieldTypeDescription
idvarchar(16)Speaker ID
event_idvarchar(16)Associated event
namevarchar(255)Speaker name
emailvarchar(255)Contact email
titlevarchar(255)Professional title (e.g., “Senior Engineer”)
talktextTalk/presentation topic
biotextSpeaker biography
image_urltextProfile image URL
twitter_handlevarchar(255)X/Twitter handle
linkedin_urltextLinkedIn profile
instagram_handlevarchar(255)Instagram handle
statusspeaker_status_enumApproval status (default: “pending”)
submission_typespeaker_submission_type_enumHow they joined (default: “self_applied”)
scheduled_timetimestampPresentation time slot
is_listedbooleanShow on event page (default: true)

Speaker Status

enum SpeakerStatus {
  PENDING = "pending",      // Awaiting organizer approval
  APPROVED = "approved",    // Confirmed speaker
  REJECTED = "rejected"     // Application declined
}

Speaker Submission Types

Speaker was invited directly by the event organizer. Generally auto-approved.
Enable public speaker applications through speaker_application_links:
{
  id: varchar(16),
  event_id: varchar(16),
  link_token: varchar(64),          // Unique public link token
  is_active: boolean,               // Can be revoked (default: true)
  expires_at: timestamp,            // Optional expiration
  max_applications: integer,        // Optional application limit
  current_applications: integer,    // Current count (default: 0)
}

Event Partners

Track sponsors and partners in events_partners:
{
  id: varchar(16),
  event_id: varchar(16),
  name: varchar(255),               // Partner/sponsor name
  logo_url: text,                   // Logo image URL
  website_url: text,                // Partner website
  type: varchar(50)                 // "sponsor" or "partner" (default: "sponsor")
}

Recurring Events

Events can repeat on a schedule using these fields:
  • is_recurring: Set to true to enable recurrence
  • recurrence_pattern: Frequency like “weekly”, “monthly”, “daily”
  • recurrence_days: Days when event occurs (format: comma-separated or JSON)
{
  "is_recurring": true,
  "recurrence_pattern": "weekly",
  "recurrence_days": "monday,wednesday,friday"
}

Queue Management

The queue_counter field tracks waitlist position when events reach capacity:
Increment queue_counter when adding users to the waitlist. Use this value to determine their position and notification priority when tickets become available.

Event Registration

For free events, registrations are tracked in event_registrations:
{
  id: varchar(16),
  user_id: varchar(16),             // Registered user
  event_id: varchar(16),            // Target event
  registered_at: timestamp,         // Registration time
  checked_in: timestamp,            // Check-in time (nullable)
}
The system enforces a unique constraint on (user_id, event_id) to prevent duplicate registrations.

Best Practices

The 6-character short_id creates user-friendly URLs like eventpalour.com/e/abc123. Ensure these are generated to be unique and URL-safe.
start_date and end_date use timestamp with timezone. Always store in UTC and convert to local timezone for display.
  • Online: Require online_link
  • Physical: Require venue, city, country
  • Hybrid: Require all location and online fields
Implement proper workflow validation:
  • Active → Postponed (update dates)
  • Active → Canceled (trigger refunds)
  • Inactive → Active (re-enable registrations)

Technical Details

Schema Location

/lib/db/schema/events.ts
/lib/db/schema/enums.ts

Key Relationships

Defined in /lib/db/schema/relations.ts:169-186:
  • Events belong to one workspace (many-to-one)
  • Events belong to one category (many-to-one)
  • Events have many images, speakers, partners, tickets, announcements (one-to-many)

Database Constraints

  • short_id must be unique across all events
  • Foreign key to workspace.id cascades on delete
  • Foreign key to events_categories.id does not cascade (protect existing events)

Build docs developers (and LLMs) love