Schema Overview

Database tables and their relationships.

Overview

DirectoryKit uses Supabase (PostgreSQL) with the full schema defined in supabase/schema.sql.

Core tables

TablePurpose
usersUser profiles with auth, roles, settings
appsProject/listing submissions
categoriesCategory definitions with sphere assignments
paymentsPayment records linked to Stripe
newsletterNewsletter subscriber emails
commentsUser comments on projects
ratingsStar ratings for projects
bookmarksUser bookmarks/favorites
promotionsPaid promotional placements
partnersPartner/sponsor entries
backlinksBacklink tracking records
analyticsPage view and event tracking
sidebar_contentAdmin-managed sidebar widgets
external_webhooksExternal webhook configurations
changelogAdmin changelog entries
email_notificationsEmail notification queue
site_settingsSite-wide settings (themes, etc.)
link_type_changesLink type audit trail

Security

All tables have Row Level Security (RLS) enabled. The database layer (lib/supabase/database-supabase.ts) uses the service role client which bypasses RLS.

Timestamps

created_at and updated_at are handled by database triggers — don't pass them manually in inserts or updates.