Skip to main content
8Space uses PostgreSQL via Supabase with a comprehensive schema for multi-tenant project management, including projects, tasks, workflows, and team collaboration features.

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_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
  • tenant_members: User membership in tenants
  • project_members: User membership in projects
Both support role-based access control.

Migrations

Migrations are located in packages/app/supabase/migrations/ and applied in chronological order.

Migration History

View the full migration content in packages/app/supabase/migrations/ to understand the schema evolution.

Database Functions

Project Management

Permission Helpers

These functions are used in Row Level Security policies:

Analytics

Returns JSON with:
  • tasksByStatus: Task counts by workflow column
  • overdueCount: Number of overdue tasks
  • dueThisWeek: Tasks due in next 7 days
  • workloadByAssignee: Active tasks per team member
  • completionTrend: 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

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:
The trigger extracts name and avatar from OAuth metadata (supports Google OAuth).

Updated At Timestamps

Automatic timestamp updates on record changes:

Database Backup

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