Overview
Workspaces are the foundation of EventPalour’s multi-tenancy architecture. Each workspace represents an isolated environment where organizations can manage their events, team members, and event-related resources.Think of a workspace as your organization’s dedicated event management hub. All events, tickets, and team collaboration happen within the context of a workspace.
Data Model
Workspace Schema
The workspace table contains the following key fields:| Field | Type | Description |
|---|---|---|
id | varchar(16) | Unique workspace identifier (auto-generated) |
name | varchar(255) | Display name of the workspace |
description | text | Optional workspace description |
image_url | text | Workspace logo/avatar URL |
invite_code | text | Unique code for inviting members (unique, indexed) |
user_id | varchar(16) | Owner’s user ID (foreign key to user table) |
website | varchar(255) | Organization website |
phone | varchar(50) | Contact phone number |
social_x | varchar(255) | X (Twitter) profile URL |
social_facebook | varchar(255) | Facebook profile URL |
social_linkedin | varchar(255) | LinkedIn profile URL |
social_instagram | varchar(255) | Instagram profile URL |
social_github | varchar(255) | GitHub profile URL |
created_at | timestamp | Workspace creation timestamp |
updated_at | timestamp | Last update timestamp |
Workspace Members
Members are managed through theworkspace_members table:
Workspace Roles
Each workspace member has one of three roles:Admin
Full workspace access including member management, settings, and all event operations.
Moderator
Can manage events and content but cannot modify workspace settings or manage members.
Member
Basic access to view events and participate in workspace activities.
Roles are defined in
/lib/db/schema/enums.ts as:Workspace Relationships
A workspace is connected to multiple entities:Workspace Invitations
Workspaces can invite new members via theworkspace_invitations table:
| Field | Type | Description |
|---|---|---|
id | varchar(16) | Invitation ID |
workspace_id | varchar(16) | Target workspace |
email | varchar(255) | Invitee’s email address |
role | workspace_role_enum | Role to assign (default: “member”) |
invited_by | varchar(16) | User who sent the invitation |
token | varchar(64) | Unique invitation token |
accepted | boolean | Acceptance status (default: false) |
expires_at | timestamp | Expiration timestamp |
Multi-Tenancy Architecture
EventPalour uses workspace-based multi-tenancy where:- Data Isolation: All events, categories, and ticket types are scoped to a workspace
- Team Collaboration: Multiple users can be members of the same workspace
- Resource Ownership: Each workspace has a single owner (creator) but can have multiple admins
- Invite-based Access: Users join workspaces through unique invite codes or email invitations
Common Use Cases
Creating a Workspace
When a user signs up as an organizer, they’re prompted to create their first workspace:Inviting Team Members
Managing Multiple Workspaces
Users can be members of multiple workspaces with different roles:- Owner of “Tech Conference Co” (as creator)
- Admin in “DevOps Meetup Group”
- Member in “Community Events Hub”
Best Practices
Workspace Naming
Workspace Naming
Use clear, descriptive names that reflect your organization or event series. Names are displayed throughout the platform and in public event pages.
Invite Code Security
Invite Code Security
Treat invite codes as sensitive. They provide direct access to your workspace. Rotate codes if they’re accidentally exposed.
Role Assignment
Role Assignment
Follow the principle of least privilege. Start members with the “member” role and promote to “moderator” or “admin” as needed.
Social Links
Social Links
Technical Details
Schema Location
Database Constraints
invite_codehas a unique constraint and index for fast lookupsuser_idcascades on delete (deleting owner deletes workspace)- All member and invitation relationships cascade on workspace deletion
Automatic Fields
idis auto-generated using nano ID (16 characters)created_atdefaults to current timestampupdated_atautomatically updates on record modification