Quick Start
1
Start Supabase
Initialize the local Supabase instance:
2
Apply Migrations
Reset the database and apply all migrations:This applies all migrations in order and runs the seed data.
3
Verify Setup
Check the Supabase Studio:
Database Schema
Core Tables
The database schema supports multi-tenant project management with role-based access control.Profiles
User profiles are automatically created when users sign up:Tenants
Multi-tenant workspaces for team isolation:Each tenant has a unique slug used for URL routing:
/app/t/{tenant-slug}Projects
Projects belong to tenants and contain tasks:Tasks
Core entity for work items:Workflow Columns
Kanban board columns for task status:Custom Types
The schema defines several enums for type safety:Supporting Tables
Task Relationships
Task Relationships
- task_assignees: Many-to-many task assignments
- task_labels: Project-scoped labels
- task_label_links: Task-to-label associations
- task_checklist_items: Subtasks within tasks
- task_attachments: File references
- task_dependencies: Task predecessor/successor links
- task_activity: Audit log for task changes
Team Management
Team Management
- tenant_members: User membership in tenants
- project_members: User membership in projects
Migrations
Migrations are located inpackages/app/supabase/migrations/ and applied in chronological order.
Migration History
Database Functions
Project Management
Permission Helpers
These functions are used in Row Level Security policies:Analytics
tasksByStatus: Task counts by workflow columnoverdueCount: Number of overdue tasksdueThisWeek: Tasks due in next 7 daysworkloadByAssignee: Active tasks per team membercompletionTrend: Daily completion counts
Row Level Security
All tables have RLS enabled with policies based on tenant and project membership:RLS ensures users can only access data within their tenants and projects, with appropriate permissions.
Seed Data
The seed file (packages/app/supabase/seed.sql) creates demo data:
Test Users
All users have password:password123
- owner@gantt.local - Olivia Owner (tenant owner)
- editor@gantt.local - Ethan Editor (tenant admin)
- viewer@gantt.local - Vera Viewer (tenant member)
Demo Content
- 1 tenant: “8Space Demo” (
demo-space) - 1 project: “Product Launch Q2”
- 4 workflow columns: Backlog, To Do, In Progress, Done
- 5 tasks with various states
- 3 labels: Frontend, Backend, Urgent
- Task assignments, checklist items, and dependencies
Triggers
Auto Profile Creation
When a user signs up, a profile is automatically created:Updated At Timestamps
Automatic timestamp updates on record changes:Database Backup
- Local Development
- Production
Supabase local data is ephemeral. To preserve data:
Indexes
Optimized indexes for common queries:Schema Reference
View the complete schema in the migration files:- Initial schema:
packages/app/supabase/migrations/20260212220000_init_gantt_mvp.sql - Multi-tenant:
packages/app/supabase/migrations/20260217143000_multi_tenant_onboarding.sql
Next Steps
Authentication
Configure Supabase Auth providers
Environment Variables
Set up required environment variables