Schema Overview
Database tables and their relationships.
Overview
DirectoryKit uses Supabase (PostgreSQL) with the full schema defined in supabase/schema.sql.
Core tables
| Table | Purpose |
|---|---|
users | User profiles with auth, roles, settings |
apps | Project/listing submissions |
categories | Category definitions with sphere assignments |
payments | Payment records linked to Stripe |
newsletter | Newsletter subscriber emails |
comments | User comments on projects |
ratings | Star ratings for projects |
bookmarks | User bookmarks/favorites |
promotions | Paid promotional placements |
partners | Partner/sponsor entries |
backlinks | Backlink tracking records |
analytics | Page view and event tracking |
sidebar_content | Admin-managed sidebar widgets |
external_webhooks | External webhook configurations |
changelog | Admin changelog entries |
email_notifications | Email notification queue |
site_settings | Site-wide settings (themes, etc.) |
link_type_changes | Link 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.